WiFiManager-How to reset NodeMCU to New State

I'm trying to use WiFiManager with my NodeMCU and a sketch which is working.

After wasting a lot of time with wiFiManager, I reduced the problem to a single line to start up:

( wifiManager.autoConnect(); ) but nothing worked.

In desperation, I tried a brand new, never used new NodeMCU module.
SUCCESS! The module showed up on my cellphone, and I was able to log onto it and give it my new credentials.

Now, the new module responds the same as did the original. It seems to have retained the credentials given it in response to my "discovering" it with my cellphone. It is no longer "discoverable."

My conclusion is that in order to re-program the chip, it must be first reset to the original factory conditions.
My problem is how to do this.

Any suggestions?

(Note: I had previously posted this to a different Forum section, and got zero responses.)

  • Matt

I dropped WifiManager myself, simply because i want to be able to access my unit in both AP and STA mode (and i want to control the way it looks), but in Tools -> Erase Flash , you can specify what gets erased with every new upload. WifiManager uses a separate part of EEPROM as far as i know, but try first with 'Sketch + Wifi Settings'

the ESP saves the WiFi credentials by default. Which is what you want in an IOT device.

I have not tried this myself, but WiFi.disconnect() will erase ssid/password, then ESP.reset(); will restart the ESP in AP mode.

Thanks to SteveMann!

I do want to have the system save the credentials, but when I start I want to start "from scratch."

WiFi.disconnect(); did the trick perfectly. (I may in the future also want to use ESP.reset();, but not now.)

Is there a list somewhere of the commands available in WiFiManager? I have wasted a lot of time on this so far.