Photon : Work offline

Whats the proper way to have the photon continue to work if it gets disconnected from the cloud ?

Would SYSTEM_THREAD(ENABLED) combined with automatic cloud mode be enough, or do I need to use either semi_automatic or manual mode ?

Recently I had a partial internet loss, where the photon could not reach particle, but I was still able to reach the data endpoint that it sends sensor readings to, but because the cloud was unreachable the photon stopped sending data to the endpoint that was reachable, especially on devices where the data endpoint is on the same LAN, it would make good sense to connect to cloud automatically, but not be dependant on that connection since its only used for code download.

@MORA i don’t have an answer for threading but for my user code in general i use this:

1 Like

I’ve been trying to come up with a MANUAL+THREADING mode wifi connection manager. Right now, I’m having some issues flashing this stripped down version of some working code to my Photon but it builds just fine:

Feel free to give it a whirl.

Edit: Sorry, I forgot to remove the call to WiFi.hasCredentials() since there’s an issue with it.