Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Erase saved WiFi access points

Open hieuv opened this issue 9 years ago • 8 comments

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?

hieuv avatar Mar 21 '17 08:03 hieuv

in code or permanently ? You can use the esptool to erase_flash entirely.

tablatronix avatar Mar 26 '17 16:03 tablatronix

Ah, yes. after a while I decided to erase flash and it turned out to be the solution.

But now I have two questions.

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

  2. If I want to erase WiFiMulti's stored credentials during run time, what are my options?

hieuv avatar Mar 27 '17 03:03 hieuv

It stores the last successful ap but not all. You can disable persistent to disaae autonsaving

tablatronix avatar Mar 27 '17 11:03 tablatronix

@hieuv did calling persistent(false) address your issue?

devyte avatar Sep 08 '17 03:09 devyte

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 avatar Sep 09 '17 07:09 hieuv

@hieuv were you able to reproduce the issue?

devyte avatar Oct 10 '17 06:10 devyte

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.

The answer to this question was covered here and here.

electron1979 avatar Jan 02 '18 12:01 electron1979

Closing due to age and previous comment.

devyte avatar Feb 28 '18 15:02 devyte