Android Question BLE 2 - Bluetooth Low Energy problem with disconnecting

grafsoft

Well-Known Member
Licensed User
Longtime User
Trying Erel's example (https://www.b4x.com/android/forum/threads/b4x-ble-2-bluetooth-low-energy.59937/#content), I am disconnected 1-2 seconds after connecting.

The logs:

Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
Found: , BC:7E:8B:C3:53:0B, RSSI = -102, (MyMap) {-1=[B@d21891a, 0=[B@3297c4b}
connecting
Found: , 04:81:71:2A:69:A1, RSSI = -84, (MyMap) {-1=[B@98af628, 0=[B@21b2f41}
connecting
Disconnected
Disconnected

With
B4X:
B4XPages.GetManager.LogEvents = True

*** mainpage: B4XPage_Appear
** Activity (main) Resume **
*** mainpage: B4XPage_PermissionResult [mainpage]
*** mainpage: B4XPage_PermissionResult [mainpage]
*** mainpage: B4XPage_PermissionResult [mainpage]
startscan
Found: , 08:D6:74:2B:1E:0D, RSSI = -89, (MyMap) {-1=[B@3579bc5, 0=[B@d21891a}
connecting
Disconnected
** Activity (main) Pause event (activity is not paused). **
*** mainpage: B4XPage_Disappear [mainpage]
** Service (starter) Destroy (ignored)**



Devices:

Samsung SM A725F
Xiaomi 6 band, but the same results with another (Denver)

Phone settings checked.
 

grafsoft

Well-Known Member
Licensed User
Longtime User
Nearly solved. It connects for a short time. I have to click on "Read data" quickly, then I get results. Might need a time for my app that reconnects every minute or so. I want to monitor the heart rate, but I do not need it every second. Is this the usual behaviour?
 
Upvote 0
Top