ESP32 Wifi Component
Posted: Tue Aug 20, 2024 1:17 pm
I hit upon an odd bug when using the wifi component.
I wanted to create a list of SSIDs then enter the password - connect. This worked well on the first attempt. List of SSIDs displayed, password entered and all good.
Subsequent runs failed however - and looking at the debug output it looks as though the Wifi is auto magically connecting (although the wifi component doesn't know this) then crashing the esp32.
I wrote a simple demo of this - compile and run - and it should display 'Found n SSIDs' (where n is 4 in my case)
Recompile with the connect enabled (and SSID and password entered) - then Scan for SSIDS fails (as expected).
Disable connect - recompile and Scan SSID still fails - and debug output shows connect then crash.
A workaround is to do connect with ssid and password = "" immediately after initialisation (doing disconnect doesn't work) There might be an option in the config (wifi NVS storage to tweak here?)
Martin
I wanted to create a list of SSIDs then enter the password - connect. This worked well on the first attempt. List of SSIDs displayed, password entered and all good.
Subsequent runs failed however - and looking at the debug output it looks as though the Wifi is auto magically connecting (although the wifi component doesn't know this) then crashing the esp32.
I wrote a simple demo of this - compile and run - and it should display 'Found n SSIDs' (where n is 4 in my case)
Recompile with the connect enabled (and SSID and password entered) - then Scan for SSIDS fails (as expected).
Disable connect - recompile and Scan SSID still fails - and debug output shows connect then crash.
A workaround is to do connect with ssid and password = "" immediately after initialisation (doing disconnect doesn't work) There might be an option in the config (wifi NVS storage to tweak here?)
Martin