Code Monkey home page Code Monkey logo

esp32-ble-gateway's Introduction

esp32-ble-gateway

WiFi to BLE (Bluetooth Low Energy) gateway on ESP32 using a modified version of Noble's WebSocket protocol. The modifications consist in an added authentication layer upon connection and some extra payloads here and there. It's designed to be used with ttlock-sdk-js at least until I will find the time to document the API and implement a separate Noble binding. Note that data flows is via standard unencrypted websocket as the ESP can barely handle the memory requirements for BLE, WiFi and WebSocket at the same time and besides gateway is supposed to be in your LAN and the BLE traffic can be easilly sniffed over the air so there isn't really a point in encrypting all communication at this time.

Note: this has nothing to do with the TTLock G2 official gateway, it is basically just a GATT proxy over WiFi.

Feeling generous and want to support my work, here is my PayPal link.

What works for now

  • WiFi init with AP style configuration via HTTPS web page
  • Websocket communication and AES 128 CBC auth
  • Start/stop BLE scan
  • Discover devices
  • Read characteristics
  • Write characteristics
  • Subscribe to characteristic

How to install

This short guide explains how to install the gateway and configure the TTLock Home Assistant addon so that you can interface it with a TTLock lock. You need to compile and upload the binary yourself, there is no pre-compiled version but the process should be fairly easy even for beginers.

Requirements

  1. Visual Studio Code (VSCode) and PlatformIO extension.
  2. A clone of this repository
  3. A working ESP32-WROVER board
  4. Some type of TTLock lock paired to a working Home Assistant installation with TTLock Home Assistant addon

Preparing the ESP32

Open the cloned repo in VSCode and PlatformIO should automatically install all the required dependencies (it will take a couple of minutes, depending on your computer and internet speed, be patient and let it settle). You need to modify sdkconfig.h located in .platformio/packages/framework-arduinoespressif32/tools/sdk/include/config and change CONFIG_ARDUINO_LOOP_STACK_SIZE to 10240. This is because the HTTPS certificate generation takes more stack space.

At the moment, the project is only configured to work on ESP32-WROVER boards. If you have a different board, you need to edit the platformio.ini file and create your own env configuration. As of this writing the code takes about 1.5Mb so I'm using the min_spiffs.csv partition scheme in order to be able to hopefully do OTA in the future.

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.

Once the upload finishes you should start seeing some debug output, including the status of the WiFi AP and HTTPS certificate generation status (it will take quite some time so be patient). After the startup is completed, you can connect to ESP's AP named ESP32GW with password 87654321 and access https://esp32gw.local. The browser will complain about the self-signed certificate but you can ignore and continue. The default username and password are admin/admin. Configure your wifi credentials and copy the AES Key which you need to setup in the TTLock Home Assistant addon.

After saving the new configuration, the ESP will reboot, connect to your WiFi and output it's IP address on the serial port (it will also generate a new HTTPS certificate if you changed it's name). It will also be accessible via esp32gw.local (or the new name you gave it) via MDNS if this service is working in your network. You can still make configuration changes by accessing it's IP address in the browser.

Setting up HA

Once you have the ESP running the gateway software, go to the TTLock Home Assistant addon configuration options and add the following:

gateway: noble
gateway_host: IP_ADDRESS_OF_YOUR_ESP
gateway_port: 8080
gateway_key: AES_KEY_FROM_ESP_CONFIG
gateway_user: admin
gateway_pass: admin

The user and password are hardcoded to admin/admin for the moment and so is the port. You will only need to update the IP address of the ESP gateway and the AES key you generated.

For extra debug info, you can add the gateway_debug: true option to log all communication to and from the gateway in Home Assistant.

If everything was done correctly you should now be able to use the addon using the ESP32 device as a BLE gateway.

Todo

  • check if multiple connections to multiple devices are possible (BLEDevice::createClient seems to store only 1 BLEClient, but we could just create the client ourselves)
  • Service UUID filtering for scan and allow/disallow duplicates
  • Timeout for non-authenticated connections
  • Investigate unstable wifi (sometimes it connects but there is no traffic; try to ping gw during setup)
  • Optimize memory fragmentation

Random thoughts

  • device discovery is always sent to all authenticated clients
  • give each device a unique ID (peripheralUuid) and store ID, address and address type in a Map as it is required for connection
  • connection is done based on peripheralUuid translated to address and type in the noble_api
  • always stop scanning before connecting to a device
  • only one client can connect to a device at a time so associate websocket with connection and cleanup on disconnect

