I have several devices that I have been testing in areas with poor cell coverage and am using both Particle and 3rd-party SIM cards. They are currently running on firmware 0.5.1, in semi-automatic mode, with system threading enabled. I’m also calling Particle.keepAlive(60) and setting my APN, username, and password, for my 3rd-party SIM devices.
Because they are in areas with poor/inconsistent cellular connectivity (RSSI ranging from -90 dBm to -111 dBm and signal quality ranging from 7 to 25), my app calls a connectToCloud() method in setup() that calls Particle.connect(), waits 45 seconds to attempt successful connection (using waitFor()), then proceeds. Then in loop(), which runs every 3 seconds, if Particle.connected() is ever false, the same connectToCloud() method is called.
Separately, I have a watchdog callback that invokes System.reset() if the app thread does not check in or is blocked for more than 60 seconds.
Finally, to prevent the device from entering listening mode indefinitely, I have a setup handler that calls System.reset() if the device ever spends more than 2 minutes in setup mode.
This works well for several days and I can see my devices going offline and reconnecting as planned. However, after about a week of this, the devices become unresponsive and stay offline. If I run the devices in areas of very good cellular connectivity for the same period of time, I don’t notice any service interruption and the devices function normally, running my application without issues.
I thought I had covered all of my bases but I am clearly still missing something. Is it possible that frequent resetting could be bricking my devices after a certain number of resets? If so, how would this happen? Is it possible that the cloud keys are getting out of sync with the device keys? Where can I learn more about electron key management?
The only solution I have found is completely power-cycling the device. If I do this, the device resumes normal operation for another week or so.