-
Notifications
You must be signed in to change notification settings - Fork 5
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
Adapter needs to be reset after a scan, errors instead #4
Comments
c3V6a2Vy#4 Adding a retry loop to allow resetting the BLE adapter so it can perform another scan
As the message suggested though, it likely that you are not running it with privileged permission (like Can you try running with root to see if it solves the problem? |
That's right, it's not running as root and I shouldn't have to. So implementing the other solution the message suggested is to reset the adapter (adapter.reset()). Having given the fix a try locally, I can easily get the scan to work multiple times without having to raise permissions. |
You are right, running it as a super user is not ideal. I am wondering if you have to retry more than once to get it fixed or it'll always succeed after the first retry. If it always succeed maybe it should be just as easy as calling I also suspect that a manual discovery right after a failed |
I've been able to get it to work consistently with a single retry. But considering how flaky these connections are, may be good to give it a couple of extra. |
I did find BLE connections could be more unstable than others, even with my two devices placed still, not sure why exactly. As a simple library the user should not be bugged by the occasional connection drop, a retry do give them a peace of mind. Code merged and closing this issue now. Thank you again for your time and contribution! |
When running a scan for devices and the Auto Connect times out, I will try a manual connection and search with a longer timeout and will get this error:
Maybe try performing a reset then retrying?
The text was updated successfully, but these errors were encountered: