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
BleError: Cannot start scanning operation on certain Android Phones #390
Comments
One note: callback shouldn't be "async", Can you specify which Android phones fail and what are their versions? Verbose logs from logcat would be helpful as well. |
I seem to have the same issue. Logcat:
Same apk/code does work on a Find 7 with android 8.1, but there I do have to open bluetooth settings and click 'pair new device' to manually start the scanner, or it won't find anything.
|
More info, when the scanning failed, the original error in java was: |
When I disable bluetooth, then start the app, wait for a bit and re-enable bluetooth, the scanning works. However, it disconnects after a few seconds. This smells of an Android bug |
This is generally bad. It means that all applications on Android used up all GATT clients and therefore your app won't be able to do anything. Please make sure that your application has ACCESS_COARSE_LOCATION enabled (it is a dangerous permission) as well as location enabled (GPS symbol). |
Hey, I have both enabled. It works on another phone. I can also get it to work after a reboot, if no other apps started running. I'm guessing this is either a bug in android, or some issue with one of the apps (nrf connect?) that I have installed. Not much to be fixed here in code, I'm afraid. Apart from maybe be a bit more verbose in the error message (why was scanning not started?), as we have that info in the java BleError class. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing, as this is probably not an issue in library itself. |
I ran into this problem and found some conditions when it occurs and how to prevent it;
|
how do I increase scan time ? |
I am getting the above error on certain android phones when trying to initiate a scan. I am trying to track down exactly what version and model the phones are, but do you have any insight into what would cause this error to be thrown? The call I am making is
manager.startDeviceScan([serviceId], {allowDuplicates: false}, async (error, device) => {});
Is it possible that this version of android doesn't support either allowDuplicates false or scanning by serviceId?
The text was updated successfully, but these errors were encountered: