I’m having trouble understanding the use of the cloud to poll variables, functions on our device (Electron in my case).
I think I have registered my Electron OK – I can go to the dashboard and see its device id.
I previously installed “Node.js” and installed the Particle driver and installed Particle CLI with “npm install -g particle-cli”.
I have “flashed” my Electron with the example program: “functionvariable.ino” by using Particle Build to download the compiled code and flash the device over USB using: “particle flash --serial firmware.bin”. It seems to go OK now (after some initial failures).
Reading the Cloud API, I think I should be able to fetch the value of the photoresistor using the URL in Chrome:
https://api.particle.io/v1/devices/{my device id}/analogvalue -d access_token={my access token}
I get my device id from the Particle Dashboard, and the access token from Particle Build | Settings.
But I always get the response:
{
“error”: “invalid_request”,
“error_description”: “The access token was not found”
}
I suspect this is not a correct “rest” web service call. I don’t understand the implications of using the “curl” terminal app to show us examples.