All, I have a bunch of Electrons which are solar powered so, they spend most of the day napping with the Cellular radio off to save power. Once an hour, they wake and connect to send the hour’s data. Based on the number of devices and the number of hours during their workday, I am getting about 99.25% success rate. Thing is that I would like to get better if I could as even this rate causes about 3 alerts a day.
The full code can be found here: https://github.com/chipmc/Cellular-Pressure
But, the commands I use to connect are:
Cellular.on(); // Turn on the radio Particle.connect(); // Start the connection process waitFor(Particle.connected,60000); // Give us up to 60 seconds to connect Particle.process(); // Process just in case
Since the connection process is blocking, I am not sure I want my device unresponsive to counts for more than 60 seconds.
I have looked at @rickkas7’s excellent electronsample code but, the connection code does not like the fact that my device sleeps most of the hour and I get a lot of resets.
Any suggestions for improvement? 1-2 less alerts a day would be nice and as the number of devices grows, it could become 10-20.