-
Notifications
You must be signed in to change notification settings - Fork 217
ESP32: BLEDevice::discoverService(SERVICE_UUID) made ESP crash because runs out of memory #255
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'm getting the same error with .discoverAttributes(), however if I call .discoverService("uuid here") and pass in my service uuid instead it does not crash and lets me connect.
I'm not sure what effect this will have down the line, but happy to see ESP32 support is being actively worked on |
Thanks for your comment! I will test that tomorrow! |
Yes so far everything else in the BLE sample is working on the ESP32. (I'm using the LED control sample as a starting point). |
When I use
The problem occurs when the function |
After some researches, I found out that the problem occurs because of an infinite loop in the function The program finds descriptors but loop to them until the ESP runs out of memory. I manage to fix this temporary with a counter that stop the loop after 16 iterations, but I suppose there is a bug hidden somewhere that prevents the condition |
Maybe linked to #259 ? |
Maybe #259 fixed |
Hi,
Since ArduinoBLE is compatible with ESP32 with the latest merge, I'm trying to use it with an ESP32.
But when I run the example "PeripheralExplorer.ino", I got this exception: (I update the code to detect a peripheral with localName = "D1533286" instead of "Led")
I don't understand why this exception occurred.
Here is my code:
Thanks
UPDATE 2022-08-31
BLEDevice::discoverService
crashes whenATTClass::discoverAttributes
discovers descriptors withATTClass::discoverDescriptors
.The while loop inside
ATTClass::discoverDescriptors
is never stopped and reads the descriptors in a loop until the ESP has no more memory.I found that for my device there are only 16 descriptors, so I managed to make my program work by stopping the loop after 16 iterations, but I don't understand why the condition
if (responseBuffer[0] == ATT_OP_FIND_INFO_RESP) {
is always true.The text was updated successfully, but these errors were encountered: