I have ventured beyond my ability in this one.
This project is for an IoT demo to some students. Using Telegram they can control some lighting as well as receive some notifications to events.
The following are confirmed to be working:
-
All lighting and lighting telegram messages
-
Temperature sensor and telegram messages
-
Door bell but NOT the telegram message
If bot.sendMessage(chat_id, "Someone is at the door.", ""); is added to the soundDoorbell() function then the following crash occurs
CORRUPT HEAP: Bad head at 0x3fff479c. Expected 0xabba1234 got 0x3ffffff8
abort() was called at PC 0x40086cd1 on core 0
ELF file SHA256: 0000000000000000
Backtrace: 0x40088904:0x3ffdc5d0 0x40088b81:0x3ffdc5f0 0x40086cd1:0x3ffdc610 0x40086dfd:0x3ffdc640 0x400f6bcf:0x3ffdc660 0x400f2ebd:0x3ffdc920 0x400f2e4c:0x3ffdc970 0x4008d25d:0x3ffdc9a0 0x40081f1e:0x3ffdc9c0 0x4008208d:0x3ffdc9e0 0x40123ca6:0x3ffdca00 0x4011706a:0x3ffdca20 0x400d3a28:0x3ffdca40 0x400d3629:0x3ffdca60 0x400d37fb:0x3ffdca80 0x400d38f1:0x3ffdcab0 0x400d464d:0x3ffdcad0 0x400d707d:0x3ffdcb00 0x400d15cd:0x3ffdcba0 0x400d16a3:0x3ffdcbc0 0x40089b92:0x3ffdcc00
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x17 (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
The decode stack shows:
0x40088904: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 156
0x40088b81: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 171
0x40086cd1: lock_acquire_generic at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 143
0x40086dfd: _lock_acquire_recursive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 171
0x400f6bcf: _vfiprintf_r at ../../../.././newlib/libc/stdio/vfprintf.c line 860
0x400f2ebd: fiprintf at ../../../.././newlib/libc/stdio/fiprintf.c line 50
0x400f2e4c: __assert_func at ../../../.././newlib/libc/stdlib/assert.c line 59
0x4008d25d: 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
0x40081f1e: heap_caps_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c line 268
0x4008208d: esp_mbedtls_mem_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/port/esp_mem.c line 35
0x40123ca6: mbedtls_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/platform.c line 98
0x4011706a: mbedtls_ssl_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/ssl_tls.c line 8992
0x400d3a28: stop_ssl_socket(sslclient_context*, char const*, char const*, char const*) at C:\Users\abas034\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src\ssl_client.cpp line 272
0x400d3629: WiFiClientSecure::stop() at C:\Users\abas034\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src\WiFiClientSecure.cpp line 93
0x400d37fb: WiFiClientSecure::connect(char const*, unsigned short, char const*, char const*, char const*) at C:\Users\abas034\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src\WiFiClientSecure.cpp line 154
0x400d38f1: WiFiClientSecure::connect(char const*, unsigned short) at C:\Users\abas034\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src\WiFiClientSecure.cpp line 112
0x400d464d: UniversalTelegramBot::sendGetToTelegram(String const&) at C:\Users\abas034\UOA\OneDrive - The University of Auckland\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp line 73
0x400d707d: UniversalTelegramBot::getUpdates(long) at C:\Users\ab\UOA\OneDrive - The University of Auckland\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp line 369
0x400d15cd: checkTelegramBot() at C:\Users\ab\OneDrive\Documents\Projects\WorkingOn\IoT-Demo\HomeAutomationV3/HomeAutomationV3.ino line 315
0x400d16a3: nonloopingCode(void*) at C:\Users\ab\OneDrive\Documents\Projects\WorkingOn\IoT-Demo\HomeAutomationV3/HomeAutomationV3.ino line 343
0x40089b92: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
Given that the "bot.sendMessage" function works everywhere else, I can't work out why it would fail in this instance.
HomeAutomationV3.ino (9.9 KB)