-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP32 halts when repeatedly invoking ble.begin() & ble.end() #1711
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
Comments
I got the same problem with SerialBT. (SerialBT.begin()/SerialBT.end()) abort() was called at PC 0x4008a255 on core 0 Backtrace: 0x40090c38:0x3ffdba20 0x40090e3b:0x3ffdba40 0x4008a255:0x3ffdba60 0x4008a280:0x3ffdba80 0x4008a3d1:0x3ffdbab0 0x4014e3d7:0x3ffdbad0 0x40147cd5:0x3ffdbd90 0x40140625:0x3ffdbde0 0x400d72ab:0x3ffdbe10 0x400efb3d:0x3ffdbe30 0x400e6ff1:0x3ffdbe50 0x4012b9b3:0x3ffdbe70 0x40114291:0x3ffdbee0 0x40114211:0x3ffdbf00 0x4011436e:0x3ffdbf20 0x400efa96:0x3ffdbf40 Rebooting... rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) |
Hardware: Board: Heltec WiFi LoRa 32 Description: I can confirm to be able to reproduce this issue with the sketch from @muojp. I am using a Heltec WiFi LoRa 32 with a ESP32 on board. The ESP32 either hangs after 30 times, or crashes and restarts. I'm not using any OS - and hence do not know how to disable dynamic memory allocation as "muojp". I am experiencing similar issues in another program using BLEDevice.h - like in this series of includes:
Here the Bluetooth client hangs 42 loops after the Bluetooth server is turned of. Between those two events, is the client scanning for devices 42 times - and during scanning, all the time not finding any. If it finds some random Bluetooth units in between, it seems to keep the program running. I will do further studies on my setup regarding the seemingly positive influence of other Bluetooth devices around. The following are data printed in the terminal. The value, "88.99" is the value gathered by the client (the unit that hangs) from the Bluetooth server, which is another ESP32 "barebone" (ESP-WROOM-32). After the first semicolon - in each row - the program in the client gets the value from the server, if they are connected. If they aren't connected, the clients starts a scan for 2 seconds. The clients presents whatever it finds in these 2 seconds, prints a second semicolon and the program continues with the next loop. So all the double semicolons are scans without any connections established and no data - or any other device found.
The scan is in my case started with
Every loop is terminated with a The software in the Bluetooth server is a copy from: The client is (modified slightly) based on this: I will check if my modifications have had influence, but doubt it, as the problem seems to exist outside my code too. - Otherwise would this thread not exist. Just mentioned now; There are also a issue with Bluetooth when the client starts up. But that is for another thread. A part of the source for compiling is:
|
Is it possible to get attention to this problem? |
I found and fixed many bugs in BLECLient, and supports multiple device connection and reconnection after disconnection. Please see the difference for details. |
how to install and test from your fork ? |
[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_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hi, thank you very much for your work. My Project (PlatformIO):
platformio.ini
And sorry for my English, i use google translate. |
And yet, ESP32 continues respond to ping. |
If WiFi is not used, will there be a change in uptime? |
Ok. i will test without wifi. |
I found a similar problem: nkolban/esp32-snippets#874 (comment) I made such corrections:
Then started testing (with WiFi) two ESP32 boards (2x ESP32 and 2x MiFlora). Testing stop. ESP32 no freeze. |
Hardware:
Board: DOIT-ESP32-DevBoard
Core Installation/update date: 31/jul/2018
IDE name: Arduino IDE 1.8.5
Flash Frequency: 80Mhz
Upload Speed: 115200
Description:
I tested SimpleBLE library and found it freezes ESP32 board if you periodically call
begin()
andend()
. On my board, ESP32 halts or reboots at 33rd time of callingbegin()
.Here are some detail:
end()
seem solving the problem (no freeze at 100+ times of invocation) but I don't think it's a desired solution.begin()
doesn't affect the test result.BTA_EnableBluetooth
(bt/bluedroid/bta/dm/bta_dm_api.c) stuck and somehow fails to returnfuture
call. I'm not sure whether it is an issue of ESP-IDF or ESP32-Arduino, but filing this issue because it reproduces on simple ESP32-Arduino code.Sketch:
Debug Messages:
The text was updated successfully, but these errors were encountered: