I have a set of devices (Electrons running Device OS 1.0.1) that are all running the same firmware. The code is almost 800 lines long so, here is the Github link: https://github.com/chipmc/Cellular-Pressure. Here is the concept of operations:
- During the park’s open hours, they “nap” until a car comes by: System.sleep(intPin, RISING, wakeInSeconds);
- Once an hour, they wake up (without resetting). and report their data using a Webhook - all these devices do this even the ones who were “last heard” days ago have been reliably reporting data every hour.
- Every night these devices “sleep”: System.sleep(SLEEP_MODE_DEEP, wakeInSeconds); waking (restarting program execution from scratch) every hour to pet the watchdog but not connecting.
- Every morning, when the park opens, we go back to #1
Some of these Electrons are not maintaining their “last handshake” of “last heard” status while the other 90% do. Why would this be the case? I looked at the device diagnostics from one of these devices and while there are the occasional disconnect events and one has “fair” signal strength that does not seem to explain why these devices are different from the rest.
This process seems to keep the devices connected - again - except for about 10% - not always the same ones and not even them consistently. What I am looking for is some solution that will improve the consistency and reliability of the devices over time - especially as I add more to the fleet.
I did look at asimilar post which discussed this in terms of availability for OTA updates and I saw there were two solutions proposed:
- From the cloud: curl -X PUT https://api.particle.io/v1/devices//disconnect?access_token=
- In the code: Particle.publish(“spark/device/session/end”, “”, PRIVATE);
But, these solutions drive additional data usage and for the 90% that are working correctly, it seems like overkill. Any suggestions?