'colors' error message on google-cloud-datastore-tutorial

It won’t let me post it because it is too long :frowning:

If you want to stop I understand. I have no idea what we are doing really besides trying to install an earlier version of npm with the end goal of installing the google cloud storage tutorial. With this tutorial will I be able to store data from my particle device on google cloud and be able to create graphs and set up alerts? This is my end goal. So if I am on the wrong track please let me know so I can stop bothering you!

Definitely looks like all the required modules are installed.

This tutorial allows you to store data into Google Cloud datastore as the name suggests. Creating graphs is possible but not covered in the tutorial.

Something easily would be to search in the community on ThingSpeak, Ubidots etc for graphing.

For alerts, do look into IFTTT. :wink:

Gotcha and thank you. I ran the node tutorial.js command and it replied the below. Am I ok even though there are a lot of errors?

cliftons-brain:google-cloud-datastore-tutorial Zeytin$ node tutorial.js
Authenticating with Google Cloud...
Authentication successful!
Auth error:Error: ENOENT: no such file or directory, open './gcp_private_key.json'
E0807 10:45:52.162344000 140736677286848 plugin_credentials.c:74]      Getting metadata from plugin failed with error: ENOENT: no such file or directory, open './gcp_private_key.json'
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open './gcp_private_key.json'
    at /Users/Zeytin/google-cloud-datastore-tutorial/node_modules/grpc/src/node/src/client.js:569:15

If you look at the errors, they tend to give you a hint of what's wrong.

The tutorial requires creating a gcp_private_key.json file that you will put in the directory but you have not done it yet, hence the error.

1 Like

Got it! So I got a few of these replies but I guess now I need to set up a cloud datastore database. I’ll start working on this now. Stupid question; will I need to with back to a current npm to do any other work? Like the particle-cli?

There was an error storing the event { Error: The project "my-project-xxxxxxxxxxxxx" does not exist or it does not contain an active Cloud Datastore database. Please visit http://console.cloud.google.com to create a project or https://console.cloud.google.com/datastore/setup?project="my-project-149xxxxxxxxxx" to add a Cloud Datastore database. Note that Cloud Datastore always has an associated App Engine app and this app must not be disabled.
    at /Users/Zeytin/google-cloud-datastore-tutorial/node_modules/grpc/src/node/src/client.js:569:15 code: 404, metadata: Metadata { _internal_repr: {} } }
Particle event stored in Datastore!
 { gc_pub_sub_id: '740xxxxxxxxxxx',
  device_id: '5a0036xxxxxxxxxxxxx',
  event: 'Humidity',
  data: '59.1%',
  published_at: '2017-08-05T16:44:06.185Z' }

Hi Kenneth,

As I feared now I cannot flash to my devise. Not sure what we did above but now I’m stuck. :frowning:

brain:~ Zeytin$ particle flash --serial firmware.bin
! Error loading module 'serialport': Module version mismatch. Expected 48, got 57.
Please reinstall the CLI again using npm install -g particle-cli 

thoughts?

How about considering this hint?

What version CLI have you got installed currently?
What's the system version on your device?

Thanks for the help!

Hi @ScruffR

Yes I did try that. Here is what it says:

    brain:~ Zeytin$ particle flash --serial firmware.bin
    ! Error loading module 'serialport': Module version mismatch. Expected 48, got 57.
    Please reinstall the CLI again using npm install -g particle-cli
    cliftons-brain:~ Zeytin$  npm install -g particle-cli
    npm WARN excluding symbolic link test/server/static/ie8-polyfill.js -> ../../../ie8-polyfill.js
    npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
    /Users/Zeytin/.nvm/versions/node/v6.11.2/bin/particle -> /Users/Zeytin/.nvm/versions/node/v6.11.2/lib/node_modules/particle-cli/bin/particle.js
    /Users/Zeytin/.nvm/versions/node/v6.11.2/lib
    └── particle-cli@1.23.1 

    brain:~ Zeytin$ particle flash --serial firmware.bin
    ! Error loading module 'serialport': Module version mismatch. Expected 48, got 57.
    Please reinstall the CLI again using npm install -g particle-cli

Sorry not sure how to get the version of CLI but the firmware version on the devise is 6.0