satrik / esp32_ble_inkbird

Inkbird BLE BBQ Thermometer Webserver with some nice features
6 stars 3 forks source link

abort() was called at PC 0x401cce53 on core 1 (periodic reboots during execution) #2

Closed crstrand closed 2 years ago

crstrand commented 3 years ago

I tried both min SPIFFS and no OTA. They both do the same thing. I'm using an inkBird IBT-4XC. The only mod I did to your code was comment out two of the wifiMulti.addAP entries and put my SSID and password in the first one. I also tried a version adding all four channels. It works, but also reboots periodically. It does this on my Lolin32 and Lolin32Lite. Yesterday, I went down the rabbit hole of ESP-IDF, platformIO, and multiple versions of the ESP32 BLE library. All to no avail. Any help you can provide would be much appreciated.

esp32_ble_inkbird_compile_log.txt esp32_ble_inkbird_compile_log_no_OTA.txt esp32_ble_inkbird_serial_log.txt esp32_ble_inkbird_serial_log_no_OTA.txt

satrik commented 3 years ago

I will check the logs tomorrow as I'm only on my iPhone currently^^ But you can already check the Stack Trace with this tool, this should help to narrow down the issue a little bit.

greetings satrik

crstrand commented 3 years ago

Using that tool, it would seem that is unhappy with something that is happening on the WiFi side...


ELF file SHA256: 0000000000000000

Backtrace: 0x4008f3bc:0x3ffde1a0 0x4008f639:0x3ffde1c0 0x401cce53:0x3ffde1e0 0x401cce9a:0x3ffde200 0x401cc7c1:0x3ffde220 0x401cc89c:0x3ffde240 0x400d3f31:0x3ffde260 0x400d5761:0x3ffde390 0x400d57e1:0x3ffde3d0 0x400d5a35:0x3ffde420 0x400d7ef1:0x3ffde440 0x400d7f71:0x3ffde480 0x400d85ae:0x3ffde4a0 0x400906ae:0x3ffde4d0

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

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:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5856
entry 0x400806a8

==========================================================================================================================================
Decoding stack results
0x4008f3bc: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 156
0x4008f639: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 171
0x401cce53: __cxxabiv1::__terminate(void (*)()) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_terminate.cc line 47
0x401cce9a: std::terminate() at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_terminate.cc line 57
0x401cc7c1: __cxxabiv1::__cxa_allocate_exception(std::size_t) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_alloc.cc line 268
0x401cc89c: operator new(unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_op.cc line 54
0x400d3f31: AsyncWebServerRequest::_parseReqHeader() at C:\Users\crstr\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebRequest.cpp line 348
0x400d5761: AsyncWebServerRequest::_parseLine() at C:\Users\crstr\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebRequest.cpp line 584
0x400d57e1: AsyncWebServerRequest::_onData(void*, unsigned int) at C:\Users\crstr\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebRequest.cpp line 123
0x400d5a35: std::_Function_handler   >::_M_invoke(const std::_Any_data &,  ,  ,  ,  ) at C:\Users\crstr\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebRequest.cpp line 76
0x400d7ef1: AsyncClient::_recv(tcp_pcb*, pbuf*, signed char) at c:\users\crstr\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
0x400d7f71: AsyncClient::_s_recv(void*, tcp_pcb*, pbuf*, signed char) at C:\Users\crstr\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp line 1210
0x400d85ae: _async_service_task(void*) at C:\Users\crstr\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp line 162
0x400906ae: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
crstrand commented 3 years ago

Not sure what it means, but when I enable esp logging esp_log_level_set("*", ESP_LOG_INFO); I get this sometimes... W (50598) wifi:Error! Should use default active scan time parameter for WiFi scan when Bluetooth is enabled!!!!!!

satrik commented 3 years ago

The W (50598) wifi:Error! ..... can be ignored. If I'm not wrong, this error "always" occurs when wlan and ble are used at the same time, but it should not harm anything.

ESPAsyncWebServer needs AsyncTCP to work on ESP32 boards... and I've checked my local copy of the code, and it seems I've forgotten to add the AsyncTCP.h to the code I've pushed -.-

Please try if it works if you add AsyncTCP.

crstrand commented 3 years ago
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>

Still get a periodic reboot. I'm using ESP32 arduino core 1.0.6

abort() was called at PC 0x401cce53 on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x4008f3bc:0x3ffe61a0 0x4008f639:0x3ffe61c0 0x401cce53:0x3ffe61e0 0x401cce9a:0x3ffe6200 0x401cc56f:0x3ffe6220 0x401cc8aa:0x3ffe6240 0x400d855d:0x3ffe6260 0x400d1031:0x3ffe62a0 0x401d3b5e:0x3ffe62e0 0x400dad7d:0x3ffe6300 0x400dba69:0x3ffe6350 0x400da2d1:0x3ffe6370 0x400dac49:0x3ffe6420 0x40129bb9:0x3ffe6470 0x4012261a:0x3ffe64c0 0x400906ae:0x3ffe64f0

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

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:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5856
entry 0x400806a8

Decoding stack results
0x4008f3bc: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 156
0x4008f639: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 171
0x401cce53: __cxxabiv1::__terminate(void (*)()) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_terminate.cc line 47
0x401cce9a: std::terminate() at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_terminate.cc line 57
0x401cc56f: __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*)) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_throw.cc line 87
0x401cc8aa: operator new(unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_op.cc line 54
0x400d855d: AsyncWebServer::on(char const*, unsigned char, std::function ) at C:\Users\crstr\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebServer.cpp line 149
0x400d1031: notifyCallback(BLERemoteCharacteristic*, uint8_t*, size_t, bool) at C:\Users\crstr\Documents\Arduino\esp32_ble_inkbird/esp32_ble_inkbird.ino line 45
0x401d3b5e: std::_Function_handler ::_M_invoke(std::_Any_data const&, BLERemoteCharacteristic*&&, unsigned char*&&, unsigned int&&, bool&&) at c:\users\crstr\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 1871
0x400dad7d: BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t, unsigned char, esp_ble_gattc_cb_param_t*) at c:\users\crstr\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
0x400dba69: BLERemoteService::gattClientEventHandler(esp_gattc_cb_event_t, unsigned char, esp_ble_gattc_cb_param_t*) at C:\Users\crstr\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\BLE\src\BLERemoteService.cpp line 114
0x400da2d1: BLEClient::gattClientEventHandler(esp_gattc_cb_event_t, unsigned char, esp_ble_gattc_cb_param_t*) at C:\Users\crstr\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\BLE\src\BLEClient.cpp line 342
0x400dac49: BLEDevice::gattClientEventHandler(esp_gattc_cb_event_t, unsigned char, esp_ble_gattc_cb_param_t*) at C:\Users\crstr\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\BLE\src\BLEDevice.cpp line 167
0x40129bb9: btc_gattc_cb_handler at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c line 31
0x4012261a: btc_task at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/bt/common/btc/core/btc_task.c line 163
0x400906ae: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
crstrand commented 3 years ago

