There was a thunderstorm the other day and power went out for about 2 seconds due to lightning. Everything not on a UPS rebooted.
The house router rebooted and reconnected to the Internet, but the Spark core ended up flashing “no connection”, and I had to re-power it one time to get it to reconnect.
I suspect that It couldn’t find the Wi-Fi since that router was rebooting, and the router took longer than the Spark.
How do I have the core “hard reset” every few minutes if it loses (or never gets) a connection?
@Awake, @ScruffR is correct except if you are using system mode AUTOMATIC (default). In that case, the user code will block until the Cloud connection is re-established. In MANUAL or SEMI_AUTOMATIC modes the user code will be able to check the status as @ScruffR indicated and do the System.reset().