I have a Particle Photon. I would like to be able to tell the device to go into sleep mode for a while if it’s unable to connect to WiFi after trying for some amount of time. I have tried the following:
That’s at the top of my loop(). However, when I turn off the WiFi that the Photon connects to, it just flashes green until I turn the WiFi back on (at my router). Anyone have any ideas?
I just want it to basically give up and save power to try again later when it can’t connect to WiFi. When it can connect, everything works fine.
Thank you! I added this line and switched my code around to use some WiFi.ready() if statements and it’s working like a charm. The SYSTEM_THREAD(ENABLED) was key to getting my code to run instead of it halting on blinking green forever if it can’t see WiFi. Thanks!