Android Question Bluetooth discovers BLE

diego

Member
Licensed User
Longtime User
I've been looking for an answer to this strange behavior but couldn't find it:

I have a hm-10 BLE module and with an example it works fine when scans and finds it in my cellphone. But with a tablet Lenovo tab8 scanning doesn't find it. Instead if I try with old bluetooth discovering it finds it! Of course it doesn't connect as the module is BLE.

How can I know if the device is BLE or bluetooth?
 
Solution
mystery solved. I didn't enable LOCATION on the tablet Android settings.

BTW, is there any way to force Location? asking for permission doesn't activate it.

thanks!

diego

Member
Licensed User
Longtime User
thanks Erel, with the example as-is, same behaviour. Tablet doesn't find anything, it gets scanning. Cellphone also finds (before finding HM-10) a headphones from my neighbourgh... the tablet nothing.

but I installed "Serial Bluetooth Terminal" and there it find it perfectly under "Bluetooth LE" devices.
from Android Settings-Bluetooth, it shows the HM-10 and also ask me for the PIN (I changed the original 000000 to another one)
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
I don't know BLE very well, so this suggestion might not be applicable...

Does the HM-10 have a "name"?

I remember seeing a setting somewhere that you can configure BT scans to only show devices with names (not just MAC). And maybe the tablet is configured this way and if the HM-10 doesn't have a BLE "name", then it wont show in scan?

Just an idea.
 
Upvote 0

diego

Member
Licensed User
Longtime User
I don't know BLE very well, so this suggestion might not be applicable...

Does the HM-10 have a "name"?

I remember seeing a setting somewhere that you can configure BT scans to only show devices with names (not just MAC). And maybe the tablet is configured this way and if the HM-10 doesn't have a BLE "name", then it wont show in scan?

Just an idea.
Yes, it has a name. In fact I use it to connect if it's the name I wanted. But even with "null" Scan doesn't find it.
 
Upvote 0

diego

Member
Licensed User
Longtime User
mystery solved. I didn't enable LOCATION on the tablet Android settings.

BTW, is there any way to force Location? asking for permission doesn't activate it.

thanks!
 
Upvote 0
Solution

JohnC

Expert
Licensed User
Longtime User
You can't force location on, but you can check if it is off, and then have the device open it's "location" settings page to allow the user to turn it on.
 
Upvote 0

diego

Member
Licensed User
Longtime User
You can't force location on, but you can check if it is off, and then have the device open it's "location" settings page to allow the user to turn it on.
how to do it? I've seen this post


but without solution.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
I think the code is this example will show how to do that:


(it is discussed here: https://www.b4x.com/android/forum/t...-in-phone-system-settings.113216/#post-706529)
 
Upvote 0
Top