Skip to content
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

BLE.advertise() Failure Makes BLE Unusable Until Next Reset #378

Open
AndrewDile opened this issue Jan 5, 2025 · 0 comments
Open

BLE.advertise() Failure Makes BLE Unusable Until Next Reset #378

AndrewDile opened this issue Jan 5, 2025 · 0 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@AndrewDile
Copy link

AndrewDile commented Jan 5, 2025

I'm currently using an Arduino Opta to advertise some information through the manufacturer's data. Because of this, I need to stop and restart the advertisement of the device quite often. I have noticed that, depending on the sketch and maybe other factors, it works for a while, only to then throw a single advertise error, which is quickly followed by zero successful BLE.advertise() calls after that. This could be an issue with my code, but I can't get any error code other than it failed, and there is not a ton of documentation on possible causes.

The amount of time it takes to fail seems to be random, but after one failure, there is no successful BLE,advertise() call after that. It also seems to be unrelated to connecting to devices, though it may change the average time to first failure. Ending and restarting the BLE stack in the program itself is out of the question because of how long it takes, especially since I have many more characteristics that I removed for code readability in my sample below. I've already guaranteed that the advertisement data all fits within the allotted 31 bytes, and I can confirm so by using NRF Connect and my own BLE scanner app to make sure.

Code:

BLE Debug.txt

Output from Code:

15:49:39.161 -> BLE Initialized
15:50:15.483 -> Connected to Central [address]
15:50:22.783 -> Disconnected from Central
15:50:42.822 -> Failed to advertise, trying again next call
15:50:44.853 -> Failed to advertise, trying again next call
15:50:46.854 -> Failed to advertise, trying again next call
15:50:48.846 -> Failed to advertise, trying again next call

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants