I am working on a device that will enter smart config mode when the user does some kind of button presses… I would like to be able to kick out of smart config mode in my spark device.
Is there a way to set WLAN_SMART_CONFIG_START=1; and then continue to run my code so that I can kick out of WLAN_SMART_CONFIG_START=0; ?
Or at least is there a way to set a timeout to reset the device or come back to normal mode?
There should be a way to run code when WiFi is offline. probably a sub like setup(), but for special occasions when the WiFi is not connecter or the cloud is not reachable. Maybe at the end of the offline process loop cycle, it can call a method or sub in the main code like : offline() { } or something like that, so we get a chance to make decisions and do work accordingly.
That or maybe be forced to decide during setup either to connect or not to connect in the setup method call. Something like a flag SYSTEM_WAIT_FOR_WIFI = false or any other way that allows us to run code either offline or while attempting to connect. Maybe even have other method calls or events like wifiWillAttemptToConnect(), wifiConnecting(), wifiConnected(), wifiCantConnect(), willAttemptToConnectAgain() so that we can make work or decisions during the offline process.