I use the ThingSpeak library with the following snippet together my electron:
It works fine, but now I plan to add the Sleep Mode like this: System.sleep(D3, RISING, 3600, SLEEP_NETWORK_STANDBY);
What is the best way to verify the success of the data transfer to ThingSpeak or how should I implement the error-handling?
During the loop I would check with Particle.connected() the connection. If true I will first test the power of the lipo to the send a emergency call if I need to change the lipo. After that I will send the new data to ThingSpeak, but I only see the option to set and delay of some seconds and crossing my fingers that the data is transferred in this timeframe.
I’ve not used ThingSpeak, but a similar question was raised about ensuring a published event actually made it to the Particle servers. And the safest there was to self-subscribe to that event and go to sleep after that has triggered.
I’m not sure if you could read back your changed value to see if it made it there, but if you can, that would definetly a rather safe way.
Ah, great idea. I can observe the data feed of ThingSpeak from my own server and trigger an event on the Particle cloud with the latest value. If the values match the electron can sleep for same time.