esp32-ble-gateway's People

Contributors

fusseldieb avatar kind3r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-ble-gateway's Issues

SPIFFS mount failed

I'm trying to get this set up on an ESP32 module. Compile and upload via the instructions was successful, and when I connect to the AP and try to log in, I see this in the serial monitor:

[HTTPS:I] New connection. Socket FID=58
[HTTPS:I] Request: GET / (FID=58)
Auth middleware started
Auth success
E (73014) SPIFFS: mount failed, -10025
[E][SPIFFS.cpp:89] begin(): Mounting SPIFFS failed! Error: -1
[E][vfs_api.cpp:22] open(): File system is not mounted

Any ideas?

Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Hi has anyone got any advice on the following issue?

Have changed the baud rate etc as per instructions.

Also no errors and can be accessed fine over wifi until I start the home assistant addon.

Many thanks for any help

Connecting to configured ****
IP Address: **
Loading stored HTTPS certificate
Loaded cert from nvs [esp32gw.local][cert=778][pk=1190]
HTTPS started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 147096 | 38908 ||
HTTP started
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 146916 | 38908 ||
Setup complete
|| Miniumum Free DRAM | Minimum Free IRAM ||
|| 119460 | 38908 ||
[HTTPS:I] New connection. Socket FID=57
[HTTPS:I] Request: GET /noble (FID=57)
[HTTPS:I] Upgrading to WS, FID=57
Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x3ffdb300 PS : 0x00060030 A0 : 0x800db682 A1 : 0x3ffce0b0
A2 : 0x3ffdb2a8 A3 : 0x00000000 A4 : 0xbc879fa6 A5 : 0x3ffce1f0
A6 : 0x3ffce25c A7 : 0x3ffc4924 A8 : 0x801ca435 A9 : 0x3ffce090
A10 : 0x3ffdb300 A11 : 0x00000000 A12 : 0x3ffce230 A13 : 0x3ffce1f0
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000019 EXCCAUSE: 0x00000014
EXCVADDR: 0x3ffdb300 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x3ffdb300:0x3ffce0b0 0x400db67f:0x3ffce0d0 0x400d9022:0x3ffce2a0 0x400d74e6:0x3ffce2d0 0x400d39dc:0x3ffce2f0 0x400f72f1:0x3ffce310 0x400907da:0x3ffce330
#0 0x3ffdb300:0x3ffce0b0 in ?? ??:0
#1 0x400db67f:0x3ffce0d0 in NobleApi::onBLEDeviceFound(NimBLEAdvertisedDevice*, std::array<unsigned char, 6u>) at src/noble_api.cpp:327
#2 0x400d9022:0x3ffce2a0 in char const* ArduinoJson6172_91::MemoryPool::findString<char const*>(char const*) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:167
(inlined by) char const* ArduinoJson6172_91::MemoryPool::saveString<ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >(ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > const&) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:66
(inlined by) bool ArduinoJson6172_91::VariantData::setString<ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >(ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, ArduinoJson6172_91::MemoryPool*, ArduinoJson6172_91::storage_policies::store_by_copy) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:288
(inlined by) bool ArduinoJson6172_91::VariantData::setString<ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >(ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, ArduinoJson6172_91::MemoryPool*) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:259
(inlined by) bool ArduinoJson6172_91::variantSetString<ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >(ArduinoJson6172_91::VariantData*, ArduinoJson6172_91::StdStringAdapter<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, ArduinoJson6172_91::MemoryPool*) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantFunctions.hpp:114
(inlined by) bool ArduinoJson6172_91::VariantRef::set<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, ArduinoJson6172_91::enable_if<ArduinoJson6172_91::IsString<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::value, void>::type*) const at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantRef.hpp:215
(inlined by) ArduinoJson6172_91::enable_if<!ArduinoJson6172_91::is_array<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::value, ArduinoJson6172_91::MemberProxy<ArduinoJson6172_91::ObjectRef, char const*>&>::type ArduinoJson6172_91::MemberProxy<ArduinoJson6172_91::ObjectRef, char const*>::operator=<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Object/MemberProxy.hpp:49
(inlined by) NobleApi::sendCharacteristics(unsigned char, std::array<unsigned char, 6u>, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::vector<NimBLERemoteCharacteristic*, std::allocator<NimBLERemoteCharacteristic*> >) at src/noble_api.cpp:543
#3 0x400d74e6:0x3ffce2d0 in ArduinoJson6172_91::MemoryPool::checkInvariants() at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:159
(inlined by) ArduinoJson6172_91::MemoryPool::allocString(unsigned int) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:190
(inlined by) char const
ArduinoJson6172_91::MemoryPool::saveString<ArduinoJson6172_91::RamStringAdapter>(ArduinoJson6172_91::RamStringAdapter const&) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:73
(inlined by) bool ArduinoJson6172_91::VariantData::setString<ArduinoJson6172_91::RamStringAdapter>(ArduinoJson6172_91::RamStringAdapter, ArduinoJson6172_91::MemoryPool*, ArduinoJson6172_91::storage_policies::store_by_copy) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:288
(inlined by) bool ArduinoJson6172_91::VariantData::setString<ArduinoJson6172_91::RamStringAdapter>(ArduinoJson6172_91::RamStringAdapter, ArduinoJson6172_91::MemoryPool*) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:259
(inlined by) bool ArduinoJson6172_91::variantSetString<ArduinoJson6172_91::RamStringAdapter>(ArduinoJson6172_91::VariantData*, ArduinoJson6172_91::RamStringAdapter, ArduinoJson6172_91::MemoryPool*) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantFunctions.hpp:114
(inlined by) bool ArduinoJson6172_91::VariantRef::set(char*, ArduinoJson6172_91::enable_if<ArduinoJson6172_91::IsString<char*>::value, void>::type*) const at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantRef.hpp:223
(inlined by) ArduinoJson6172_91::MemberProxy<ArduinoJson6172_91::JsonDocument&, char const*>& ArduinoJson6172_91::MemberProxy<ArduinoJson6172_91::JsonDocument&, char const*>::operator=(char*) at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Object/MemberProxy.hpp:58
(inlined by) NobleApi::sendAuthMessage(unsigned char) at src/noble_api.cpp:473
#4 0x400d39dc:0x3ffce2f0 in GwSettings::init() at src/gw_settings.cpp:200
#5 0x400f72f1:0x3ffce310 in ble_sm_timer at .pio/libdeps/esp-wrover/NimBLE-Arduino/src/nimble/host/src/ble_sm.c:2481
#6 0x400907da:0x3ffce330 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

