I'm trying to get started creating a website that will integrate with my Particle devices, and it looks like I'm falling into a knowledge gap that others have been in before. I have a Boron LTE running firmware, which correctly exposes variables to, and initiates function calls from, the Particle Console. I'd like to do the same with the Spark Helper example created by JFlasher (yes, I realize this example has been around longer than this company has been called Particle, let me know if there's a more modern version). I have created an OAuth Client from the console, and entered the Client ID and secret, but I'm so far only receiving error messages.
Is there any reason to believe this example won't work with the Particle Cloud anymore? Is there another example or tutorial I should be starting from?
I'm posting a similar issue to the Spark-Helper GitHub.
General thoughts here, if I knew a bit more about what youāre trying to do, I will reply more specifically. Think you have two options if you want to deal with the device data. If you want to be able to look at historical data (what did the temperature do over the last three days?) you need to write the data from the device, to some storage that you manage. Iād use a webhook, publishing the data maybe every hour, somehow encoding it so youāre sending as little data as possible. Once stored (for exampleā¦ mysql), you can report the data.
For a variable as it exists right now, your webpage would have something like:
Historical data is something we plan on adding down the road, but at this point live data and function control are enough for us.
From what I have read so far your advice is spot on, I was just hoping to see a live working example, and it looked like some effort had been put into that here.
JFlasher has informed me on his GitHub that heās no longer supporting his repo.
Iāve moved on to try to get BDubās Remote-Spark Web App working, but I canāt get the code to upload to my Boron. I have changed all instances of āSparkā to āParticleā in the sketch, which should help handle the name change, but I still get an error when trying to upload (see pastebin below). I am able to upload my own firmware which should be of comparable size (two functions and four variables).
Bill, Iām looking at index.html in the Remote-Spark repo; thereās a line that sets a variable baseURL to āhttps://api.spark.io/v1/devices/ā. Iām pretty sure changing āsparkā to āparticleā here will be incorporating your feedback.
Once I have the firmware uploaded, and I have my webpage requesting data from the right place, I think I have some questions about name discrepancies in the OAuth credentials. When I try to get Client Credentials from particle Console I get a Client ID and Client Secret; however, other documentation I see refers to an accessToken and a Core ID. Iām assuming the accessToken is the Client Secret, but Iām not quite sure if the Core ID is the Client ID or the ID I get from the Device page on the Particle console.