Android Question BLE2 immediately disconnected

headingwest

Member
Licensed User
Longtime User
I'm using the BLE example with the BLE2 library (1.35) connecting to a Bluno arduino with BLE.

When I click Scan & Connect the log shows:

Found: Bluno, 20:CD:39:87:C3:0D, RSSI = -51, (MyMap) {1=[B@9ba10b2, -1=[B@fb8803, 9=[B@3dc0380, 18=[B@2beadb9, 10=[B@a3485fe, 2=[B@9a4a15f, 0=[B@2bdd7ac}
Disconnected

Why is it immediately disconnected? How do I troubleshoot this?
 

headingwest

Member
Licensed User
Longtime User
Hi Erel, using your demonstration app at:
https://www.b4x.com/android/forum/threads/ble-2-bluetooth-low-energy.59937/#content

After clicking scan the code path in Starter Module is:

B4X:
Sub Scan
    manager.Scan(Null)
End Sub

Sub Manager_DeviceFound (Name As String, Id As String, AdvertisingData As Map, RSSI As Double)
    Log("Found: " & Name & ", " & Id & ", RSSI = " & RSSI & ", " & AdvertisingData)
    ConnectedName = Name
    manager.StopScan
    manager.Connect(Id)  
End Sub

Sub Manager_Disconnected
    Log("Disconnected")
    connected = False
    CallSub(Main, "StateChanged")
End Sub

The Manager_Connected event is never triggered.

Log reads:
Found: Bluno, 20:CD:39:87:C3:0D, RSSI = -69, (MyMap) {1=[B@2bdd7ac, -1=[B@d936c75, 9=[B@a4f040a, 18=[B@9bf47b, 10=[B@906c298, 2=[B@bb5af1, 0=[B@ce156d6}
Disconnected

Are there any parameters/pairing tricks you can think of??
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
I am facing the exact same issue with a thermal printer that does work with iOS.
Any ideas?
 
Upvote 0
Top