[Android] Connecting to sensors breaks if they have been silent more than a minute

Issue #77 open
Klaus Förger created an issue

If I wake up 5 sensors so that they advertise and immediately connect to them with Mds.connect(), the connections are created nicely, and when I call:

String[] cb = BleManager.INSTANCE.getConnectedBleDevicesCb().connectedDevices;

I get a log line to Android Studio:

D/BleManager: Found connected devices: [10000001, , , 10000004, , , 10000002, , , 10000003, , , 10000005, , ]

However, if I wake up 5 sensors, wait until they stop advertising, start connecting to them with with Mds.connect(), wait for 1 minute, and make the sensors advertise again, the connections are not created successfully meaning that the onConnectionComplete() is never called. Instead, the sensors get stuck, and I have to kill the Android app to to use them again.

In this case, the log line in Android Studio repeats one value multiple times as follows:

D/BleManager: Found connected devices: [10000004, , , 10000004, , , 10000004, , , 10000004, , ]

This issue harms usability when working with multiple sensors as if one sensor has a problem, the user needs to kill the app and reconnect all the sensors.

I used Android Studio on Linux, with Android mobile lib version 1.28.1 and firmware version 1.7.2 on the sensors. I tested this on Samsung Galaxy S7, LG K8 (2017), and Nexus 5X phones, and the bug happens consistently on all the devices.

Comments (2)

  1. Petri Lipponen

    Am I correct in assuming you’re using the hr_wakeup_app or the std_ble_services_app on the sensor? (or something else that only stays awake if there is WB connection.

    My guess is that if you connect to the sensor “late” in the 1 minute shutdown period the connection is not completed before the sensor shuts down.

    Also, does it happen with the MDS 1.34.1?

  2. Log in to comment