Is there a way to set WLAN_SMART_CONFIG_START and continue running my code?

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?

Since no one had taken up this question yet, I’ll try my best to answer it :smile:

Once you set SMART_CONFIG_START=1, the core will enter the Smart config mode and this is controlled by the bootloader.

If you need a time out feature, that involves changing the bootloader so yeah

Thanks kennethlimcp!

So here are my thoughts:

  1. 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.

  1. Thanks for the answer!

anyway… my two cents :slight_smile:

This is in progress now for control over Cloud connection and user() code running without Wifi available :smile:

1 Like

Super awesome!


1 Like