Hi
I have saved WiFi Credentials to NVS by choosing WiFi storage as NVS configuration.
Is there a way to erase the WiFi config from NVS with code, and not by doing "make erase_flash" ?
I tried to create a wifi_config_t configuration by setting a null ssid and password but it does not seem to work, and the device auto connects on reboot with the older credentials.
Any suggestions ?
Thanks
Ankit
Erasing WiFi credentials from NVS with code
Re: Erasing WiFi credentials from NVS with code
you can try esptool.py from linux or esptool.exe from windows. use option erase_region . you can get the address of the data from partition table at the time of booting. I assume that you dont have any other user data in the partition table nvs
Re: Erasing WiFi credentials from NVS with code
At a quick guess, maybe the API esp_wifi_set_auto_connect() may be what you need. My loose thinking is that when the WiFi subsystem starts up, this flag is consulted. If we are flagged to "not" auto connect, then thats the end of the story. If we are flagged to auto-connect then the SSID/password would only then be sourced. Perhaps you could change your logic to change the flag such that when you have no valid credentials, then auto connect is off?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 115 guests