Wifi randomly not connecting, but no disconnect event fired

ntldr2018
Posts: 3
Joined: Mon Dec 24, 2018 4:28 am

Wifi randomly not connecting, but no disconnect event fired

Postby ntldr2018 » Wed Mar 06, 2019 12:22 am

Hi,

I'm currently running into some weird issues with Wifi sometimes not connecting properly. I've cut down the issue to essentially the scan example from the IDF repository (Code Attached). The issue occurs on both Devkits I have here, as well as a bare WROOM32 module.

On a good boot I'll get:

Code: Select all

I (206) scan: SYSTEM_EVENT_STA_START
I (2626) wifi: n:6 0, o:1 0, ap:255 255, sta:6 0, prof:1
I (3466) wifi: state: init -> auth (b0)
I (3466) wifi: state: auth -> assoc (0)
I (3476) wifi: state: assoc -> run (10)
I (3506) wifi: connected with SSID, channel 6
I (3516) wifi: pm start, type: 1
I (4086) event: sta ip: 192.168.178.53, mask: 255.255.255.0, gw: 192.168.178.1
I (4086) scan: SYSTEM_EVENT_STA_GOT_IP
I (4086) scan: Got IP: 192.168.178.53
On a bad boot I'll get:

Code: Select all

I (205) scan: SYSTEM_EVENT_STA_START
I (2625) wifi: n:6 0, o:1 0, ap:255 255, sta:6 0, prof:1
I (3455) wifi: state: init -> auth (b0)
I (3465) wifi: state: auth -> init (8a0)
I (3465) wifi: n:6 0, o:6 0, ap:255 255, sta:6 0, prof:1
After those messages nothing else happens. SYSTEM_EVENT_STA_DISCONNECTED is not being fired either, which makes handling this case a pain. Right now I'm just rebooting the ESP32 in case Wifi is not reacting within 30s, but that's not really a nice solution.

What exactly does the 8a0 code in the auth -> init message mean?

Thanks
Attachments
main.cpp
(2.18 KiB) Downloaded 676 times

Who is online

Users browsing this forum: Google [Bot] and 76 guests