Open botts7 opened 3 years ago
Looks like your ESP32 ran out of memory and crashed.
Did you follow the "Preparing" part mentioned in the docs? Take a look and follow it closely: https://github.com/kind3r/esp32-ble-gateway/#preparing-the-esp32
This is because the HTTPS certificate generation takes more stack space.
Had 3 instances of sdkconfig.h updated them all and got a bit further
can log in to config screen but get network error when trying to save credentials
Starting AP for configuration
Loading stored HTTPS certificate
Loaded cert from nvs [esp32gw.local][cert=778][pk=1192]
HTTPS started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 142652 | 38908 ||
HTTP started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 142616 | 38908 ||
Setup complete
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 117292 | 38908 ||
[HTTPS:I] New connection. Socket FID=58
[HTTPS:E] SSL_accept failed. Aborting handshake. FID=58
[HTTPS:I] Connection closed. Socket FID=58
[HTTPS:I] New connection. Socket FID=59
[HTTPS:E] SSL_accept failed. Aborting handshake. FID=59
[HTTPS:I] Connection closed. Socket FID=59
[HTTPS:I] New connection. Socket FID=60
[HTTPS:I] Request: GET / (FID=60)
Auth middleware started
Auth success
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 47092 | 38908 ||
[HTTPS:I] Connection closed. Socket FID=60
[HTTPS:I] New connection. Socket FID=61
[HTTPS:E] SSL_accept failed. Aborting handshake. FID=61
[HTTPS:I] Connection closed. Socket FID=61
[HTTPS:I] New connection. Socket FID=62
[HTTPS:I] Request: GET /config (FID=62)
Auth middleware started
Auth success
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 47092 | 38908 ||
[HTTPS:I] Connection closed. Socket FID=62
[HTTPS:I] New connection. Socket FID=63
[HTTPS:E] SSL_accept failed. Aborting handshake. FID=63
[HTTPS:I] Connection closed. Socket FID=63
[HTTPS:I] New connection. Socket FID=58
[HTTPS:I] Request: POST /config (FID=58)
Auth middleware started
Auth success
Checking for config changes
Setting new admin password [Danistheman]
CORRUPT HEAP: Bad head at 0x3ffba54d. Expected 0xabba1234 got 0x77737361
abort() was called at PC 0x40086261 on core 1
ELF file SHA256: 0000000000000000
Backtrace: 0x4008f55c:0x3ffcd770 0x4008f7d9:0x3ffcd790 0x40086261:0x3ffcd7b0 0x4008638d:0x3ffcd7e0 0x400ff373:0x3ffcd800 0x400f8eb5:0x3ffcdac0 0x400f8e35:0x3ffcdb10 0x400941c1:0x3ffcdb40 0x40083946:0x3ffcdb60 0x400861a5:0x3ffcdb80 0x4000bec7:0x3ffcdba0 0x401876bd:0x3ffcdbc0 0x401873fd:0x3ffcdbe0 0x400d841f:0x3ffcdc00 0x401cb07f:0x3ffcdd50 0x400d76e2:0x3ffcdd70 0x400f28a5:0x3ffcde30 0x400f25fa:0x3ffcde70 0x400f2676:0x3ffcde90 0x400f28a5:0x3ffcdef0 0x400f25fa:0x3ffcdf30 0x400f2efd:0x3ffcdf50 0x400f0922:0x3ffce120 0x400d7ab2:0x3ffce150 0x400d3fc4:0x3ffce170 0x400f7455:0x3ffce190 0x400907da:0x3ffce1b0
#0 0x4008f55c:0x3ffcd770 in invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#1 0x4008f7d9:0x3ffcd790 in abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#2 0x40086261:0x3ffcd7b0 in lock_acquire_generic at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c:143
#3 0x4008638d:0x3ffcd7e0 in _lock_acquire_recursive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c:171
#4 0x400ff373:0x3ffcd800 in _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:860 (discriminator 2)
#5 0x400f8eb5:0x3ffcdac0 in fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fiprintf.c:50
#6 0x400f8e35:0x3ffcdb10 in __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:59 (discriminator 8)
#7 0x400941c1:0x3ffcdb40 in multi_heap_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c:321
#8 0x40083946:0x3ffcdb60 in heap_caps_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:232
#9 0x400861a5:0x3ffcdb80 in _free_r at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/syscalls.c:42
#10 0x4000bec7:0x3ffcdba0 in ?? ??:0
#11 0x401876bd:0x3ffcdbc0 in operator delete(void*) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/del_op.cc:46
#12 0x401873fd:0x3ffcdbe0 in operator delete[](void*) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/del_opv.cc:32
#13 0x400d841f:0x3ffcdc00 in WebManager::handleConfigSet(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:244
#14 0x401cb07f:0x3ffcdd50 in void std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*)>::__call<void, , 0u, 1u>(std::tuple<>&&, std::_Index_tuple<0u, 1u>) at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1074
(inlined by) void std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*)>::operator()<, void>() at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1133
(inlined by) std::_Function_handler<void (), std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*)> >::_M_invoke(std::_Any_data const&) at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1871
#15 0x400d76e2:0x3ffcdd70 in std::function<void ()>::operator()() const at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:244
(inlined by) WebManager::middlewareAuthentication(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>) at src/web.cpp:124
#16 0x400f28a5:0x3ffcde30 in void std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>)>::__call<void, , 0u, 1u, 2u>(std::tuple<>&&, std::_Index_tuple<0u, 1u, 2u>) at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1074
(inlined by) void std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>)>::operator()<, void>() at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1133
(inlined by) std::_Function_handler<void (), std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>)> >::_M_invoke(std::_Any_data const&) at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1871
#17 0x400f25fa:0x3ffcde70 in std::function<void ()>::operator()() const at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:2271
#18 0x400f2676:0x3ffcde90 in httpsserver::validationMiddleware(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>) at .pio/libdeps/esp-wrover/esp32_https_server/src/HTTPConnection.cpp:641
#19 0x400f28a5:0x3ffcdef0 in void std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>)>::__call<void, , 0u, 1u, 2u>(std::tuple<>&&, std::_Index_tuple<0u, 1u, 2u>) at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1074
(inlined by) void std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>)>::operator()<, void>() at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1133
(inlined by) std::_Function_handler<void (), std::_Bind<void (*(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>))(httpsserver::HTTPRequest*, httpsserver::HTTPResponse*, std::function<void ()>)> >::_M_invoke(std::_Any_data const&) at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1871
#20 0x400f25fa:0x3ffcdf30 in std::function<void ()>::operator()() const at c:\users\botts\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:2271
#21 0x400f2efd:0x3ffcdf50 in httpsserver::HTTPConnection::loop() at .pio/libdeps/esp-wrover/esp32_https_server/src/HTTPConnection.cpp:510 (discriminator 4)
#22 0x400f0922:0x3ffce120 in httpsserver::HTTPServer::loop() at .pio/libdeps/esp-wrover/esp32_https_server/src/HTTPServer.cpp:122
#23 0x400d7ab2:0x3ffce150 in WebManager::loop() at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:244
#24 0x400d3fc4:0x3ffce170 in loop() at src/main.cpp:103
#25 0x400f7455:0x3ffce190 in loopTask(void*) at C:/Users/botts/.platformio/packages/framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6/cores/esp32/main.cpp:23
#26 0x400907da:0x3ffce1b0 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
Rebooting...
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Starting AP for configuration
Loading stored HTTPS certificate
Loaded cert from nvs [esp32gw.local][cert=778][pk=1192]
HTTPS started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 142652 | 38908 ||
HTTP started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 142616 | 38908 ||
Setup complete
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 117292 | 38908 ||
Seems to now have connected to my network now ?
Another memory corruption, although this time I don't know what could've caused that. Maybe @kind3r knows?
Considering that it connected to your network now, does it work?
Seems something does not really work during the password change when cleaning up the allocated variable. I have removed it and replaced with a reboot required. Can you test the new code ?
Have reflashed successfully and enter credentials. They save but still get a network error message.
After that setting the noble gateway up in the add-on does not discover any locks.
I am stuck at the same spot as @botts7. I have set up the gateway but it doesn't seem to be able to discover the lock (which I can at least do directly from my RPi). I also ran into most of the issues re getting the code to compile and having to comment out the platform_packages and digging through every instance of CONFIG_ARDUINO_LOOP_STACK_SIZE to update (of which I had many).
Is they a way to confirm if the bluetooth on the board is turned on?
On the board that I got https://www.amazon.com.au/gp/product/B07Q576VWZ/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1 there is a cryptic comment about
"If it cann't get bluetooth working? Using Node32s as the Board selection. To reference GPIO pins in code use just the number, for example "digitalWrite(13, HIGH)" sets GPIO13 high."
I am getting this error on the serial monitor of the VS Code:
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Starting AP for configuration
Loading stored HTTPS certificate
Loaded cert from nvs [esp32gw.local][cert=781][pk=1192]
HTTPS started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 141188 | 15560 ||
HTTP started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 141188 | 15560 ||
Setup complete
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 112672 | 15560 ||
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Starting AP for configuration
Loading stored HTTPS certificate
Loaded cert from nvs [esp32gw.local][cert=781][pk=1192]
HTTPS started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 141188 | 15560 ||
HTTP started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 141188 | 15560 ||
Setup complete
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 113780 | 15560 ||
[HTTPS:I] New connection. Socket FID=52
[HTTPS:I] Request: GET / (FID=52)
Auth middleware started
Auth success
E (12493) SPIFFS: mount failed, -10025
[ 12500][E][SPIFFS.cpp:89] begin(): Mounting SPIFFS failed! Error: -1
[ 12501][E][vfs_api.cpp:24] open(): File system is not mounted
Sorry, I should have RTFM. I was able to compile with this fix: https://github.com/kind3r/esp32-ble-gateway/issues/3
Upload to ESP32:
Connect your ESP32 to the PC, go to PlatformIO menu (the alien head on the VSCode's left toolbar, where you have files, search, plugins etc.) then in Project Tasks choose env:esp-wrover -> Platform -> Upload Filesystem Imager. This will 'format' the storage and upload the web UI.
Next, you need to build and upload the main code. In Project Tasks choose env:esp-wrover -> General -> Upload and Monitor. This should start the build process and once it is finished the compiled result will be uploaded to the ESP32.
Compiled and running on esp32 wrover
SSID available and can connect with phone or PC
wont load https://esp32gw.local or 192.168.4.1 or 192.168.4.2
Any ideas?