fatal error: hwcrypto/aes.h: No such file or directory

Hi.

I'm presenting this error when I compile the code.

I only make a change in the lib_deps platformio.ini because platformio can't locate "[email protected]:h2zero/NimBLE-Arduino.git#refactor-advertised-device"

This how I do it:

lib_deps = 
	bblanchon/ArduinoJson@^6.17.2
	links2004/WebSockets@^2.3.3
	h2zero/NimBLE-Arduino@^1.1.0
	; https://github.com:h2zero/NimBLE-Arduino.git#refactor-advertised-device
	esp32_https_server@^1.0.0

I share the logs of the compile with you, hope can help.

> Executing task: C:\Users\DIEX\.platformio\penv\Scripts\platformio.exe run --target upload --target monitor --environment esp-wrover <

Processing esp-wrover (board: esp-wrover-ie-module; platform: espressif32; framework: arduino)
------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp-wrover-ie-module.html
PLATFORM: Espressif 32 (3.2.0) > Espressif ESP32-WROVER-(I)EHARDWARE: ESP32 240MHz, 520KB RAM, 4MB Flash
DEBUG: Current (ftdi) On-board (ftdi) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)PACKAGES:
 - framework-arduinoespressif32 0.0.0+sha.82161be
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - tool-mkspiffs 2.230.0 (2.30)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoJson> 6.17.3
|-- <WebSockets> 2.3.6
|   |-- <WiFi> 1.0
|   |-- <SPI> 1.0
|   |-- <WiFiClientSecure> 1.0
|   |   |-- <WiFi> 1.0
|-- <NimBLE-Arduino> 1.2.0
|-- <esp32_https_server> 1.0.0
|-- <Preferences> 1.0
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <WiFi> 1.0
|-- <SPIFFS> 1.0
|   |-- <FS> 1.0
Building in release mode
Compiling .pio\build\esp-wrover\src\ble_api.cpp.o
Compiling .pio\build\esp-wrover\src\gw_settings.cpp.o
Compiling .pio\build\esp-wrover\src\main.cpp.o
Compiling .pio\build\esp-wrover\src\noble_api.cpp.o
In file included from src/gw_settings.h:5:0,
                 from src/gw_settings.cpp:1:
