Erase saved WiFi access points
I used WiFiMulti in the past to connect to different WiFi networks. Now I want to forget all of those WiFi configurations (the module keep trying to connect to a (now turned) bad AP).
I tried to follow #1494 and investigate these solutions:
ESP.eraseConfig();
*((int*)0) = 0;
ESP.eraseConfig();
ESP.reset();
Neither worked.
Do anyone know any better way to do this?
in code or permanently ? You can use the esptool to erase_flash entirely.
Ah, yes. after a while I decided to erase flash and it turned out to be the solution.
But now I have two questions.
-
I read some GitHub issues and learned that WiFiMulti is not actually using the flash space reserved for storing WiFi credentials. If so, how is it storing WiFi credentials in a non-volatile way?
-
If I want to erase WiFiMulti's stored credentials during run time, what are my options?
It stores the last successful ap but not all. You can disable persistent to disaae autonsaving
@hieuv did calling persistent(false) address your issue?
To be honest with you, this was so long ago that I do not remember any details anymore. I will see if I can reproduce the issue and see if the solution above fixes it.
@hieuv were you able to reproduce the issue?
WiFi.disconect() worked for me first go.
ESP.eraseConfig then ESP.reset() OR ESP.eraseConfig() then ESP.restart() did not work for me.
I did not try the *((int*) 0) = 0; thing.
Closing due to age and previous comment.