curl does not seem to recognize the Photon device. I have uploaded a simple LED code to the Photon and have been able to turn it on via the Android Particle app. However, when attempting to post to the same function that turns on the LED using javascript, nothing happens. When trying to debug this using curl on my Windows 64 system, I get the following error:
I tried a few other commands I found on this forum including “ping” which seems to indicate it is not online, “online”:false, even though the Particle app is able to control the led parameter set to “on” or “off”.
One curious thing that I do not see in any posts or in Simon Monk’s book is that the Web IDE link that reports the access code states that the access code is not valid for any products. I tried regenerating the access code, but each one says the same thing. I’m not sure what that’s about.
I had wondered if spark.io had been deprecated. I’m new, and I really didn’t want to post without reading all the other posts. I’m also following along in a “Getting Started with the Photon” book. So, between all of that, I became confused a bit.
I will carefully read through the reference documents now. I actually had read some of them regarding access tokens, but again, that was a bit complicated involving setting up customer details and etc. none of which I thought was relevant.
By the way the book I’m reading recommends this bit of javascript to access the functions. Let me know if you see any deprecated elements as well:
@ScruffR: BTW - sorry I didn’t mention, your example worked… and it took just a second to respond on the Photon… whereas my old code took forever to respond with the error, but that makes sense. Anyway, thank you again.
Update on the above code snippet above. The lines with $.post in them just needed that params string changed to args as shown below:
$.post(url, {args: “on”, access_token: accessToken});
and in the function switchOff()
$.post(url, {args: “off”, access_token: accessToken});