src/security.h:4:26: fatal error: hwcrypto/aes.h: No such file or directory
compilation terminated.
*** [.pio\build\esp-wrover\src\gw_settings.cpp.o] Error 1
In file included from src/gw_settings.h:5:0,
                 from src/noble_api.h:12,
                 from src/noble_api.cpp:1:
src/security.h:4:26: fatal error: hwcrypto/aes.h: No such file or directory
compilation terminated.
In file included from src/gw_settings.h:5:0,
                 from src/main.cpp:7:
src/security.h:4:26: fatal error: hwcrypto/aes.h: No such file or directory
compilation terminated.
*** [.pio\build\esp-wrover\src\noble_api.cpp.o] Error 1
*** [.pio\build\esp-wrover\src\main.cpp.o] Error 1
=============== [FAILED] Took 14.24 seconds ===============

Environment    Status    Duration
-------------  --------  ------------
esp-wrover     FAILED    00:00:14.241
========== 1 failed, 0 succeeded in 00:00:14.241 ========== 
The terminal process "C:\Users\DIEX\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--target', 'monitor', '--environment', 'esp-wrover'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

MQTT

Hello! Very nice and interesting project. Is it possible to be integrated MQTT connectivity?

Why not make it compatible with Arduino?

I am using Linux. I have arduino. I don't know why it requires VisualStudio etc.
Arduino could also program SPIFF partition. I wish someone could convert it to arduino and we could use this...

SSID available but cant connect to esp32gw.local

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?

Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (loopTask)
Core 1 register dump:
PC      : 0x400931b8  PS      : 0x00060a36  A0      : 0x4008359c  A1      : 0x3ffcba50
A2      : 0x00000000  A3      : 0x00060a23  A4      : 0x00060a20  A5      : 0x00000001
A6      : 0x00000041  A7      : 0x00000000  A8      : 0x80154689  A9      : 0x3ffcbbe0
A10     : 0x00000081  A11     : 0x00000004  A12     : 0x3ffe0dd4  A13     : 0x1bbe0ce0
A14     : 0x737c2b73  A15     : 0xa9f4439f  SAR     : 0x0000001f  EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x400931b8:0x3ffcba50 0x40083599:0x3ffcbb20 0x40093b27:0x3ffcbb40 0x4009418a:0x3ffcbb60 0x400838a9:0x3ffcbb80 0x40083a85:0x3ffcbba0 0x40083c1c:0x3ffcbbc0 0x40157f51:0x3ffcbbe0 0x40154686:0x3ffcbc00 0x40154ad6:0x3ffcbc20 0x4015557a:0x3ffcbc40 0x4015568f:0x3ffcbcc0 0x4015590e:0x3ffcbce0 0x4014eaab:0x3ffcc350 0x4014f3ff:0x3ffcc380 0x40150018:0x3ffcc430 0x401500ab:0x3ffcc450 0x40161841:0x3ffcc480 0x40158d4b:0x3ffcc4b0 0x40158d89:0x3ffcc4e0 0x40154375:0x3ffcc510 0x400f135d:0x3ffcd1b0 0x400f158a:0x3ffcd540 0x400d7bfa:0x3ffcd860 0x400d7d35:0x3ffcd900 0x400d3f3f:0x3ffcd970 0x400d3f75:0x3ffcd990 0x400f7446:0x3ffcd9c0 0x400907da:0x3ffcd9e0
  #0  0x400931b8:0x3ffcba50 in _frxt_int_enter at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portasm.S:105
  #1  0x40083599:0x3ffcbb20 in _xt_lowint1 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S:1139
  #2  0x40093b27:0x3ffcbb40 in multi_heap_internal_unlock at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap.c:380
  #3  0x4009418a:0x3ffcbb60 in multi_heap_malloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c:321
  #4  0x400838a9:0x3ffcbb80 in heap_caps_malloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:232
  #5  0x40083a85:0x3ffcbba0 in heap_caps_calloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:232
  #6  0x40083c1c:0x3ffcbbc0 in esp_mbedtls_mem_calloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/port/esp_mem.c:25
  #7  0x40157f51:0x3ffcbbe0 in mbedtls_calloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/platform.c:93
  #8  0x40154686:0x3ffcbc00 in mbedtls_mpi_grow at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #9  0x40154ad6:0x3ffcbc20 in mbedtls_mpi_shift_l at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #10 0x4015557a:0x3ffcbc40 in mbedtls_mpi_div_mpi at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #11 0x4015568f:0x3ffcbcc0 in mbedtls_mpi_mod_mpi at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #12 0x4015590e:0x3ffcbce0 in mbedtls_mpi_exp_mod at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #13 0x4014eaab:0x3ffcc350 in rsa_prepare_blinding at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:425
  #14 0x4014f3ff:0x3ffcc380 in mbedtls_rsa_private at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:962
  #15 0x40150018:0x3ffcc430 in mbedtls_rsa_rsassa_pkcs1_v15_sign at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:2108
  #16 0x401500ab:0x3ffcc450 in mbedtls_rsa_pkcs1_sign at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:2151
  #17 0x40161841:0x3ffcc480 in rsa_sign_wrap at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/pk_wrap.c:145
  #18 0x40158d4b:0x3ffcc4b0 in mbedtls_pk_sign_restartable at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/pk.c:520
  #19 0x40158d89:0x3ffcc4e0 in mbedtls_pk_sign at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/pk.c:520
  #20 0x40154375:0x3ffcc510 in mbedtls_x509write_crt_der at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/x509write_crt.c:493
  #21 0x400f135d:0x3ffcd1b0 in _ZN11httpsserverL10cert_writeERNS_7SSLCertENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_$constprop$18 at .pio/libdeps/esp-wrover/esp32_https_server/src/SSLCert.cpp:51    
  #22 0x400f158a:0x3ffcd540 in httpsserver::createSelfSignedCert(httpsserver::SSLCert&, httpsserver::SSLKeySize, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at .pio/libdeps/esp-wrover/esp32_https_server/src/SSLCert.cpp:297 (discriminator 4)
  #23 0x400d7bfa:0x3ffcd860 in WebManager::initCertificate() at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:244
  #24 0x400d7d35:0x3ffcd900 in WebManager::init() at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:244
  #25 0x400d3f3f:0x3ffcd970 in setupWeb() at src/main.cpp:66
  #26 0x400d3f75:0x3ffcd990 in setup() at src/main.cpp:79
  #27 0x400f7446:0x3ffcd9c0 in loopTask(void*) at C:/Users/botts/.platformio/packages/framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6/cores/esp32/main.cpp:18
  #28 0x400907da:0x3ffcd9e0 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
