Android Question BLE Device not connecting?

Scantech

Well-Known Member
Licensed User
I am trying to connect to a BLE Device. I ran a scan and found mac name and id.

I use manager.Connect and manager.Connect2 and failed to connect. manager_Disconnected event gets triggered.

Is there something i am missing or some procedure required? BLE is new to me and i am trying to figure this out.
 

Scantech

Well-Known Member
Licensed User
What happens when you run the BLE example? Are you able to connect?

Make sure that the peripheral device allows connections. Maybe you need to press on something before it accepts connections.
I had to modify your BLE example because it stops scan to the first available device and connects to it. I added "if Found Device ID = myDevice ID then Stop Scan and Connect2". Still no progress.

The device does not have anything to press on to. It is Viecar OBD2 Device Dual Mode (Bluetooth 2.0 and Bluetooth 4.0) and there are many apps at the store supports this device. I am only interested in BLE 4.0 with your BLE2 library.
 

Scantech

Well-Known Member
Licensed User
Are you able to connect (not read data from the advertising packets) with an app such as this one: https://play.google.com/store/apps/details?id=com.lapis_semi.bleapp&hl=en ?
I downloaded it and it will not connect with Android. I tried the same app with IOS and it connected fine. It has a Dual mode and i am beginning to think the Bluetooth 2.0 is for Android and 4.0 is IOS. Is it possible it only works for IOS? Should Android also have ways to connect to it?

Your BLE2 is awesome and i should of never under estimate the library.
 
Last edited:

emexes

Well-Known Member
Licensed User
We are fighting a similar dragon in another thread, and you might want to consider:

We bought tablets that specs say are Bluetooth 4.0 and 4.2 compatible, and turns out they don't support BLE. Then I spent an hour with Samsung trying to pin down which of their tablets support BLE, and it was like trying to round up sheep ;-/
https://www.b4x.com/android/forum/threads/bluetooth-4-0-data-exchange.103107/#post-646702

whether they are communicating with Bluetooth Low Energy or with Bluetooth Classic (BR/EDR). The two are not the same, nor compatible with each other. The B4A BLE2 library only works for Bluetooth Low Energy.

https://en.wikipedia.org/wiki/Bluetooth_Low_Energy#Compatibility

So, the next step is to use the BLE Checker app to confirm that the Android devices support BLE, and then to use nRF Connect or BLE UUID Explorer to scan and find and connect your hardware and read a value.
https://www.b4x.com/android/forum/threads/bluetooth-4-0-data-exchange.103107/#post-646730

The apps that I've been using to confirm that devices are actually using BLE (so that I don't get tricked into attempting miracles with B4A+BLE2) are:
(The impossible we do at once; the miraculous takes a little longer)



If you can't communicate with the BLE device using nRF Connect or BLE UUID Explorer or BLE Analyser, then you can rely on B4A+BLE2 not being able to communicate with it either (unless one of those three apps includes a secret non-BLE ie BR/EDR Bluetooth interface... :-/ )
 
Top