Having trouble when cloud connection is lost. Photon appears unable to reconnect to cloud.
Running in SYSTEM_MODE(MANUAL) and SYSTEM_THREAD(ENABLED).
Everything works great under these conditions:
- Manual connect to cloud via Particle.connect()
- Cloud connection stays alive nicely via frequent calls to Particle.process()
- If WiFi network goes away (e.g., power down of WiFi Access Point we're connected to), and then comes back (e.g., WiFi Access Point is powered back up), the Photon magically reconnects to the WiFI and then the cloud, without any special intervention from the application code. (Nice!)
However, in the following scenario there is a problem:
If the WiFi network connection stays up, but the Internet connection beyond the Access Point goes down (or perhaps is running very slow), then the cloud connection dies (makes sense) (Particle.connected() returns false, but WiFi.ready() returns true)
Yet, when the Internet connection beyond the Access Point returns, the cloud connection doesn't restore. (i.e., Particle.connected() continues to return false). Not automatically, not with attempted intervention via various reconnect call sequences from application code. Have tried application code call sequences such as: WiFi.disconnect(), WiFi.off(), Particle.connect(); as well as just Particle.connect().
I haven't been able to find any application code call sequence I can make that will get the cloud connection back once it fails like this. The only way I'm able to get the cloud connection back is to power cycle the whole system (at which point it connects fine to the cloud).
Running firmware 0.6.2
How can I make the cloud connection reconnect when running in SYSTEM_MODE(MANUAL) and SYSTEM_THREAD(ENABLED)?