-->
Page 2 of 3

Re: Clear Stored WiFi Credentials

PostPosted: Wed Feb 17, 2016 5:31 pm
by jra
If you use https://github.com/tzapu/WiFiManager to onboard your device there is a resetSettings() method to clear out the configuration. You could arrange to call that method if you want to do a factory reset. Try the AutoConnect example with the resetSettings line uncommented.

Re: Clear Stored WiFi Credentials

PostPosted: Fri Feb 26, 2016 4:45 pm
by craigfoo
Using WiFiManager.resetSettings() was a winner, thanks!

Re: Clear Stored WiFi Credentials

PostPosted: Fri Nov 04, 2016 10:22 pm
by sfranzyshen
craigfoo wrote:Using WiFiManager.resetSettings() was a winner, thanks!


Code: Select allvoid WiFiManager::resetSettings() {
  DEBUG_WM(F("settings invalidated"));
  DEBUG_WM(F("THIS MAY CAUSE AP NOT TO START UP PROPERLY. YOU NEED TO COMMENT IT OUT AFTER ERASING THE DATA."));
  WiFi.disconnect(true);
  //delay(200);
}


umm ... so the answer was really "WiFi.disconnect(true);" ...

Re: Clear Stored WiFi Credentials

PostPosted: Mon Dec 05, 2016 8:44 pm
by digbigg
craigfoo wrote:Thanks for the reply.

What if I wanted to implement a "factory reset" using a button? I want to programmatically erase all Wifi profiles that are saved in flash. I played around with the system_restore API and I think it's working but there might be a better way.


Hi Craigfoo, have you figured out the solution yet? I'm trying to implement same thing but no luck. I want to connect a switch to GPIO0 or GPIO2 so that I should be able to Reset the WifiManager and SPIFFS.format() configurations.
If you have the solution would you please share it. It help be a great help. Thanks