Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 reboot after some 100-300-times web page loading (using ESPAsyncWebServer & AsyncTCP) #1037

Closed
Skrivo opened this issue Aug 15, 2021 · 4 comments
Labels

Comments

@Skrivo
Copy link

Skrivo commented Aug 15, 2021

Hello experienced people!
I am not very experienced and I have an issue not able to solve by myself.
My setup:

  • Arduino 1.8.15
  • Arduino core for the ESP32 (version 1.0.6)
  • latest library ESPAsyncWebServer (me-no-dev)
  • latest library AsyncTCP (me-no-dev)
  • ESP32 Dev Module

Micro_EVSE_3_WiFi_Charge_Control_v1.0k.zip

The attached Arduino ESP32 code for web server using web sockets works well on ESP32 but after entering (loading or even just reloading) the main web page some 100 to 300 times (random) the ESP32 restarts itself. It doesn't matter if I am connected using Soft AP or the ESP32 is connected to local WiFi network. If I am not reloading the page then it never reboots, it works without a single issue for days.
I get the following error information on the serial monitor:


First time:

CORRUPT HEAP: Bad head at 0x3ffd1e28. Expected 0xabba1234 got 0x3ffd2084
abort() was called at PC 0x40086a19 on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x400887b8:0x3ffb40c0 0x40088a35:0x3ffb40e0 0x40086a19:0x3ffb4100 0x40086b45:0x3ffb4130 0x40100987:0x3ffb4150 0x400fc83d:0x3ffb4410 0x400fc7ad:0x3ffb4460 0x4008d111:0x3ffb4490 0x40081c66:0x3ffb44b0 0x40086911:0x3ffb44d0 0x4000bec7:0x3ffb44f0 0x40122f7b:0x3ffb4510 0x40122fff:0x3ffb4530 0x4012303b:0x3ffb4550 0x40123fc5:0x3ffb4570 0x4012402e:0x3ffb4590 0x400d6e87:0x3ffb45b0 0x401202bc:0x3ffb45d0 0x40089a46:0x3ffb4600

Rebooting...
ets Jun 8 2016 00:22:57


Second time:

CORRUPT HEAP: Bad head at 0x3ffd29fc. Expected 0xabba1234 got 0x3ffd2ae4
abort() was called at PC 0x40086a19 on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x400887b8:0x3ffb40c0 0x40088a35:0x3ffb40e0 0x40086a19:0x3ffb4100 0x40086b45:0x3ffb4130 0x40100987:0x3ffb4150 0x400fc83d:0x3ffb4410 0x400fc7ad:0x3ffb4460 0x4008d111:0x3ffb4490 0x40081c66:0x3ffb44b0 0x40086911:0x3ffb44d0 0x4000bec7:0x3ffb44f0 0x40122f7b:0x3ffb4510 0x40122fff:0x3ffb4530 0x4012303b:0x3ffb4550 0x40123fc5:0x3ffb4570 0x4012402e:0x3ffb4590 0x400d6e87:0x3ffb45b0 0x401202bc:0x3ffb45d0 0x40089a46:0x3ffb4600

Rebooting...
ets Jun 8 2016 00:22:57


Third time:

CORRUPT HEAP: Bad head at 0x3ffd371c. Expected 0xabba1234 got 0x3ffd38c0
abort() was called at PC 0x40086a19 on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x400887b8:0x3ffb40c0 0x40088a35:0x3ffb40e0 0x40086a19:0x3ffb4100 0x40086b45:0x3ffb4130 0x40100987:0x3ffb4150 0x400fc83d:0x3ffb4410 0x400fc7ad:0x3ffb4460 0x4008d111:0x3ffb4490 0x40081c66:0x3ffb44b0 0x40086911:0x3ffb44d0 0x4000bec7:0x3ffb44f0 0x40122f7b:0x3ffb4510 0x40122fff:0x3ffb4530 0x4012303b:0x3ffb4550 0x40123fc5:0x3ffb4570 0x4012402e:0x3ffb4590 0x400d6e87:0x3ffb45b0 0x401202bc:0x3ffb45d0 0x40089a46:0x3ffb4600

Rebooting...
ets Jun 8 2016 00:22:57

So, the error is repeatable. ESP32 Exception Decoder lists the following:

