Girgitt / Homepoint

Espressif ESP32 Based Smarthome screen for MQTT. This fork attempts to fix M5Core2 support. Take a look at dev_1_0 branch. Some mounting tips for 55mm frame can be found in wiki.
MIT License
2 stars 0 forks source link

wifi disconnected, repetitive alloc failed ? #2

Closed Girgitt closed 9 months ago

Girgitt commented 9 months ago

During plaing with lowering CPU freq to 80MHz with screen saver active suddenly hit a bug in wifi stack?

W (959003) wifi:m f probe req l=0

E (959126) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (959127) wifi:alloc eb len=76 type=2 fail, heap:135912

W (959127) wifi:m f probe req l=0

E (959250) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (959251) wifi:alloc eb len=76 type=2 fail, heap:135912

W (959251) wifi:m f probe req l=0

E (959374) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (959375) wifi:alloc eb len=76 type=2 fail, heap:135912

maybe related to: https://www.esp32.com/viewtopic.php?t=8598&start=10

after touch and resume screen and cpu freq to 240MHz got short log output following reboot:

E (983641) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (983643) wifi:alloc eb len=76 type=2 fail, heap:135856

W (983648) wifi:m f probe req l=0

I (983651) wifi station: retry to connect to the AP
I (983685) SharedGlobalState: registering tap
I (983735) screen saver: switching screen ON, new mCurrentState: 0
I (983772) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1
I (983773) wifi:state: init -> auth (b0)
I (983874) wifi:state: auth -> assoc (0)
CORRUPT HEAP: multi_heap.c:431 detected at 0x3ffbe9a0
abort() was called at PC 0x4008b037 on core 0

ELF file SHA256: 790a0842d9f2fa1d

Backtrace: 0x400877b0:0x3ffc19c0 0x40087b89:0x3ffc19e0 0x4008b037:0x3ffc1a00 0x4008b3a1:0x3ffc1a20 0x400822d6:0x3ffc1a50 0x40082304:0x3ffc1a80 0x4008e57e:0x0

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)

it looks like it is related to ntp sync:


I (513402) SharedGlobalState: sec_since_last_tap  56 sec
I (513452) screen saver: idleSec  56 sec
I (513452) screen saver: timeOutMin  1 min
I (513604) NTP: Waiting for system time to be set... (1/10)
I (515604) NTP: Waiting for system time to be set... (2/10)
I (517525) screen saver: switching screen OFF, new mCurrentState: 1
I (517525) screen saver: setting CPU freq to: 80
I (517604) NTP: Waiting for system time to be set... (3/10)
I (518487) SharedGlobalState: uptime 500 sec
I (518487) SharedGlobalState: sec_since_last_tap  61 sec
I (518537) screen saver: idleSec  61 sec
I (518537) screen saver: timeOutMin  1 min
I (519604) NTP: Waiting for system time to be set... (4/10)
I (521604) NTP: Waiting for system time to be set... (5/10)
I (523335) wifi:bcn_timout,ap_probe_send_start
I (523487) SharedGlobalState: uptime 505 sec
I (523487) SharedGlobalState: sec_since_last_tap  66 sec
I (523537) screen saver: idleSec  66 sec
I (523537) screen saver: timeOutMin  1 min
I (523604) NTP: Waiting for system time to be set... (6/10)
I (525604) NTP: Waiting for system time to be set... (7/10)
I (525838) wifi:ap_probe_send over, resett wifi status to disassoc
I (525838) wifi:state: run -> init (c800)
I (525839) wifi:pm stop, total sleep time: 371351919 us / 523627093 us

I (525843) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1
E (525849) event: system event loop not initialized via esp_event_loop_init
E (525859) TRANS_TCP: tcp_poll_read select error 113, errno = Software caused connection abort, fd = 54
I (525860) wifi station: retry to connect to the AP
E (525867) MQTT_CLIENT: Poll read error: 0, aborting connection
I (525879) MQTT: MQTT_EVENT_DISCONNECTED
I (527604) NTP: Waiting for system time to be set... (8/10)
E (527908) event: system event loop not initialized via esp_event_loop_init
I (527910) wifi station: retry to connect to the AP
I (528487) SharedGlobalState: uptime 510 sec
I (528487) SharedGlobalState: sec_since_last_tap  71 sec
I (528537) screen saver: idleSec  71 sec
I (528537) screen saver: timeOutMin  1 min
I (529604) NTP: Waiting for system time to be set... (9/10)
E (529959) event: system event loop not initialized via esp_event_loop_init
I (529961) wifi station: retry to connect to the AP
E (530685) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (530685) wifi:alloc eb len=76 type=2 fail, heap:135452

W (530685) wifi:m f probe req l=0

E (530809) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=4000
W (530809) wifi:alloc eb len=76 type=2 fail, heap:135452

W (530810) wifi:m f probe req l=0

E (530934) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (530934) wifi:alloc eb len=76 type=2 fail, heap:135452

W (530934) wifi:m f probe req l=0

E (531058) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=4000
W (531058) wifi:alloc eb len=76 type=2 fail, heap:135452

W (531059) wifi:m f probe req l=0

E (531183) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=4000
W (531183) wifi:alloc eb len=76 type=2 fail, heap:135452

W (531183) wifi:m f probe req l=0

E (532028) event: system event loop not initialized via esp_event_loop_init
E (532030) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (532031) wifi:alloc eb len=76 type=2 fail, heap:135392

W (532036) wifi:m f probe req l=0

I (532040) wifi station: retry to connect to the AP
E (532160) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (532161) wifi:alloc eb len=76 type=2 fail, heap:135452

W (532161) wifi:m f probe req l=0

E (532285) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (532285) wifi:alloc eb len=76 type=2 fail, heap:135452

W (532285) wifi:m f probe req l=0

E (532409) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=4000
W (532409) wifi:alloc eb len=76 type=2 fail, heap:135452

W (532410) wifi:m f probe req l=0

E (532533) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (532534) wifi:alloc eb len=76 type=2 fail, heap:135452

W (532534) wifi:m f probe req l=0

E (532658) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=4000
W (532658) wifi:alloc eb len=76 type=2 fail, heap:135452

W (532659) wifi:m f probe req l=0

E (532782) wifi:esf_buf: t=2 l=76 max:32, alloc:32 no eb, TXQ_BLOCK=0
``
Girgitt commented 9 months ago

This issue seems related to switching CPU frequency at runtime - getting back from 80 to 240Mhz to be exact. For the time being power save features activated by screen saver do not change CPU frequency.