WiFi freezed and disconnecting without event

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

WiFi freezed and disconnecting without event

Postby davdav » Fri Sep 07, 2018 10:38 am

Hi all,
I'm struggling to understand why at some point the esp32 stop working WiFi.
I have several task and one of them manages the WiFi connection. Please note that I start WiFi in APSTA mode.

Device connects to router and everything is OK. router has a lease time of 15 minutes so every a quarter hour ESP32 receive a disconnect event and then connect again. At some point the task which manage the WiFi got stuck while the others are still working (for example task which manages UART, I2C).

I have enabled "event", "tcpip_adapter" and "wifi" debug if it could help. There is also a custom debug tag "WiFi" which I use to print rssi of the router every minute.

Code: Select all

D (27893) event: SYSTEM_EVENT_STA_START
I (29223) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (29883) wifi: state: init -> auth (b0)
I (29886) wifi: state: auth -> assoc (0)
I (29891) wifi: state: assoc -> run (10)
I (29914) wifi: connected with Vodafone-34532257, channel 11
I (29915) wifi: pm start, type: 1

D (29915) event: SYSTEM_EVENT_STA_CONNECTED, ssid:Vodafone-34532257, ssid_len:17, bssid:bc:15:ac:0e:1b:b8, channel:11, authmode:3
D (29924) tcpip_adapter: dhcp client init ip/mask/gw to all-0
D (29929) tcpip_adapter: if0 start ip lost tmr: enter
D (29934) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3fff3ee0 interval=120 ip=0
D (29944) tcpip_adapter: dhcp client start successfully
D (35351) tcpip_adapter: if0 dhcpc cb
D (35352) tcpip_adapter: if0 ip changed=1
D (35352) event: SYSTEM_EVENT_STA_GOT_IP, ip:10.0.0.11, mask:255.255.255.0, gw:10.0.0.1

I (35355) event: sta ip: 10.0.0.11, mask: 255.255.255.0, gw: 10.0.0.1
D (61396) WiFi: rssi:57
D (181596) WiFi: rssi:59
D (421996) WiFi: rssi:58
D (542196) WiFi: rssi:59
D (602296) WiFi: rssi:58
D (662396) WiFi: rssi:60
D (722496) WiFi: rssi:58
D (842696) WiFi: rssi:56
I (857915) wifi: state: run -> init (7c0)
I (857916) wifi: pm stop, total sleep time: 731711764 us / 828346604 us

I (857916) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
D (857920) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Vodafone-34532257, ssid_len:17, bssid:bc:15:ac:0e:1b:b8, reason:7
D (857932) tcpip_adapter: if0 start ip lost tmr: enter
D (857935) tcpip_adapter: if0 start ip lost tmr: interval=120

D (857949) WiFi: TRY to RICONNECT
I (858067) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (858067) wifi: state: init -> auth (b0)
I (858070) wifi: state: auth -> assoc (0)
I (858075) wifi: state: assoc -> run (10)
I (868059) wifi: state: run -> init (200)
I (868060) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
D (868061) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Vodafone-34532257, ssid_len:17, bssid:bc:15:ac:0e:1b:b8, reason:204
D (868069) tcpip_adapter: if0 start ip lost tmr: enter
D (868073) tcpip_adapter: if0 start ip lost tmr: already started

D (868087) WiFi: TRY to RICONNECT
D (870496) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Vodafone-34532257, ssid_len:17, bssid:00:00:00:00:00:00, reason:201
D (870496) tcpip_adapter: if0 start ip lost tmr: enter
D (870501) tcpip_adapter: if0 start ip lost tmr: already started

D (870515) WiFi: TRY to RICONNECT
I (870634) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (870635) wifi: state: init -> auth (b0)
I (870638) wifi: state: auth -> assoc (0)
I (870643) wifi: state: assoc -> run (10)
I (870657) wifi: connected with Vodafone-34532257, channel 11
I (870658) wifi: pm start, type: 1

D (870658) event: SYSTEM_EVENT_STA_CONNECTED, ssid:Vodafone-34532257, ssid_len:17, bssid:bc:15:ac:0e:1b:b8, channel:11, authmode:3
D (870667) tcpip_adapter: dhcp client init ip/mask/gw to all-0
D (870672) tcpip_adapter: if0 start ip lost tmr: enter
D (870677) tcpip_adapter: if0 start ip lost tmr: already started
D (870683) tcpip_adapter: dhcp client start successfully

D (874355) tcpip_adapter: if0 dhcpc cb
D (874356) tcpip_adapter: if0 ip changed=0
D (874356) event: SYSTEM_EVENT_STA_GOT_IP, ip:10.0.0.11, mask:255.255.255.0, gw:10.0.0.1
I (874360) event: sta ip: 10.0.0.11, mask: 255.255.255.0, gw: 10.0.0.1

D (902796) WiFi: rssi:55
D (977935) tcpip_adapter: if0 ip lost tmr: enter
D (977935) tcpip_adapter: if0 ip lost tmr: no need raise ip lost event
After last message the task is not more working and not event is recevied. The other tasks work again. If I try to reboot using "esp_restart" the other tasks no more work but the device doesn't reboot.

What could be the reason of

Code: Select all

tcpip_adapter: if0 ip lost tmr: no need raise ip lost event
without having SYSTEM_EVENT_STA_LOST_IP event?

Thanks

Who is online

Users browsing this forum: dalmat and 125 guests