Impact of WiFi reconnecting on loop execution (Automatic mode & Thread enabled)

My application is is running but sometimes my WiFi connection gets lost.
In Automatic Mode the device is attempting to reconnect automatically. which it does.
However: it might take several minutes before a successful reconnecion is established (which is NOT due to the Photon, but to the fact that the WiFi environment is rather unstable).
For my application this unstable connection is not critical: I only occasionally require interaction with Particle cloud.
However: is a several minutes-long state of the Photon trying to connect (flashing green) in one way or another impacting the execution of the loop????

Add SYSTEM_THREAD(ENABLED); near the top of your main source file (not in a function).

Without this, loop() will stop running when there is no cloud connection. With threading enabled, your loop code will run regardless of connectivity.

2 Likes

Thanks rickkas7!

@Jan_dM, do make sure you check for Cloud connectivity before attempting things like Particle.publish() that require connectivity otherwise these WILL block if not connected.

3 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.