Generating new HTTPS certificate
Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (loopTask)
Core 1 register dump:
PC      : 0x400930a3  PS      : 0x00060a36  A0      : 0x400931c4  A1      : 0x3ffcba20
A2      : 0x00000000  A3      : 0xffffffff  A4      : 0x00060a20  A5      : 0x00000001
A6      : 0x00000002  A7      : 0x00000000  A8      : 0x8015512f  A9      : 0x3ffcbbb0
A10     : 0x3ffcbbd8  A11     : 0x00000000  A12     : 0x4008359c  A13     : 0x7e281ae2
A14     : 0x43f6e0a0  A15     : 0x3265334b  SAR     : 0x0000001f  EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x400930a3:0x3ffcba20 0x400931c1:0x3ffcbaf0 0x40093b27:0x3ffcbb10 0x400941cf:0x3ffcbb30 0x40083946:0x3ffcbb50 0x40083c29:0x3ffcbb70 0x40157f62:0x3ffcbb90 0x4015465f:0x3ffcbbb0 0x4015512c:0x3ffcbbd0 0x4015514f:0x3ffcbc10 0x401554f0:0x3ffcbc40 0x4015568f:0x3ffcbcc0 0x4015590e:0x3ffcbce0 0x4014eaab:0x3ffcc350 0x4014f3ff:0x3ffcc380 0x40150018:0x3ffcc430 0x401500ab:0x3ffcc450 0x40161841:0x3ffcc480 0x40158d4b:0x3ffcc4b0 0x40158d89:0x3ffcc4e0 0x40154375:0x3ffcc510 0x400f135d:0x3ffcd1b0 0x400f158a:0x3ffcd540 0x400d7bfa:0x3ffcd860 0x400d7d35:0x3ffcd900 0x400d3f3f:0x3ffcd970 0x400d3f75:0x3ffcd990 0x400f7446:0x3ffcd9c0 0x400907da:0x3ffcd9e0
  #0  0x400930a3:0x3ffcba20 in _xt_context_save at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_context.S:132
  #1  0x400931c1:0x3ffcbaf0 in _frxt_int_enter at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portasm.S:112
  #2  0x40093b27:0x3ffcbb10 in multi_heap_internal_unlock at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap.c:380
  #3  0x400941cf:0x3ffcbb30 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
  #4  0x40083946:0x3ffcbb50 in heap_caps_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:232
  #5  0x40083c29:0x3ffcbb70 in esp_mbedtls_mem_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/port/esp_mem.c:35
  #6  0x40157f62:0x3ffcbb90 in mbedtls_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/platform.c:98
  #7  0x4015465f:0x3ffcbbb0 in mbedtls_mpi_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #8  0x4015512c:0x3ffcbbd0 in mbedtls_mpi_mul_mpi at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #9  0x4015514f:0x3ffcbc10 in mbedtls_mpi_mul_int at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #10 0x401554f0:0x3ffcbc40 in mbedtls_mpi_div_mpi at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #11 0x4015568f:0x3ffcbcc0 in mbedtls_mpi_mod_mpi at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #12 0x4015590e:0x3ffcbce0 in mbedtls_mpi_exp_mod at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2661
  #13 0x4014eaab:0x3ffcc350 in rsa_prepare_blinding at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:425
  #14 0x4014f3ff:0x3ffcc380 in mbedtls_rsa_private at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:962
  #15 0x40150018:0x3ffcc430 in mbedtls_rsa_rsassa_pkcs1_v15_sign at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:2108
  #16 0x401500ab:0x3ffcc450 in mbedtls_rsa_pkcs1_sign at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/rsa.c:2151
  #17 0x40161841:0x3ffcc480 in rsa_sign_wrap at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/pk_wrap.c:145
  #18 0x40158d4b:0x3ffcc4b0 in mbedtls_pk_sign_restartable at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/pk.c:520
  #19 0x40158d89:0x3ffcc4e0 in mbedtls_pk_sign at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/pk.c:520
  #20 0x40154375:0x3ffcc510 in mbedtls_x509write_crt_der at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/x509write_crt.c:493
  #21 0x400f135d:0x3ffcd1b0 in _ZN11httpsserverL10cert_writeERNS_7SSLCertENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_$constprop$18 at .pio/libdeps/esp-wrover/esp32_https_server/src/SSLCert.cpp:51    
  #22 0x400f158a:0x3ffcd540 in httpsserver::createSelfSignedCert(httpsserver::SSLCert&, httpsserver::SSLKeySize, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at .pio/libdeps/esp-wrover/esp32_https_server/src/SSLCert.cpp:297 (discriminator 4)
  #23 0x400d7bfa:0x3ffcd860 in WebManager::initCertificate() at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:244
  #24 0x400d7d35:0x3ffcd900 in WebManager::init() at .pio/libdeps/esp-wrover/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:244
  #25 0x400d3f3f:0x3ffcd970 in setupWeb() at src/main.cpp:66
  #26 0x400d3f75:0x3ffcd990 in setup() at src/main.cpp:79
  #27 0x400f7446:0x3ffcd9c0 in loopTask(void*) at C:/Users/botts/.platformio/packages/framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6/cores/esp32/main.cpp:18
  #28 0x400907da:0x3ffcd9e0 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
Generating new HTTPS certificate

main.cpp not compiling

I tried compiling the source (main.cpp) but I am stuck with this error.
How will this issue be fixed?

Processing esp-wrover-debug (board: esp-wrover-ie-module; platform: espressif32; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------Library Manager: Installing [email protected]:h2zero/NimBLE-Arduino.git#refactor-advertised-device
git version 2.37.2.windows.2
Cloning into 'C:\Users\<my_username>\.platformio\.cache\tmp\pkg-installing-syk7rf49'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: VCS: Could not process command ['git', 'clone', '--recursive', '--depth', '1', '--branch', 'refactor-advertised-device', '[email protected]:h2zero/NimBLE-Arduino.git', 'C:\\Users\\<my_username>\\.platformio\\.cache\\tmp\\pkg-installing-syk7rf49']     

 *  The terminal process "C:\Users\<my_username>\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.