Is there an alternative to "pressing the Mode Button" for Smart Config & Clear Wifi Data?

@kennethlimcp I have another favor to ask.

Like you said WLAN_SMART_CONFIG_START = 1; is a flag that needs to be set to enter Smart Config mode. Is there a flag that can be set to Clear All Wifi Data (Equivalent to holding the Mode Button for ~10 seconds) ??

Thanks :smile:

@nitnut i believe it can be done but why would you want to do that? :smiley:

Anyway there was an update earlier like an hour ago which makes things much easier

This can turn off wifi or cloud connection or both

Let me dig up the code later. What’s your time zone like?

EDIT: Seems like this line can do the job

WLAN_DELETE_PROFILES = 1;

@kennethlimcp If I’m not wrong, entering your router credentials using Smart Config adds the SSID and Password you just entered to an already existing list of SSIDs & Passwords. This process has not been very reliable for me (I keep getting GFOD because of this) and often I have to end up clearing all wifi data before the Spark is up and running. So I’d like to have the Flag in hand for worst case scenarios.

OK so I just have to include the “.h” files and it works without having to call the functions in it? I shall test it out now. I currently don’t have a lot of use for it though.

I’m in India so its IST = GMT +530 out here. But drop a post at your convenience. Thanks so much already :smile:

I think right now, there’s only 1 SSID profile that is stored. Since Smart config aka listening mode would run
the code

WLAN_DELETE_PROFILES = 1;

Green means some issue between the router and spark core and if your wifi credentials are right the 1st time, it’s not going be the culprit :smile:

This is already old news... heh heh. Moving fast around here!

1 Like

Hey guys, I was wondering if this solution would work with the Photon too ?

Just in case anyone stumbles on this thread we have

WiFi.clearCredentials() to clear credentials and WiFi.listen() to enter listening/setup mode.