pbolduc / AsyncTCP

Async TCP Library for ESP32
GNU Lesser General Public License v3.0
4 stars 6 forks source link

Unhandled exception communicating with MQTT Broker #4

Open hajeth opened 8 months ago

hajeth commented 8 months ago

I built a WLED project with an ESP32 Wroom 32 Device and Wled is using this TCPAsync Library. After some time (Seconds to Minutes) the ESP32 reboots. Debug log shows many events with no Argument handled by AsyncTCP library then it crashes. When this happens, packet traces do not show any network traffic to the ESP32.

Log:

event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 event arg == NULL: 0x3ffdd384 C: 0x3ffdcda0 0x3ffdd084 0 +F: 0x3ffdd384 Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled. Core 0 register dump: PC : 0x40120617 PS : 0x00060a30 A0 : 0x801207cf A1 : 0x3ffb5ce0
A2 : 0x00000000 A3 : 0x3ffdd384 A4 : 0x00000000 A5 : 0x00000034 A6 : 0x00000000 A7 : 0x3ffb5c49 A8 : 0x00000000 A9 : 0x3ffb5c50
A10 : 0x0000000a A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00001800 A14 : 0x3ffb5c47 A15 : 0x00000000 SAR : 0x00000005 EXCCAUSE: 0x0000001c EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff
ELF file SHA256: 0000000000000000 Backtrace: 0x40120614:0x3ffb5ce0 0x401207cc:0x3ffb5d00 0x4012082a:0x3ffb5d20 0x40156d61:0x3ffb5d50 0x4015cfe7:0x3ffb5d70 0x40161992:0x3ffb5da0 0x4014bb9f:0x3ffb5dc0 0x4008b936:0x3ffb5df0

0 0x40120614:0x3ffb5ce0 in AsyncClient::_recv(tcp_pcb, pbuf, signed char) at .pio\libdeps\esp32dev\AsyncTCP\src/AsyncTCP.cpp:1153

1 0x401207cc:0x3ffb5d00 in AsyncServer::begin() at .pio\libdeps\esp32dev\AsyncTCP\src/AsyncTCP.cpp:1153

2 0x4012082a:0x3ffb5d20 in AsyncServer::begin() at .pio\libdeps\esp32dev\AsyncTCP\src/AsyncTCP.cpp:1153

3 0x40156d61:0x3ffb5d50 in pbuf_header_impl at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/pbuf.c:1332

4 0x4015cfe7:0x3ffb5d70 in ip4_output_if_opt_src at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/ipv4/ip4.c:971

5 0x40161992:0x3ffb5da0 in sys_thread_sem_init at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32/freertos/sys_arch.c:529

6 0x4014bb9f:0x3ffb5dc0 in tcpip_send_msg_wait_sem at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c:483

7 0x4008b936:0x3ffb5df0 in vPortTaskWrapper at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

Rebooting... ets Jul 29 2019 12:21:46 rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DOUT, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1084 load:0x40078000,len:11220 load:0x40080400,len:5360 entry 0x4008067c

The mentioned code part seems to be:

ExceptionLocation

I tried different ESP32 devices, different WLAN APs and different MQTT Brokers - all with the same error.

Logfiles attached Attachments.zip

Many thanks in advance for any help on this tricky issue.