I recently have had a number of Electron devices out in the field (remote installations) develop corrupted keys (both device and server keys). My primary solution to this will be to begin using this library to backup the keys to my SD Cards for now, but that is still not a perfect solution, and I want an OTA option for true redundancy.
However, when the devices’ keys became corrupted, the devices also began constantly resetting their network connection at the system firmware level. I have other services via MQTT that I use, and every few seconds the devices would disconnect from the cell network. This was so bad that a cellular provider said they might have to reduce service quality for those devices because of the connection spam.
What I want to do
I ultimately would be interested in storing all my device key backups in a cloud database and sending them to the device over MQTT when I have a Particle Key error. However, I cannot do this if the system firmware is constantly disconnecting my network.
I am running my Electron devices in
SYSTEM_MODE(AUTOMATIC); and with System Firmware
v0.6.4 . I would really like to separate the network connectivity from whether or not I have proper Particle Cloud keys, so I have some questions to that end:
- Why is the system firmware constantly resetting the entire network connection when only the keys are bad? Is this because the state machine is assuming a connection error after an unsuccessful cloud handshake?
- How can I prevent the device from doing this? Is my only recourse to detect the number of disconnections and then explicitly permanently disconnect from the Particle cloud until I have the backup keys ready to load? (which is how the above library approaches bad key detection for v0.6.4)
- Do subsequent system firmware versions fix any of this behavior? I use a lot of RAM and later system fw versions hog too much RAM for stable operation (amongst other issues) for me but if this is truly the best solution I can begin testing my fleet for a widespread upgrade (ugh).
@rickkas7 since you’ve worked with this in the past, do you have any insights? Btw your library above is rad / super helpful to probably fix this issue 99% of the time once I implement it, so thanks!
Also @ParticleD (whoops had tagged wrong Dave at particle haha) this was the issue I emailed support about a month ago. Zendesk auto-closed my ticket and my emails clearly weren’t getting through, so I gave up trying to get ahold of you guys. The support email thing really needs to get fixed, it hasn’t been functional for me at all.