Is normal that Automatic mode in a not Internet condition is blocking?

The Photon device is, by default, in automatic mode. But in the case that there is no Internet coverage, is normal that is blocking, so the software on the device can’t run? Is there any way that if there is Internet, I can use the cloud system and in case there is no internet, the software on the device will start?

Yes it is.

But since you know AUTOMATIC mode, I’d assume you also know SEMI_AUTOMATIC (and MANUAL), which will help out there.
Additionally there is SYSTEM_THREAD(ENABLED).

Thank you for your reply. My solution, for now, is to use the following lines of code to connect to the WiFi network:

WiFi.connect();
waitUntil(WiFi.ready);

Of course the mode is the semi. What do you think about? Is there any way to let check if there is an Internet connection in the setup, in order to allow to flash the device from the cloud?

With your code you assume to have a WiFi network available otherwise that will again block indefinetly.

And in order to check if you can reach the internet once you got a WiFi.ready() you can always use WiFi.ping() and/or WiFi.resolve() or any other way to request data from the net.

But for OTA updates, you need a valid Particle cloud connection.

1 Like