There are couple different ways to reconnect a device (Electron) when the Particle cloud disconnects. We would like to know the most appropriate/best method in order to reconnect a device after disconnecting from the cloud.
We are running and Electron in manual mode and with system threading enabled.
Our pseudo-code that we have currently for reconnecting an electron (this function is called in loop() that runs at 1 Hz):
reconnect(): if particle is not connected: particle connect failedConnect++ if failedConnect > 3: system reset else: failedConnect = 0
Our team thinks this may not be most appropriate method in order to reconnect a device after losing connection. Are there any steps that we are missing or is there is a better way to reconnect a device?