Photon: How to run code when no WIFI or Internet


#1

Hello,

I have noticed that the micro-controller stops running my code, when I turn off the router, or I disconnect the WAN cable from the router.
Also Photon does not seem to start my code until it connected to the internet, which is not really good for me. Is it possible to setup that my code should run always?

Thanks!


#2

Sorry, I have just found the solution!
SYSTEM_THREAD(ENABLED);


#3

@atom, you also need to look at SYSTEM_MODE and make sure that if your code expects cloud connectivity, you check Particle.connected() first, for example.


#4

@peekay123, great, thanks for the info!