Long Term Photon Connection Stability

I’ve been using this

SYSTEM_MODE (MANUAL);
SYSTEM_THREAD (ENABLED);

and

if (!Particle.connected()) {
  if (!cloudConnecting) {
      Serial.println("Connecting to cloud!");
      Status::SetDeviceStatus(DEVICE_CLOUD_CONNECTING);
      Serial.println("Particle.connect()");
      Particle.connect();
      cloudConnecting = true;
  } 
} 
else {
  if (cloudConnecting) {
    Serial.println("Connected to cloud!");
  }
  cloudConnecting = false;
}

This manages my connection with complete success.

I have also seen the problem you have outlined with green flashing LED. I found it was my use of a UDP socket that was causing it - I had to add a timer to rebuild my socket 5 seconds after a reconnection to the network.

This problem has been outlined here if you want to have a read.

1 Like