Decoding stack results
0x400887b8: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 156
0x40088a35: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 171
0x40086a19: lock_acquire_generic at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 143
0x40086b45: _lock_acquire_recursive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 171
0x40100987: _vfiprintf_r at ../../../.././newlib/libc/stdio/vfprintf.c line 860
0x400fc83d: fiprintf at ../../../.././newlib/libc/stdio/fiprintf.c line 50
0x400fc7ad: __assert_func at ../../../.././newlib/libc/stdlib/assert.c line 59
0x4008d111: multi_heap_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c line 218
0x40081c66: heap_caps_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c line 268
0x40086911: _free_r at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/syscalls.c line 42
0x40122f7b: mem_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/mem.c line 176
0x40122fff: do_memp_free_pool at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/memp.c line 432
0x4012303b: memp_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/memp.c line 489
0x40123fc5: tcp_close_shutdown at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/tcp.c line 311
0x4012402e: tcp_close at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/tcp.c line 409
0x400d6e87: _tcp_close_api(tcpip_api_call_data*) at C:\Users\DejanS\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp line 443
0x401202bc: tcpip_thread at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c line 124
0x40089a46: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

As I am not super specialist this Exception Decoder results don't tell me much.

I don't know where is the issue but I suspect those two otherwise superb libraries: ESPAsyncWebServer & AsyncTCP
Maybe it is also something wrong in my code.

Please help me!

To: me-no-dev or anybody else: you can contact me directly to my e-mail fusionseeker@gmail.com if you have a reliable solution - I also have available some funds for a reward :)

Thanks,

Dejan

@stale
Copy link

stale bot commented Mar 30, 2022

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 30, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Apr 16, 2022
@sunberrysolar
Copy link

I have a similar issue, but it crash and reboot more frequently, randomly.
It always happen for the same page, not the other ones that always load perfectly.

That page probably needs more ressources but is only 560kb, like the other ones that never cause crash. But loading this page is more ressource intensive : reading data points from a csv file to display in chart.js

Here is the log:

ELF file SHA256: 0000000000000000

Backtrace: 0x4008ecec:0x3ffbfab0 0x4008ef65:0x3ffbfad0 0x40156be4:0x3ffbfaf0 0x40089875:0x3ffbfb10 0x4019016f:0x3ffbc280 0x401584df:0x3ffbc2a0 0x40091725:0x3ffbc2c0 0x4008ff6a:0x3ffbc2e0
#0 0x4008ecec:0x3ffbfab0 in invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#1 0x4008ef65:0x3ffbfad0 in abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#2 0x40156be4:0x3ffbfaf0 in task_wdt_isr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/task_wdt.c:252
#3 0x40089875:0x3ffbfb10 in _xt_lowint1 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S:1154
#4 0x4019016f:0x3ffbc280 in esp_pm_impl_waiti at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/pm_esp32.c:492
#5 0x401584df:0x3ffbc2a0 in esp_vApplicationIdleHook at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/freertos_hooks.c:108
#6 0x40091725:0x3ffbc2c0 in prvIdleTask at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3507
#7 0x4008ff6a:0x3ffbc2e0 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

Rebooting...

1 similar comment
@sunberrysolar
Copy link

I have a similar issue, but it crash and reboot more frequently, randomly.
It always happen for the same page, not the other ones that always load perfectly.

That page probably needs more ressources but is only 560kb, like the other ones that never cause crash. But loading this page is more ressource intensive : reading data points from a csv file to display in chart.js

Here is the log:

ELF file SHA256: 0000000000000000

Backtrace: 0x4008ecec:0x3ffbfab0 0x4008ef65:0x3ffbfad0 0x40156be4:0x3ffbfaf0 0x40089875:0x3ffbfb10 0x4019016f:0x3ffbc280 0x401584df:0x3ffbc2a0 0x40091725:0x3ffbc2c0 0x4008ff6a:0x3ffbc2e0
#0 0x4008ecec:0x3ffbfab0 in invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#1 0x4008ef65:0x3ffbfad0 in abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#2 0x40156be4:0x3ffbfaf0 in task_wdt_isr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/task_wdt.c:252
#3 0x40089875:0x3ffbfb10 in _xt_lowint1 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S:1154
#4 0x4019016f:0x3ffbc280 in esp_pm_impl_waiti at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/pm_esp32.c:492
#5 0x401584df:0x3ffbc2a0 in esp_vApplicationIdleHook at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/freertos_hooks.c:108
#6 0x40091725:0x3ffbc2c0 in prvIdleTask at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3507
#7 0x4008ff6a:0x3ffbc2e0 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

Rebooting...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants