AAT icon indicating copy to clipboard operation
AAT copied to clipboard

Sensor doesn't work with my Samsung A5 and Mi Band 3

Open flogith opened this issue 5 years ago • 16 comments

Hello, I just found this nice app, but sensors doesn't work on my Samsung A5 2016. The internal samsung step counters and my mi band 3 heart rate sensor are detected through the app, but I have no BPM or RPM: Thanks for your support!

flogith avatar Jul 08 '19 10:07 flogith

Mi Band 3 is not compatible heart rate sensor, it uses it's own proprietary protocol.

cleveHEX avatar Jul 18 '19 09:07 cleveHEX

I don't use the official MiFit app, but from what i heard, they (now) have the possibility to switch to "visible mode", as mentioned here: https://github.com/Freeyourgadget/Gadgetbridge/issues/1606

vanous avatar Aug 23 '19 06:08 vanous

There should be no problem, if it uses GATT. If this was true, I would not be so confident about Xiaomi backporting it to MB 3. Currently only solution there would be using gadgetbridge's API to access the data (but I am not sure if it has one), it would serve as a decent HAL.

cleveHEX avatar Aug 23 '19 08:08 cleveHEX

Gadgetbridge added support to enable the sensor via BLE, same can be done via the MiFit. In AAT, the sensor is listed as supported, then as connected, but no data arrives.

I have now tested this in anther app and it works. I have Amazefit Bip.

I can see the sensor in BLE Explorer, although I am not sure it I should be able to see the data there.

characteristic UUID: 00002a39-0000-1000-8000-00805f9b34fb service UUID: 0000180d-0000-1000-8000-00805f9b34fb value: 0 = 0 =

I haven't tried master, if you made some changes...

vanous avatar Aug 27 '19 12:08 vanous

While reporting GATT Service and Characteristics Unfortunatly Amazefit Bip do not support the standard reporting: Gadgetbridge (should) have special design to deal with it, you need to clarify. You can verify with Nordic Semiconductor "nRF connect" and "nRF Toolbox" the non standard format or other tools... https://github.com/NordicSemiconductor

arsab avatar Aug 27 '19 17:08 arsab

Just FYI: I can see my heart rate in the nRF Connect for Moblie app (current version from playstore). I use a Mi band 4 and activated the sensor via GadgetBridge. So it seems to be possible to interpret the data from the device.

desperadoduck avatar Aug 27 '19 18:08 desperadoduck

Oops sorry, it was the nrf toolbox I started... Still, it seems to work.

desperadoduck avatar Aug 27 '19 19:08 desperadoduck

Cool. I actually think I can see it in BLE explorer, I will try to decode it. This is the characteristics: characteristic UUID: 00002a37-0000-1000-8000-00805f9b34fb service UUID: 0000180d-0000-1000-8000-00805f9b34fb value: 44 = 17408 = D

vanous avatar Aug 27 '19 19:08 vanous

@vanous: :+1: The NRF Toolbox seems to be opensourced (https://github.com/NordicSemiconductor/Android-nRF-Toolbox), so you can also take look at what they are doing to decode the data, if you like.

desperadoduck avatar Aug 27 '19 19:08 desperadoduck

Cool. So this confirms:

heartrate service: static final UUID SERVICE_UUID = UUID.fromString("0000180D-0000-1000-8000-00805f9b34fb"); // Heart Rate service

the measurement characteristics: private static final UUID MEASUREMENT_CHARACTERISTIC_UUID = UUID.fromString("00002A37-0000-1000-8000-00805f9b34fb");

vanous avatar Aug 27 '19 19:08 vanous

@desperadoduck it is just a hex value which is displayed in BLE Explorer so yes, i can see the HR data changing live in BLE Explorer and also in NRF Toolbox, in HRM screen and also on Template screen. Btw. you do not need Gadgetbridge running anymore, it just enables it and it can disconnect, the sensor remains available (and might be drawing more battery too).

vanous avatar Aug 27 '19 20:08 vanous

That is one of challenge: in the past I tried to get HR into Runtastic or Strava. At that time could do it by activating the sensor with "Mi Heart Rate" but needed to have it running in background continuously...... Better to: ==> Decode How the activation can happen. and maintained ==> Understand the format of reporting. ==> Then you can propose the code to collect.

Also be careful that HR on "Mi.." are not very accurate while moving.

arsab avatar Aug 28 '19 07:08 arsab

That is one of challenge: in the past I tried to get HR into Runtastic or Strava. At that time could do it by activating the sensor with "Mi Heart Rate" but needed to have it running in background continuously......

I might be wrong and I do not use MiFit but rather Gadgetbridge, but i presume that they cannot disable this if you disconnect spontaneously, unless there is some delay in the band to periodically receive this packet. But in my testing (about 30 minutes activity), i had GB disconnected and HR kept arriving.

Better to: ==> Decode How the activation can happen. and maintained

This is already done, in GB. But this should not belong to AAT imho.

==> Understand the format of reporting. ==> Then you can propose the code to collect.

This is i think not as complex as it acts as standard sensor.

Also be careful that HR on "Mi.." are not very accurate while moving.

Agree, everybody must decide what to invest into...

vanous avatar Aug 28 '19 08:08 vanous

Got it I assume you are referring to following change in Gadgetbridge: https://github.com/Freeyourgadget/Gadgetbridge/commit/243eec042d497ff47b7a8a7e68a42eb6d6e38e80

It might be interesting to get visibility on other hw capabilities ;-)

arsab avatar Aug 28 '19 15:08 arsab

Got it I assume you are referring to following change in Gadgetbridge: Freeyourgadget/Gadgetbridge@243eec0

yes

It might be interesting to get visibility on other hw capabilities ;-)

this is depending on the watch really... the command just enables this functionality...

vanous avatar Aug 28 '19 17:08 vanous

Hi all,

I am using AAT 1.18 on latest build of LineageOS 16 for OnePlus 3t. I turned the heart rate sensor on my Amazfit Bip using Gadgetbridge 0.43.1 and AAT is receiving data :)! But the date is only visible on the graph screen of Cockpit A, it is not shown on the main screen of Cockpit A. On the main screen only -- is shown, although the data is shown on the graph and logged in the gpx file. Any idea what is happening here?

Regards K

anonimno1 avatar Apr 10 '20 20:04 anonimno1