Our devices will disconnect from the cloud occasionally and will not reconnect with Particle.connect(). We will attempt to connect for 2 minutes using connect() and preform a system reset if this fails. Upon reset the device will reconnect immediately.
Here is an abridged version of our reconnect process:
// Particle.connect is called max once a minute
if (!Particle.connected() && Time.minute() != connectMinute){
this->fadeOrange->setActive(true);
Particle.connect();
failedConnect++;
switch(failedConnect){
case 1: fadeOrange->setSpeed(LED_SPEED_SLOW);
break;
case 2: fadeOrange->setSpeed(LED_SPEED_FAST);
break;
case 3: case 4: case 5: System.reset();
}
connectMinute = Time.minute();
} else if (Particle.connected()) {
failedConnect = 0;
}
The disconnects are happening randomly across several devices and run-time to disconnect is not consistent.
Could there be a issue elsewhere in the code preventing the electron from reconnecting normally?
Is there a way to for the electron to reconnect to the cloud without requiring a reset?