Even without #include <AsyncTCP.h> it gets called. Probably by ESPAsyncWebServer?

Alternatives for AsyncTCP.h: [AsyncTCP@1.1.1]
ResolveLibrary(AsyncTCP.h)
  -> candidates: [AsyncTCP@1.1.1]
satrik commented 3 years ago

@crstrand after updating all lib's, I can reproduce it now 😐

I have already changed my local code to use the normal webserver instead of the async and it seems to work. I will do some tests and I'll try to push a working version tomorrow.

crstrand commented 3 years ago

I am also using PlatformIO to compile your code. That makes it easy to force use of older libraries. Which versions of BLE and ASYNCWebServer worked without error?

satrik commented 3 years ago

I don't know which versions I've used before. But I'm almost done with the "new" version of the code without the async server. This time i will also include support for an unlimited number of probes and a settings page for the thresholds and colors. While programming, one new idea after another came up, that's why I'm not ready yet^^

I will push tomorrow my current code base, either as ready master or as a dev branch

crstrand commented 3 years ago

I like it. You seem to program like I do. Feature-creep-o-rama ;)

satrik commented 3 years ago

After 4 hours of JS, I'm done for today 😂 I'v created a dev-branch as there are still some smaller things (only visual stuff on the settings page) I need to fix. But the basic features should work now. Would be nice if you @crstrand can test if it works also with your IBT-4XC and all 4 probes 🙃

crstrand commented 3 years ago

@satrik You are the MAN! dev branch works GREAT! Confirmed working on an IBT-4XC. Tested all four channels and all four high and low levels. Seems solid also. Running for 30min already with nary a hiccup.

One "feature" is that on first load of the page, all of the temps are the lower color instead of the default color as tempLower is hardcoded to 100 and tempUpper to 120. If I click the settings icon and save the "default" settings, everything displays the expected colors. VERY small issue. The app is amazing.

satrik commented 3 years ago

Yes, this issue is one of the "smaller things" I said. The settings page still needs some fixes, but nice to hear that it works also with 4 probes 😁

I hope I can fix the last issues on the weekend.

satrik commented 3 years ago

@crstrand sorry for the huge delay... I will smoke today and test what still needs to be fixed on the code 🙂

satrik commented 2 years ago

soooo, I've worked a lot on the project and I've pushed a more or less completely new version now. a lot of new features are available now, just check the new README in the master branch. I will close this issue now.