Initial support for Mi Band 2 #323

Closed
opened 5 years ago by cpfeiffer · 121 comments
Owner
There is no content yet.
Poster
Owner

Anyone having an actual Mi Band 2 is welcome to test and report. If it is compatible to the previous bands, it should just work as is (except for firmware updates). (Gadgetbridge version 0.10.0 will display '?' as device; newer versions will properly recognize the band.

Anyone having an actual Mi Band 2 is welcome to test and report. If it is compatible to the previous bands, it should just work as is (except for firmware updates). (Gadgetbridge version 0.10.0 will display '?' as device; newer versions will properly recognize the band.
santalaus commented 5 years ago (Migrated from github.com)
Owner

Hello,
got my Band yesterday and tryed to get it running. Bluetooth connect did not work. The Band 2 were not found weather it was connected with Mi Fit or not.
Log Files only have the BT Connection tryes. How could I help.
Best regards.
Nico

Hello, got my Band yesterday and tryed to get it running. Bluetooth connect did not work. The Band 2 were not found weather it was connected with Mi Fit or not. Log Files only have the BT Connection tryes. How could I help. Best regards. Nico
Poster
Owner

Hi Nico, thanks for your testing! 👍

Did the scanning dialog in Gadgetbridge show the device at all? If it wasn't shown, they probably have a different Mac address. At the moment we look for devices with Mac addresses that start either with
88:0F:10: or C8:0F:10: Is yours among them? If it starts with different characters, could you post them here?

A log file captured with Gadgetbridge might still help (see https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files)

Otherwise two separate bluetooth snoops, one created with MiFit connecting, and the other created with Gadgetbrige connecting might help (use the developer settings in Android's settings pane to enable bluetooth dumps. If you don't want to share them publically, I can provide a private upload location.

Hi Nico, thanks for your testing! :+1: Did the scanning dialog in Gadgetbridge show the device at all? If it wasn't shown, they probably have a different Mac address. At the moment we look for devices with Mac addresses that start either with `88:0F:10:` or `C8:0F:10:` Is yours among them? If it starts with different characters, could you post them here? A log file captured with Gadgetbridge might still help (see https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files) Otherwise two separate bluetooth snoops, one created with MiFit connecting, and the other created with Gadgetbrige connecting might help (use the developer settings in Android's settings pane to enable bluetooth dumps. If you don't want to share them publically, I can provide a private upload location.
Owner

Ok, my mi band 2 mac address is starting from C2:84:B2:D5

Source: https://www.reddit.com/r/miband/comments/4njl59/just_got_my_mi_band_2_ask_me_anything_d/

> Ok, my mi band 2 mac address is starting from C2:84:B2:D5 Source: https://www.reddit.com/r/miband/comments/4njl59/just_got_my_mi_band_2_ask_me_anything_d/
santalaus commented 5 years ago (Migrated from github.com)
Owner

Hallo
Mac started with FC:B3:B5:
Band were not shown/found an dthe gadgetbrigde Log didn't contain IMHO anything Interessting.
Best regards

Hallo Mac started with FC:B3:B5: Band were not shown/found an dthe gadgetbrigde Log didn't contain IMHO anything Interessting. Best regards
Owner

I'm fairly sure that the device reports itself with a random MAC Address to unpaired (unbonded) BT peers. It's a standard feature nowadays: Source.

If we still want to filter, we need to do it on device name or some other feature. Can you please install BLE Explorer from Fdroid and tell us what you see when using that app?

I'm fairly sure that the device reports itself with a random MAC Address to unpaired (unbonded) BT peers. It's a standard feature nowadays: [Source](https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/247015). If we still want to filter, we need to do it on device name or some other feature. Can you please install BLE Explorer from Fdroid and tell us what you see when using that app?
Bahjesaispas commented 5 years ago (Migrated from github.com)
Owner

For me BLE Explorer have took à really long time to detect my Mi band 2
http://hpics.li/aace680
http://hpics.li/c6060b3

For more pics dont hesitate

For me BLE Explorer have took à really long time to detect my Mi band 2 http://hpics.li/aace680 http://hpics.li/c6060b3 For more pics dont hesitate
Poster
Owner

Please try the next release. If nothing else, it should discover your mi 2 and allow you to connect it.
If connection still does not work, I'd love to see some log output.

Please try the next release. If nothing else, it should discover your mi 2 and allow you to connect it. If connection still does not work, I'd love to see some log output.
hovancik commented 5 years ago (Migrated from github.com)
Owner

Hi, just got my mibadn 2. Latest version from fdroid:

08:47:07.128 [main] INFO  n.f.g.Logging - Gadgetbridge version: 0.11.1
08:47:07.251 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:47:07.295 [main] DEBUG n.f.g.s.DeviceCommunicationService - DeviceCommunicationService is being created
08:47:07.295 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.start
08:47:07.304 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.request_deviceinfo
08:47:10.220 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect
08:47:10.227 [main] INFO  n.f.g.s.b.BtLEQueue - Attempting to connect to MI Band 2
08:47:10.228 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - Queue Dispatch Thread started.
08:47:10.239 [main] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTING
08:47:10.265 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:47:10.274 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:47:10.795 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 2 (success)
08:47:10.796 [Binder_1] INFO  n.f.g.s.b.BtLEQueue - Connected to GATT server.
08:47:10.797 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTED
08:47:10.800 [main] INFO  n.f.g.e.BluetoothConnectReceiver - got connection attempt
08:47:10.814 [Binder_1] INFO  n.f.g.s.b.BtLEQueue - Attempting to start service discovery:true
08:47:10.817 [main] INFO  n.f.g.e.BluetoothConnectReceiver - won't connect to DA:55:B3:07:50:6F(MI Band 2)
08:47:10.834 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:47:10.839 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:47:10.840 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:47:10.840 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null
08:47:10.841 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:47:10.841 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Attempting to pair MI device...
08:47:10.841 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Unable to pair MI device -- characteristic not available
08:47:10.841 [Binder_1] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Device Info!
08:47:10.842 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:47:10.862 [Binder_1] DEBUG n.f.g.s.d.m.MiBandSupport - Writing User Info!
08:47:10.862 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Attempting to set wear location...
08:47:10.863 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Unable to set Wear Location
08:47:10.863 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Attempting to set Fitness Goal...
08:47:10.864 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Unable to set Fitness Goal
08:47:10.864 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:47:10.865 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:47:10.865 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:47:10.865 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:47:10.874 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Sending current time to Mi Band: July 12 (12 Jul 2016 06:47:10 GMT)
08:47:10.875 [Binder_1] INFO  n.f.g.s.d.m.MiBandSupport - Unable to set time -- characteristic not available
08:47:10.875 [Binder_1] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Battery Info!
08:47:10.875 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:47:10.876 [Binder_1] WARN  n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null
08:47:10.876 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - about to add: 8:47:10 AM: Transaction task: Initializing device with 7 actions
08:47:10.885 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:47 AM: SetDeviceStateAction to INITIALIZING
08:47:10.889 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:47 AM: ReadAction on characteristic: 00002a00-0000-1000-8000-00805f9b34fb
08:47:10.893 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:47:10.896 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:47:11.179 [Binder_3] DEBUG n.f.g.s.b.BtLEQueue - characteristic read: 00002a00-0000-1000-8000-00805f9b34fb (success)
08:47:11.180 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:47 AM:  on characteristic: (null)
08:47:11.182 [GadgetBridge GATT Dispatcher] ERROR n.f.g.s.b.BtLEQueue - Queue Dispatch Thread died: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference
    at nodomain.freeyourgadget.gadgetbridge.devices.miband.UserInfo.getData(UserInfo.java:88) ~[na:0.0]
    at nodomain.freeyourgadget.gadgetbridge.service.devices.miband.MiBandSupport$1.run(MiBandSupport.java:267) ~[na:0.0]
    at nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue$1.run(BtLEQueue.java:88) ~[na:0.0]
08:47:11.182 [GadgetBridge GATT Dispatcher] INFO  n.f.g.s.b.BtLEQueue - Queue Dispatch Thread terminated.
08:47:41.265 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 0 (failed: 19)
08:47:41.265 [Binder_1] WARN  n.f.g.s.b.BtLEQueue - connection state event with error status 19
08:47:41.265 [Binder_1] INFO  n.f.g.s.b.BtLEQueue - Disconnected from GATT server.
08:47:41.266 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - handleDisconnected: 19
08:47:41.266 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - internal gatt callback set to null
08:47:41.266 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED
08:47:41.272 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - disconnect()
08:47:41.275 [Binder_1] INFO  n.f.g.s.b.BtLEQueue - Disconnecting BtLEQueue from GATT device
08:47:41.295 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:47:41.295 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED
08:47:41.303 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:47:41.313 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:47:41.317 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:03.451 [main] INFO  n.f.g.e.AlarmReceiver - won't send sunrise and sunset events (disabled in preferences)
08:48:10.882 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect
08:48:10.889 [main] DEBUG n.f.g.s.b.BtLEQueue - disconnect()
08:48:10.893 [main] INFO  n.f.g.s.b.BtLEQueue - Attempting to connect to MI Band 2
08:48:10.894 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - Queue Dispatch Thread started.
08:48:10.904 [main] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTING
08:48:10.918 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:10.923 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:14.072 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 2 (success)
08:48:14.073 [Binder_2] INFO  n.f.g.s.b.BtLEQueue - Connected to GATT server.
08:48:14.074 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTED
08:48:14.079 [main] INFO  n.f.g.e.BluetoothConnectReceiver - got connection attempt
08:48:14.086 [Binder_2] INFO  n.f.g.s.b.BtLEQueue - Attempting to start service discovery:true
08:48:14.100 [main] INFO  n.f.g.e.BluetoothConnectReceiver - won't connect to DA:55:B3:07:50:6F(MI Band 2)
08:48:14.109 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:48:14.109 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null
08:48:14.109 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:48:14.112 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Attempting to pair MI device...
08:48:14.112 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Unable to pair MI device -- characteristic not available
08:48:14.112 [Binder_2] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Device Info!
08:48:14.112 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:48:14.113 [Binder_2] DEBUG n.f.g.s.d.m.MiBandSupport - Writing User Info!
08:48:14.113 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Attempting to set wear location...
08:48:14.113 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Unable to set Wear Location
08:48:14.113 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Attempting to set Fitness Goal...
08:48:14.113 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Unable to set Fitness Goal
08:48:14.114 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:48:14.114 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:48:14.114 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:48:14.114 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:48:14.115 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Sending current time to Mi Band: July 12 (12 Jul 2016 06:48:14 GMT)
08:48:14.116 [Binder_2] INFO  n.f.g.s.d.m.MiBandSupport - Unable to set time -- characteristic not available
08:48:14.118 [Binder_2] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Battery Info!
08:48:14.118 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:48:14.118 [Binder_2] WARN  n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null
08:48:14.119 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - about to add: 8:48:14 AM: Transaction task: Initializing device with 7 actions
08:48:14.120 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:48 AM: SetDeviceStateAction to INITIALIZING
08:48:14.121 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:48 AM: ReadAction on characteristic: 00002a00-0000-1000-8000-00805f9b34fb
08:48:14.121 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:14.125 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:14.155 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:14.160 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:14.456 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - characteristic read: 00002a00-0000-1000-8000-00805f9b34fb (success)
08:48:14.458 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:48 AM:  on characteristic: (null)
08:48:14.459 [GadgetBridge GATT Dispatcher] ERROR n.f.g.s.b.BtLEQueue - Queue Dispatch Thread died: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference
    at nodomain.freeyourgadget.gadgetbridge.devices.miband.UserInfo.getData(UserInfo.java:88) ~[na:0.0]
    at nodomain.freeyourgadget.gadgetbridge.service.devices.miband.MiBandSupport$1.run(MiBandSupport.java:267) ~[na:0.0]
    at nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue$1.run(BtLEQueue.java:88) ~[na:0.0]
08:48:14.460 [GadgetBridge GATT Dispatcher] INFO  n.f.g.s.b.BtLEQueue - Queue Dispatch Thread terminated.
08:48:44.497 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 0 (failed: 19)
08:48:44.500 [Binder_2] WARN  n.f.g.s.b.BtLEQueue - connection state event with error status 19
08:48:44.501 [Binder_2] INFO  n.f.g.s.b.BtLEQueue - Disconnected from GATT server.
08:48:44.523 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - handleDisconnected: 19
08:48:44.524 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - internal gatt callback set to null
08:48:44.541 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED
08:48:44.542 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - disconnect()
08:48:44.544 [Binder_2] INFO  n.f.g.s.b.BtLEQueue - Disconnecting BtLEQueue from GATT device
08:48:44.552 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED
08:48:44.572 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:44.575 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:44.593 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:44.599 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:47.309 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:47.333 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.start
08:48:47.335 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.request_deviceinfo
08:48:47.373 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:47.392 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:48.854 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect
08:48:48.855 [main] DEBUG n.f.g.s.b.BtLEQueue - disconnect()
08:48:48.858 [main] INFO  n.f.g.s.b.BtLEQueue - Attempting to connect to MI Band 2
08:48:48.861 [main] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTING
08:48:48.861 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:48.862 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - Queue Dispatch Thread started.
08:48:48.884 [main] WARN  n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F
08:48:49.169 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 2 (success)
08:48:49.171 [Binder_1] INFO  n.f.g.s.b.BtLEQueue - Connected to GATT server.
08:48:49.172 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTED
08:48:49.172 [main] INFO  n.f.g.e.BluetoothConnectReceiver - got connection attempt
08:48:49.175 [Binder_1] INFO  n.f.g.s.b.BtLEQueue - Attempting to start service discovery:true
08:48:49.180 [Binder_3] WARN  n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null
08:48:49.181 [Binder_3] WARN  n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null
08:48:49.181 [Binder_3] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:48:49.181 [Binder_3] INFO  n.f.g.s.d.m.MiBandSupport - Attempting to pair MI device...
08:48:49.180 [main] INFO  n.f.g.e.BluetoothConnectReceiver - won't connect to DA:55:B3:07:50:6F(MI Band 2)
08:48:49.182 [Binder_3] INFO  n.f.g.s.d.m.MiBandSupport - Unable to pair MI device -- characteristic not available
08:48:49.182 [main] INFO  n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
08:48:49.182 [Binder_3] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Device Info!
08:48:49.183 [Binder_3] WARN  n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null
08:48:49.183 [Binder_3] DEBUG n.f.g.s.d.m.MiBandSupport - Writing User Info!
Hi, just got my mibadn 2. Latest version from fdroid: ``` 08:47:07.128 [main] INFO n.f.g.Logging - Gadgetbridge version: 0.11.1 08:47:07.251 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:47:07.295 [main] DEBUG n.f.g.s.DeviceCommunicationService - DeviceCommunicationService is being created 08:47:07.295 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.start 08:47:07.304 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.request_deviceinfo 08:47:10.220 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect 08:47:10.227 [main] INFO n.f.g.s.b.BtLEQueue - Attempting to connect to MI Band 2 08:47:10.228 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - Queue Dispatch Thread started. 08:47:10.239 [main] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTING 08:47:10.265 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:47:10.274 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:47:10.795 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 2 (success) 08:47:10.796 [Binder_1] INFO n.f.g.s.b.BtLEQueue - Connected to GATT server. 08:47:10.797 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTED 08:47:10.800 [main] INFO n.f.g.e.BluetoothConnectReceiver - got connection attempt 08:47:10.814 [Binder_1] INFO n.f.g.s.b.BtLEQueue - Attempting to start service discovery:true 08:47:10.817 [main] INFO n.f.g.e.BluetoothConnectReceiver - won't connect to DA:55:B3:07:50:6F(MI Band 2) 08:47:10.834 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:47:10.839 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:47:10.840 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:47:10.840 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null 08:47:10.841 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:47:10.841 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Attempting to pair MI device... 08:47:10.841 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Unable to pair MI device -- characteristic not available 08:47:10.841 [Binder_1] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Device Info! 08:47:10.842 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:47:10.862 [Binder_1] DEBUG n.f.g.s.d.m.MiBandSupport - Writing User Info! 08:47:10.862 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Attempting to set wear location... 08:47:10.863 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Unable to set Wear Location 08:47:10.863 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Attempting to set Fitness Goal... 08:47:10.864 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Unable to set Fitness Goal 08:47:10.864 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:47:10.865 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:47:10.865 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:47:10.865 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:47:10.874 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Sending current time to Mi Band: July 12 (12 Jul 2016 06:47:10 GMT) 08:47:10.875 [Binder_1] INFO n.f.g.s.d.m.MiBandSupport - Unable to set time -- characteristic not available 08:47:10.875 [Binder_1] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Battery Info! 08:47:10.875 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:47:10.876 [Binder_1] WARN n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null 08:47:10.876 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - about to add: 8:47:10 AM: Transaction task: Initializing device with 7 actions 08:47:10.885 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:47 AM: SetDeviceStateAction to INITIALIZING 08:47:10.889 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:47 AM: ReadAction on characteristic: 00002a00-0000-1000-8000-00805f9b34fb 08:47:10.893 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:47:10.896 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:47:11.179 [Binder_3] DEBUG n.f.g.s.b.BtLEQueue - characteristic read: 00002a00-0000-1000-8000-00805f9b34fb (success) 08:47:11.180 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:47 AM: on characteristic: (null) 08:47:11.182 [GadgetBridge GATT Dispatcher] ERROR n.f.g.s.b.BtLEQueue - Queue Dispatch Thread died: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference java.lang.NullPointerException: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference at nodomain.freeyourgadget.gadgetbridge.devices.miband.UserInfo.getData(UserInfo.java:88) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.devices.miband.MiBandSupport$1.run(MiBandSupport.java:267) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue$1.run(BtLEQueue.java:88) ~[na:0.0] 08:47:11.182 [GadgetBridge GATT Dispatcher] INFO n.f.g.s.b.BtLEQueue - Queue Dispatch Thread terminated. 08:47:41.265 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 0 (failed: 19) 08:47:41.265 [Binder_1] WARN n.f.g.s.b.BtLEQueue - connection state event with error status 19 08:47:41.265 [Binder_1] INFO n.f.g.s.b.BtLEQueue - Disconnected from GATT server. 08:47:41.266 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - handleDisconnected: 19 08:47:41.266 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - internal gatt callback set to null 08:47:41.266 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED 08:47:41.272 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - disconnect() 08:47:41.275 [Binder_1] INFO n.f.g.s.b.BtLEQueue - Disconnecting BtLEQueue from GATT device 08:47:41.295 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:47:41.295 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED 08:47:41.303 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:47:41.313 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:47:41.317 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:03.451 [main] INFO n.f.g.e.AlarmReceiver - won't send sunrise and sunset events (disabled in preferences) 08:48:10.882 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect 08:48:10.889 [main] DEBUG n.f.g.s.b.BtLEQueue - disconnect() 08:48:10.893 [main] INFO n.f.g.s.b.BtLEQueue - Attempting to connect to MI Band 2 08:48:10.894 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - Queue Dispatch Thread started. 08:48:10.904 [main] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTING 08:48:10.918 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:10.923 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:14.072 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 2 (success) 08:48:14.073 [Binder_2] INFO n.f.g.s.b.BtLEQueue - Connected to GATT server. 08:48:14.074 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTED 08:48:14.079 [main] INFO n.f.g.e.BluetoothConnectReceiver - got connection attempt 08:48:14.086 [Binder_2] INFO n.f.g.s.b.BtLEQueue - Attempting to start service discovery:true 08:48:14.100 [main] INFO n.f.g.e.BluetoothConnectReceiver - won't connect to DA:55:B3:07:50:6F(MI Band 2) 08:48:14.109 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:48:14.109 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null 08:48:14.109 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:48:14.112 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Attempting to pair MI device... 08:48:14.112 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Unable to pair MI device -- characteristic not available 08:48:14.112 [Binder_2] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Device Info! 08:48:14.112 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:48:14.113 [Binder_2] DEBUG n.f.g.s.d.m.MiBandSupport - Writing User Info! 08:48:14.113 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Attempting to set wear location... 08:48:14.113 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Unable to set Wear Location 08:48:14.113 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Attempting to set Fitness Goal... 08:48:14.113 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Unable to set Fitness Goal 08:48:14.114 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:48:14.114 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:48:14.114 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:48:14.114 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:48:14.115 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Sending current time to Mi Band: July 12 (12 Jul 2016 06:48:14 GMT) 08:48:14.116 [Binder_2] INFO n.f.g.s.d.m.MiBandSupport - Unable to set time -- characteristic not available 08:48:14.118 [Binder_2] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Battery Info! 08:48:14.118 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:48:14.118 [Binder_2] WARN n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null 08:48:14.119 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - about to add: 8:48:14 AM: Transaction task: Initializing device with 7 actions 08:48:14.120 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:48 AM: SetDeviceStateAction to INITIALIZING 08:48:14.121 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:48 AM: ReadAction on characteristic: 00002a00-0000-1000-8000-00805f9b34fb 08:48:14.121 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:14.125 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:14.155 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:14.160 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:14.456 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - characteristic read: 00002a00-0000-1000-8000-00805f9b34fb (success) 08:48:14.458 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - About to run action: July 12, 8:48 AM: on characteristic: (null) 08:48:14.459 [GadgetBridge GATT Dispatcher] ERROR n.f.g.s.b.BtLEQueue - Queue Dispatch Thread died: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference java.lang.NullPointerException: Attempt to invoke virtual method 'boolean nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo.isMili1()' on a null object reference at nodomain.freeyourgadget.gadgetbridge.devices.miband.UserInfo.getData(UserInfo.java:88) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.devices.miband.MiBandSupport$1.run(MiBandSupport.java:267) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue$1.run(BtLEQueue.java:88) ~[na:0.0] 08:48:14.460 [GadgetBridge GATT Dispatcher] INFO n.f.g.s.b.BtLEQueue - Queue Dispatch Thread terminated. 08:48:44.497 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 0 (failed: 19) 08:48:44.500 [Binder_2] WARN n.f.g.s.b.BtLEQueue - connection state event with error status 19 08:48:44.501 [Binder_2] INFO n.f.g.s.b.BtLEQueue - Disconnected from GATT server. 08:48:44.523 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - handleDisconnected: 19 08:48:44.524 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - internal gatt callback set to null 08:48:44.541 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED 08:48:44.542 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - disconnect() 08:48:44.544 [Binder_2] INFO n.f.g.s.b.BtLEQueue - Disconnecting BtLEQueue from GATT device 08:48:44.552 [Binder_2] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: NOT_CONNECTED 08:48:44.572 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:44.575 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:44.593 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:44.599 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:47.309 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:47.333 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.start 08:48:47.335 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.request_deviceinfo 08:48:47.373 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:47.392 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:48.854 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect 08:48:48.855 [main] DEBUG n.f.g.s.b.BtLEQueue - disconnect() 08:48:48.858 [main] INFO n.f.g.s.b.BtLEQueue - Attempting to connect to MI Band 2 08:48:48.861 [main] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTING 08:48:48.861 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:48.862 [GadgetBridge GATT Dispatcher] DEBUG n.f.g.s.b.BtLEQueue - Queue Dispatch Thread started. 08:48:48.884 [main] WARN n.f.g.i.GBDeviceCandidate - no cached services available for MI Band 2: DA:55:B3:07:50:6F 08:48:49.169 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - connection state change, newState: 2 (success) 08:48:49.171 [Binder_1] INFO n.f.g.s.b.BtLEQueue - Connected to GATT server. 08:48:49.172 [Binder_1] DEBUG n.f.g.s.b.BtLEQueue - new device connection state: CONNECTED 08:48:49.172 [main] INFO n.f.g.e.BluetoothConnectReceiver - got connection attempt 08:48:49.175 [Binder_1] INFO n.f.g.s.b.BtLEQueue - Attempting to start service discovery:true 08:48:49.180 [Binder_3] WARN n.f.g.s.b.TransactionBuilder - Unable to notify characteristic: null 08:48:49.181 [Binder_3] WARN n.f.g.s.b.TransactionBuilder - Unable to write characteristic: null 08:48:49.181 [Binder_3] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:48:49.181 [Binder_3] INFO n.f.g.s.d.m.MiBandSupport - Attempting to pair MI device... 08:48:49.180 [main] INFO n.f.g.e.BluetoothConnectReceiver - won't connect to DA:55:B3:07:50:6F(MI Band 2) 08:48:49.182 [Binder_3] INFO n.f.g.s.d.m.MiBandSupport - Unable to pair MI device -- characteristic not available 08:48:49.182 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 08:48:49.182 [Binder_3] DEBUG n.f.g.s.d.m.MiBandSupport - Requesting Device Info! 08:48:49.183 [Binder_3] WARN n.f.g.s.b.TransactionBuilder - Unable to read characteristic: null 08:48:49.183 [Binder_3] DEBUG n.f.g.s.d.m.MiBandSupport - Writing User Info! ```
Poster
Owner

Now that #349 is fixed, I'd like to get Mi Band 2 working. Without having a device, I could need some help :-) If anyone of you can build Gadgetbridge yourself so we can try things out without the whole release -> f-droid -> install cycle, we will probably get something done, quickly.

At the moment we fail because we're expecting to get some services/characteristics that are not available.

Very helpful would be a

  • a list of all its ble services and characteristics (the screenshots from @Bahjesaispas only show parts of it)
  • Mi Fit logfile
  • a Mi Fit btsnoop log of the connection process
Now that #349 is fixed, I'd like to get Mi Band 2 working. Without having a device, I could need some help :-) If anyone of you can build Gadgetbridge yourself so we can try things out without the whole release -> f-droid -> install cycle, we will probably get something done, quickly. At the moment we fail because we're expecting to get some services/characteristics that are not available. Very helpful would be a - a list of all its ble services and characteristics (the screenshots from @Bahjesaispas only show parts of it) - Mi Fit logfile - a Mi Fit btsnoop log of the connection process
sir-harlekin commented 5 years ago (Migrated from github.com)
Owner

i will provide BLE screenshots tomorrow.
where can i find the mi fit logfile? (will look for myself tomorrow, maybe an answer is not needed)

i will provide BLE screenshots tomorrow. where can i find the mi fit logfile? (will look for myself tomorrow, maybe an answer is not needed)
Poster
Owner

It could be available as /sdcard/mili_log.txt. Not sure if it is created in all cases or if it has to be enabled in the app.

It could be available as /sdcard/mili_log.txt. Not sure if it is created in all cases or if it has to be enabled in the app.
sir-harlekin commented 5 years ago (Migrated from github.com)
Owner

Log file (4 mb, up from the first start of the app) attached!
mili_log_20160715222608.zip

Log file (4 mb, up from the first start of the app) attached! [mili_log_20160715222608.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/366801/mili_log_20160715222608.zip)
sir-harlekin commented 5 years ago (Migrated from github.com)
Owner

All screenshots i could take from BLE explorer (may contain slight
BLE.zip
duplicates)

All screenshots i could take from BLE explorer (may contain slight [BLE.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/366828/BLE.zip) duplicates)
Poster
Owner

Awesome, thanks!

Awesome, thanks!
Poster
Owner

From a quick look, it seems as they changed a lot. The current Mi Band 1 support will not work with it. Maybe we can reuse some code of it, but it basically looks like a completely new device that needs to be understood.

From a quick look, it seems as they changed a lot. The current Mi Band 1 support will not work with it. Maybe we can reuse some code of it, but it basically looks like a completely new device that needs to be understood.
sir-harlekin commented 5 years ago (Migrated from github.com)
Owner

Can i provide something else to support? I have slight problems to understand, what sniffing BT data means or how to accomplish that with the knowledge of an 'average' user.

I also would try self build versions, but again...at most i am an above average windows user...

Can i provide something else to support? I have slight problems to understand, what sniffing BT data means or how to accomplish that with the knowledge of an 'average' user. I also would try self build versions, but again...at most i am an above average windows user...
Poster
Owner

I will document how to capture a btsnoop log in the wiki, but for short, go to Android Settings -> Developer Options -> Enable Btsnoop (Bluetooth Capture). Then perform a connect with MiFit and disable Btsnoop (so that the only contains the connection information). You will get a btsnoop_hci.log in your /sdcard/ directory.

Thanks!

I will document how to capture a btsnoop log in the wiki, but for short, go to Android Settings -> Developer Options -> Enable Btsnoop (Bluetooth Capture). Then perform a connect with MiFit and disable Btsnoop (so that the only contains the connection information). You will get a btsnoop_hci.log in your /sdcard/ directory. Thanks!
sir-harlekin commented 5 years ago (Migrated from github.com)
Owner

So here is what i got. I am not sure, if i have done this the right way, because it looks a lot like gibberish to me. Please check and come back if i should try again.

btsnoop_hci.zip

So here is what i got. I am not sure, if i have done this the right way, because it looks a lot like gibberish to me. Please check and come back if i should try again. [btsnoop_hci.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/367188/btsnoop_hci.zip)
santalaus commented 5 years ago (Migrated from github.com)
Owner

Hey Carsten,
would it help if you get one Device? I have one left here and you were also an German Guy so sending would be easy. Maybe the other Guys were interested in getting support and we could have something line croudfoundig an device for you. To make it quick I would send it directly. How were Interestes to send me some Bucks could send me an private message. The device cost me right now 45€ I think we need 5€ to send it to you.
Best regards.
Nico

Hey Carsten, would it help if you get one Device? I have one left here and you were also an German Guy so sending would be easy. Maybe the other Guys were interested in getting support and we could have something line croudfoundig an device for you. To make it quick I would send it directly. How were Interestes to send me some Bucks could send me an private message. The device cost me right now 45€ I think we need 5€ to send it to you. Best regards. Nico
Poster
Owner

@sir-harlekin Yes, it looks like gibberish, but that's fine :-)
You (I) have to decode it with
hcidump -axt -r btsnoop_hci.log
Then it still looks like gibberish, but a lot less :-)

Thanks a lot, I will try to make some sense out of it.

@sir-harlekin Yes, it looks like gibberish, but that's fine :-) You (I) have to decode it with `hcidump -axt -r btsnoop_hci.log` Then it still looks like gibberish, but a lot less :-) Thanks a lot, I will try to make some sense out of it.
Poster
Owner

@santalaus Yes, that would certainly speed things up :-) In case you're near or in Berlin, we could spare the shipping costs and I could also return it quickly in case you need it again.

@santalaus Yes, that would certainly speed things up :-) In case you're near or in Berlin, we could spare the shipping costs and I could also return it quickly in case you need it again.
santalaus commented 5 years ago (Migrated from github.com)
Owner

@cpfeiffer sorry, I live near Dortmund and in the next time my way did not came to Berlin. So shipping could be useful. Offer is there.
Best Regards Nico

@cpfeiffer sorry, I live near Dortmund and in the next time my way did not came to Berlin. So shipping could be useful. Offer is there. Best Regards Nico
sir-harlekin commented 5 years ago (Migrated from github.com)
Owner

If i can help in any way give me a beep. Btw: I live exactly in the middle between B and DO :-)

If i can help in any way give me a beep. Btw: I live exactly in the middle between B and DO :-)
Poster
Owner

@santalaus I can give you my address, and I can send it back to you as soon as you need it. If it breaks, I wouldn't order another, though. I have 6 Mi Bands (1, 1A, 1S) and so far,

  • one has a somewhat bad vibration motor (since when I received it)
  • one does not record any activity anymore (live activity still works) and firmware upgrade does not work anymore
  • one sporadically does not record activity, but most of the time does
  • one does record activity data, but only a few hours of data are good, the rest is bogus

Exactly two out of 6 are still working as they should. I kept all of them dry, they didn't fall down or anything. So it seems to me that the quality of the memory of Mi Band 1 models is really bad.

Maybe the Mi Band 2 is better quality-wise, but I cannot guarantee anything.

@santalaus I can give you my address, and I can send it back to you as soon as you need it. If it breaks, I wouldn't order another, though. I have 6 Mi Bands (1, 1A, 1S) and so far, - one has a somewhat bad vibration motor (since when I received it) - one does not record any activity anymore (live activity still works) and firmware upgrade does not work anymore - one sporadically does not record activity, but most of the time does - one does record activity data, but only a few hours of data are good, the rest is bogus Exactly two out of 6 are still working as they should. I kept all of them dry, they didn't fall down or anything. So it seems to me that the quality of the memory of Mi Band 1 models is really bad. Maybe the Mi Band 2 is better quality-wise, but I cannot guarantee anything.
santalaus commented 5 years ago (Migrated from github.com)
Owner

Hello,
I have got 2 Mi Band 2 one used with original SW and one unused. So no problem ;)
The offer sendeing it to you is my intention to get support for it, you could have it.

Maybe the other guys want to share the costs with me, but if I get your address (I have now some problems with internet access), I would send it to you so you could have it as Thank you for developing..

Hello, I have got 2 Mi Band 2 one used with original SW and one unused. So no problem ;) The offer sendeing it to you is my intention to get support for it, you could have it. Maybe the other guys want to share the costs with me, but if I get your address (I have now some problems with internet access), I would send it to you so you could have it as Thank you for developing..
Poster
Owner

Alright, send me a mail to carsten@freeyourgadget.org, then I will give you my postal address. Or if you have a jabber ID, we could use that as well. Looking forward to Mi 2 support :-)

Note, I don't mind if you send the used or unused one.

Alright, send me a mail to carsten@freeyourgadget.org, then I will give you my postal address. Or if you have a jabber ID, we could use that as well. Looking forward to Mi 2 support :-) Note, I don't mind if you send the used or unused one.
santalaus commented 5 years ago (Migrated from github.com)
Owner

You should have mail.

You should have mail.
Poster
Owner

Got it, thanks :-)

Got it, thanks :-)
sir-harlekin commented 5 years ago (Migrated from github.com)
Owner

Can we further assists on Mi Band 2 compatibility?

Can we further assists on Mi Band 2 compatibility?
santalaus commented 5 years ago (Migrated from github.com)
Owner

Post Delivery were successful, Now give him some time. He wrote me, that the Band 2 were completly different from 1
(I tought all the time the Devs allready have an Band 2 this one lay here for weeks....)

Post Delivery were successful, Now give him some time. He wrote me, that the Band 2 were completly different from 1 (I tought all the time the Devs allready have an Band 2 this one lay here for weeks....)
martin-v commented 5 years ago (Migrated from github.com)
Owner

Hi @cpfeiffer, can I help you with this issue? Tomorrow will probably my new Mi Band 2 arrive, then can I help you to test or write some code ...

Hi @cpfeiffer, can I help you with this issue? Tomorrow will probably my new Mi Band 2 arrive, then can I help you to test or write some code ...
Poster
Owner

@martin-v sure, all help is appreciated. Our current state and findings are:

  • all activity happens in the master branch
  • Mi Band 2 is a very different beast than Mi Band 1x, it is actually more standards compliant AFAICS
  • due to that, we started to implement the standard ble services/profiles in a device independent way
  • for a start, we have device information and battery
  • we need support for the current the time service in order to send the current time to the band
  • see https://www.bluetooth.com/specifications/adopted-specifications (CTS)
  • the important classes for devices are the DeviceSupport classes, in this case MiBandSupport (for Mi Band1) and MiBand2Support. This is just for testing, so for now, you will need to change the single constructor invocation of MiBandSupport to instantiate MiBand2Support instead
  • then you will be able to connect and get some device information (hw revision) from it
  • the device will close the connection after a few seconds because we do not act as expected
  • we need to find out, what to send to the band after getting device information. current time for sure, but from our experience with Mi Band 1, we will probably need to send some user information to the band (alias, height, weight, age, ...), see class UserInfo, but we don't know how it's done with Mi Band 2

If you know how to read Mi Fit logs/bluetooth snoops, e.g. with hcidump or wireshark, maybe you can find out what to send to the band. Note, the the GB logfile (or Android Monitor in Android Studio) will have helpful information, like the discovered, services, characteristics, etc.

Let me know if I can assist anywhere.

@martin-v sure, all help is appreciated. Our current state and findings are: - all activity happens in the master branch - Mi Band 2 is a very different beast than Mi Band 1x, it is actually more standards compliant AFAICS - due to that, we started to implement the standard ble services/profiles in a device independent way - for a start, we have device information and battery - **we need support for the current the time service** in order to send the current time to the band - see https://www.bluetooth.com/specifications/adopted-specifications (CTS) - the important classes for devices are the DeviceSupport classes, in this case `MiBandSupport` (for Mi Band1) and `MiBand2Support`. This is just for testing, so for now, you will need to change the single constructor invocation of `MiBandSupport` to instantiate `MiBand2Support` instead - then you will be able to connect and get some device information (hw revision) from it - the device will close the connection after a few seconds because we do not act as expected - we need to find out, what to send to the band after getting device information. current time for sure, but from our experience with Mi Band 1, we will probably need to send some user information to the band (alias, height, weight, age, ...), see class UserInfo, but we don't know how it's done with Mi Band 2 If you know how to read Mi Fit logs/bluetooth snoops, e.g. with hcidump or wireshark, maybe you can find out what to send to the band. Note, the the GB logfile (or Android Monitor in Android Studio) will have helpful information, like the discovered, services, characteristics, etc. Let me know if I can assist anywhere.
martin-v commented 5 years ago (Migrated from github.com)
Owner

Thanks for the information's, I have the same status now, I can connect, but the connection is closed after a few seconds. I will try implement the current the time service, but I think I need some time to understand the Code base and the Bluetooth Specs.

Thanks for the information's, I have the same status now, I can connect, but the connection is closed after a few seconds. I will try implement the current the time service, but I think I need some time to understand the Code base and the Bluetooth Specs.
diimdeep commented 5 years ago (Migrated from github.com)
Owner

Hello I have mi band2 might try to help with it, and I have another device bong3hr.

Hello I have mi band2 might try to help with it, and I have another device bong3hr.
Poster
Owner

Sorry for the late response -- we had to temporarily close the issue tracker because we were overloaded with requests and discussions and thus couldn't complete the big db changes.

Thanks to @JohnnySun, we now have a much better undestanding of Mi Band 2 and even some working code. We have a stable connection, and we can change the time of the band. Heart rate readings and notifications are probably easy. Firmware updates and activity data reading is probably harder.

All help and support is appreciated :-)

Sorry for the late response -- we had to temporarily close the issue tracker because we were overloaded with requests and discussions and thus couldn't complete the big db changes. Thanks to @JohnnySun, we now have a much better undestanding of Mi Band 2 and even some working code. We have a stable connection, and we can change the time of the band. Heart rate readings and notifications are probably easy. Firmware updates and activity data reading is probably harder. All help and support is appreciated :-)
Poster
Owner

So next steps are implementing more standard ble services (heart rate profile, alert notification profile).

So next steps are implementing more standard ble services (heart rate profile, alert notification profile).
Almtesh commented 5 years ago (Migrated from github.com)
Owner

Hi,
I installed the 0.12.2 version from F-droid and the connection does not succed. Is it in the next version?

Hi, I installed the 0.12.2 version from F-droid and the connection does not succed. Is it in the next version?
Poster
Owner

Yes, it will be on the next release.

Yes, it will be on the next release.
Almtesh commented 5 years ago (Migrated from github.com)
Owner

If you need testers, I can help you. Badly, I can't understand Java, so I can't help for dev, but I can test.

If you need testers, I can help you. Badly, I can't understand Java, so I can't help for dev, but I can test.
Owner

We have just tagged 0.13.0, which will be on f-droid soon and have the initial Mi Band 2 support (no activity, no heart rate, just notifications for now)

We have just tagged 0.13.0, which will be on f-droid soon and have the initial Mi Band 2 support (no activity, no heart rate, just notifications for now)
Almtesh commented 5 years ago (Migrated from github.com)
Owner

These missing features are low price for liberty, good luck for implementing the rest.

These missing features are low price for liberty, good luck for implementing the rest.
Owner

0.13.0 is out in f-droid now.

0.13.0 is out in f-droid now.
Almtesh commented 5 years ago (Migrated from github.com)
Owner

Yes, I updated it. There is only one type of notification for the moment?

Yes, I updated it. There is only one type of notification for the moment?
Poster
Owner

They use the same icon right now, but different vibration patterns.

They use the same icon right now, but different vibration patterns.
cafilho commented 5 years ago (Migrated from github.com)
Owner

Hi. My Mi Band 2 stopped working because I deleted my Mi Account without parring. Now it shows the "Band is paired by another person. Ask them to unpair it and try again" message.
I found the Gadgetbridge project when trying another method to use my band again (still no success).

...long story short...

I've bought a new Mi Band 2 and it will arrive at any time. I know that when I first pair to Mi Fit it will update it's firmware.
If it is of any help, I can Log Bluetooth, network, processes, etc and share the logs here. I just need some one to teach me how to do it. My phone is running Android 6.0 without root.

Hi. My Mi Band 2 stopped working because I deleted my Mi Account without parring. Now it shows the "Band is paired by another person. Ask them to unpair it and try again" message. I found the Gadgetbridge project when trying another method to use my band again (still no success). ...long story short... I've bought a new Mi Band 2 and it will arrive at any time. I know that when I first pair to Mi Fit it will update it's firmware. If it is of any help, I can Log Bluetooth, network, processes, etc and share the logs here. I just need some one to teach me how to do it. My phone is running Android 6.0 without root.
Poster
Owner

@Almtesh of you mean the icon on the band, then yes. You can configure different vibration patterns, though.

@Almtesh of you mean the icon on the band, then yes. You can configure different vibration patterns, though.
Poster
Owner

@cafilho So Gadgetbridge was unable to take over your band?

Before throwing the band away, you could try completely discharging the battery, e.g. by putting it into the freezer for a few days. Not sure if the display would like that, though, so maybe the fridge or just waiting for the discharge would be safer.

Yes, logs do help a lot. You can enable a BT snoop in android's development settings. Everything you do with Bluetooth afterwards will then be logged to a file btsnoop.log in /sdcard.

@cafilho So Gadgetbridge was unable to take over your band? Before throwing the band away, you could try completely discharging the battery, e.g. by putting it into the freezer for a few days. Not sure if the display would like that, though, so maybe the fridge or just waiting for the discharge would be safer. Yes, logs do help a lot. You can enable a BT snoop in android's development settings. Everything you do with Bluetooth afterwards will then be logged to a file btsnoop.log in /sdcard.
santalaus commented 5 years ago (Migrated from github.com)
Owner

Hello,
I'm on the latest Version from F-Droid, but sometimes (once a day, i think) the Band were disconnected. I have to reconnect it manual to get Messages again.
Did anyone also have this, or is it a Problem of my configuration?
Best regards
Nico

Hello, I'm on the latest Version from F-Droid, but sometimes (once a day, i think) the Band were disconnected. I have to reconnect it manual to get Messages again. Did anyone also have this, or is it a Problem of my configuration? Best regards Nico
Almtesh commented 5 years ago (Migrated from github.com)
Owner

Is the autoconnect setting set? Pearhaps your app is not set to autoconnect when disconnect happen.

Is the autoconnect setting set? Pearhaps your app is not set to autoconnect when disconnect happen.
santalaus commented 5 years ago (Migrated from github.com)
Owner

Autoconnect is on. Also connect when Bluetooth came up.

Autoconnect is on. Also connect when Bluetooth came up.
Poster
Owner

@santalaus Maybe the device initialization gets stuck somewhere... if you could provide a log when that happens, maybe we could find out what's happening.

@santalaus Maybe the device initialization gets stuck somewhere... if you could provide a log when that happens, maybe we could find out what's happening.
Poster
Owner

@JohnnySun Do you have some more information regarding the used services/characteristics? E.g for setting alarms, fetching activity data, etc.

@JohnnySun Do you have some more information regarding the used services/characteristics? E.g for setting alarms, fetching activity data, etc.
santalaus commented 5 years ago (Migrated from github.com)
Owner

@cpfeiffer BT-Log or Application Log? From my feeling this happens after an alarm. But till now I only see when this happend time ago. I could not reproduce it. I just klick ob MiBand2 and it reconects.

Have you seen the new feature in the MiBand Firmware? Changing Time Display to Time and Date.

@cpfeiffer BT-Log or Application Log? From my feeling this happens after an alarm. But till now I only see when this happend time ago. I could not reproduce it. I just klick ob MiBand2 and it reconects. Have you seen the new feature in the MiBand Firmware? Changing Time Display to Time and Date.
Poster
Owner

I meant an application log.

I meant an application log.
Poster
Owner

No, I didn't see the new firmware yet, I'm not running Mi Fit, even. Fell free to share some BT logs of specific things that we should implement. We lack hr reading, activity reading, setting alarms and fw update, for example.

No, I didn't see the new firmware yet, I'm not running Mi Fit, even. Fell free to share some BT logs of specific things that we should implement. We lack hr reading, activity reading, setting alarms and fw update, for example.
santalaus commented 5 years ago (Migrated from github.com)
Owner

FYI done an Update Gadgetbridge 0.13.3 and aktivated the Logfile.
MI Band FW: V1.0.0.39 HW: V0.1.3.2
Now not using Mi Fit anymore. So for BT logs I have to go back and have to read/learn how to do BT logs.

FYI done an Update Gadgetbridge 0.13.3 and aktivated the Logfile. MI Band FW: V1.0.0.39 HW: V0.1.3.2 Now not using Mi Fit anymore. So for BT logs I have to go back and have to read/learn how to do BT logs.
Poster
Owner

I added some info how to capture Bluetooth traffic to https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files

I added some info how to capture Bluetooth traffic to https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

I took the liberty to modify/add information to above wiki page – I hope that's OK.
I also got a Mi Band 2 now and I'm happy to see that support for it is already under development.
Sadly, my new Mi Band 2 almost never connects, even the initial pairing process almost always fails.
Strangely, after a failed pairing attempt my Mi Band 2 still shows on the main screen but I can't connect (the icon becomes blue, the state switches to "connecting" but it never finished/switch to "connected").

Here is a BT snoop log of the failing pairing process with Gadgetbridge:
btsnoop_hci-init_fail.log.zip

Here is a BT snoop log of the failing connecting process with Gadgetbridge:
btsnoop_hci-connect_fail.log.zip

The pairing process was successful only once (I have no idea why). After that, I could connect the paired device.

Here is a BT snoop log of the successful pairing process with Gadgetbridge:
btsnoop_hci-init.log.zip

Here is a BT snoop log of the successful connecting process with Gadgetbridge:
btsnoop_hci-connect.log.zip

I deleted the Mi Band 2 from Gadgetbridge after that again and since then I wasn't able to bond the Mi Band 2 again. I also tried on a different device with Xiaomi's Mi Fit app to provide some logs, but the app doesn't even find the Mi Band 2. Could that be because Gadgetbridge is not correctly unpairing the Mi Band 2 and so Xiaomi's Mi Fit app doesn't show the device at all (because it's still bonded with Gadgetbridge on my other device)?
I couldn't generate a Gadgedbridge log file due to #406.
I hope some of this might be helpful.

I took the liberty to modify/add information to above wiki page – I hope that's OK. I also got a Mi Band 2 now and I'm happy to see that support for it is already under development. Sadly, my new Mi Band 2 almost never connects, even the initial pairing process almost always fails. Strangely, after a failed pairing attempt my Mi Band 2 still shows on the main screen but I can't connect (the icon becomes blue, the state switches to "connecting" but it never finished/switch to "connected"). Here is a BT snoop log of the failing pairing process with Gadgetbridge: [btsnoop_hci-init_fail.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/518324/btsnoop_hci-init_fail.log.zip) Here is a BT snoop log of the failing connecting process with Gadgetbridge: [btsnoop_hci-connect_fail.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/518332/btsnoop_hci-connect_fail.log.zip) The pairing process was successful only once (I have no idea why). After that, I could connect the paired device. Here is a BT snoop log of the successful pairing process with Gadgetbridge: [btsnoop_hci-init.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/518333/btsnoop_hci-init.log.zip) Here is a BT snoop log of the successful connecting process with Gadgetbridge: [btsnoop_hci-connect.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/518334/btsnoop_hci-connect.log.zip) I deleted the Mi Band 2 from Gadgetbridge after that again and since then I wasn't able to bond the Mi Band 2 again. I also tried on a different device with Xiaomi's Mi Fit app to provide some logs, but the app doesn't even find the Mi Band 2. Could that be because Gadgetbridge is not correctly unpairing the Mi Band 2 and so Xiaomi's Mi Fit app doesn't show the device at all (because it's still bonded with Gadgetbridge on my other device)? I couldn't generate a Gadgedbridge log file due to #406. I hope some of this might be helpful.
Poster
Owner

Thanks for updating the wiki!

I only have a single Mi Band 2, and connecting works perfectly with my One Plus One. I'll test connection with another device. A gadgetbridge log would help a lot -- I hope we will find a way to make that work for you.

Note that discovering the device may take a little while, sometimes even multiple attempts.

Thanks for updating the wiki! I only have a single Mi Band 2, and connecting works perfectly with my One Plus One. I'll test connection with another device. A gadgetbridge log would help a lot -- I hope we will find a way to make that work for you. Note that discovering the device may take a little while, sometimes even multiple attempts.
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Discovering the device itself is never a problem – it always shows up in the list on the discovery screen as "Mi Band 2". But then selecting it to bond with it almost always fails (in fact, it only worked once).

Since Gadgetbridge's log feature is currently not working on my device, I have logged the following actions with logcat (see attached file at the bottom):

  • Trying to add the Mi Band 2 (by tapping the blue "+" button on the lower right corner in the control center/main screen and selecting the new device from the list on the discovery screen)
  • Aborting the action by going back to the control center/main screen (since step one never finishes)
  • Oddly, the new device still shows up in the control center/main screen, so I try to connect the device
  • deleting the device again (after connecting fails)

logcat log file:
catlog-failed_pairing_failed_connecting_delete_dev.log.zip

Discovering the device itself is never a problem – it always shows up in the list on the discovery screen as "Mi Band 2". But then selecting it to bond with it almost always fails (in fact, it only worked once). Since Gadgetbridge's log feature is currently not working on my device, I have logged the following actions with logcat (see attached file at the bottom): - Trying to add the Mi Band 2 (by tapping the blue "+" button on the lower right corner in the control center/main screen and selecting the new device from the list on the discovery screen) - Aborting the action by going back to the control center/main screen (since step one never finishes) - Oddly, the new device still shows up in the control center/main screen, so I try to connect the device - deleting the device again (after connecting fails) logcat log file: [catlog-failed_pairing_failed_connecting_delete_dev.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/518577/catlog-failed_pairing_failed_connecting_delete_dev.log.zip)
Poster
Owner

Interesting. It looks like the code for Mi Band 1 is used instead of the code for Mi Band 2. So no wonder it doesn't work. We need to fix something in the device detection, I suppose.

Interesting. It looks like the code for Mi Band 1 is used instead of the code for Mi Band 2. So no wonder it doesn't work. We need to fix something in the device detection, I suppose.
Poster
Owner

I have an idea. Please force-close Gadgetbridge and try connecting again. Make sure to not connect to your Mi Band 1 before!

I have an idea. Please force-close Gadgetbridge and try connecting again. Make sure to _not_ connect to your Mi Band 1 before!
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Great idea! This seems to fix it. I tried several times and each time it worked perfectly that way. Thanks!

Great idea! This seems to fix it. I tried several times and each time it worked perfectly that way. Thanks!
santalaus commented 5 years ago (Migrated from github.com)
Owner

Short response: Since the last update the connection seemed to be stable. So no App-Log from my side.
Second: I would try to find some time in the next Days to take the Bluetooth Logs. Could I make one big Log or is it better one action per log (If I could)?

Short response: Since the last update the connection seemed to be stable. So no App-Log from my side. Second: I would try to find some time in the next Days to take the Bluetooth Logs. Could I make one big Log or is it better one action per log (If I could)?
Poster
Owner

Great! Yes, definitely one log per action so that we can correlate the data to the expected actions.

Great! Yes, definitely one log per action so that we can correlate the data to the expected actions.
santalaus commented 5 years ago (Migrated from github.com)
Owner

btsnoop_hci.zip
Here some Work for your Weekend ;)
Timeformat -Display just Clock, Clock+Date
Displaysettings alloff allon Time(allwayson),Steps,Distance,Kalorien,Hartrate,Remaining Battery
HeartRateSleepAssistent off/on

I also have an Datasync but I would prefer NOT upload it here ;)

[btsnoop_hci.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/529481/btsnoop_hci.zip) Here some Work for your Weekend ;) Timeformat -Display just Clock, Clock+Date Displaysettings alloff allon Time(allwayson),Steps,Distance,Kalorien,Hartrate,Remaining Battery HeartRateSleepAssistent off/on I also have an Datasync but I would prefer NOT upload it here ;)
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Did you already pushed the latest release to F-Droid? Somehow I can't update nor find the newest version on the F-Droid website... Many thanks!

Did you already pushed the latest release to F-Droid? Somehow I can't update nor find the newest version on the F-Droid website... Many thanks!
Poster
Owner

I pushed the tag 4 days ago. That's indeed quite a long time.

I pushed the tag 4 days ago. That's indeed quite a long time.
Owner

Yes we did days ago.
F-droid wiki says they have the latest version. But they don't
https://f-droid.org/wiki/page/nodomain.freeyourgadget.gadgetbridge

Yes we did days ago. F-droid wiki says they have the latest version. But they don't https://f-droid.org/wiki/page/nodomain.freeyourgadget.gadgetbridge
santalaus commented 5 years ago (Migrated from github.com)
Owner

Sorry for the confussion. The latest from F-Droid

btsnoop_hci2.zip

Some more Bluetooth logs.

  • Display of Alarm Symbols everyone once triggert
  • donotdisburt set off/on of Donotdisburt Time (Dont know if there is Bluetooth Traffic)
  • MessureHeartrate Messuring of Heartrate
  • NotifyCall set on/off (non call triggert)

Hope this would help
My wish for an funktion would be: Alarm sleeping times and an Alarm Whitelist instead of Blacklist.
Also possibility of selection Icon / vibration per App.

Best regards

Sorry for the confussion. The latest from F-Droid [btsnoop_hci2.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/531164/btsnoop_hci2.zip) Some more Bluetooth logs. - Display of Alarm Symbols everyone once triggert - donotdisburt set off/on of Donotdisburt Time (Dont know if there is Bluetooth Traffic) - MessureHeartrate Messuring of Heartrate - NotifyCall set on/off (non call triggert) Hope this would help My wish for an funktion would be: Alarm sleeping times and an Alarm Whitelist instead of Blacklist. Also possibility of selection Icon / vibration per App. Best regards
cafilho commented 5 years ago (Migrated from github.com)
Owner

Hi!

As I promised, my new mi band arived and here is the log of first connection with mi fit and firmware update (and, probably, date/hour set).

I can produce more logs if requested.
btsnoop_hci(first conection and firmware update).zip

Hi! As I promised, my new mi band arived and here is the log of first connection with mi fit and firmware update (and, probably, date/hour set). I can produce more logs if requested. [btsnoop_hci(first conection and firmware update).zip](https://github.com/Freeyourgadget/Gadgetbridge/files/531243/btsnoop_hci.first.conection.and.firmware.update.zip)
Poster
Owner

Thanks a lot, guys. I didn't have time to check them this weekend, but will do so in the next days!

Thanks a lot, guys. I didn't have time to check them this weekend, but will do so in the next days!
FichteFoll commented 5 years ago (Migrated from github.com)
Owner

My Mi Band 2 arrived a few days ago and I was eager to try it out with GB but unfortunately I'm unable to pair. The device just never shows up and eventually my phone restarts after I click on the "+" to add a device. Do I need to do something with the device in order to pair it? I don't find any information about doing anything during the pairing process.

Later I installed the Mi Fit app but haven't created an account yet.

Not exactly sure how to proceed now, though. I could probably create some logs for the failed pairing attempts, if that helps? Otherwise I'll try to pair with the Mi Fit app (while logging).

I'm using a OnePlus One on COS13.1.2 FWIW.

My Mi Band 2 arrived a few days ago and I was eager to try it out with GB but unfortunately I'm unable to pair. The device just never shows up and eventually my phone restarts after I click on the "+" to add a device. Do I need to do something with the device in order to pair it? I don't find any information about doing anything during the pairing process. Later I installed the Mi Fit app but haven't created an account yet. Not exactly sure how to proceed now, though. I could probably create some logs for the failed pairing attempts, if that helps? Otherwise I'll try to pair with the Mi Fit app (while logging). I'm using a OnePlus One on COS13.1.2 FWIW.
Poster
Owner

Make sure that you have GPS enabled while scanning. This is unfortunately required on Marshmallow. You can safely disable it again afterwards.

Make sure that you have GPS enabled while scanning. This is unfortunately required on Marshmallow. You can safely disable it again afterwards.
Owner

Network location is enough

Network location is enough
FichteFoll commented 5 years ago (Migrated from github.com)
Owner

It was definitely (and still ie) enabled. Only GPS though, not this cellular and WiFi data thing.

It was definitely (and still ie) enabled. Only GPS though, not this cellular and WiFi data thing.
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Here are some more logs from the Mi Fit app.

Setting alarm to 10am:
btsnoop_hci-alarm_10am.log.zip

Measuring heart rate (57BPM):
btsnoop_hci-hr1_57bpm.log.zip

Measuring heart rate again (57BPM):
btsnoop_hci-hr2_57bpm.log.zip

Synchronizing activity data:
btsnoop_hci-sync1.log.zip

Synchronizing activity data again:
btsnoop_hci-sync2.log.zip

Synchronizing activity data again:
btsnoop_hci-sync3.log.zip

Here are some more logs from the Mi Fit app. Setting alarm to 10am: [btsnoop_hci-alarm_10am.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/533314/btsnoop_hci-alarm_10am.log.zip) Measuring heart rate (57BPM): [btsnoop_hci-hr1_57bpm.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/533315/btsnoop_hci-hr1_57bpm.log.zip) Measuring heart rate again (57BPM): [btsnoop_hci-hr2_57bpm.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/533316/btsnoop_hci-hr2_57bpm.log.zip) Synchronizing activity data: [btsnoop_hci-sync1.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/533318/btsnoop_hci-sync1.log.zip) Synchronizing activity data again: [btsnoop_hci-sync2.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/533319/btsnoop_hci-sync2.log.zip) Synchronizing activity data again: [btsnoop_hci-sync3.log.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/533321/btsnoop_hci-sync3.log.zip)
FichteFoll commented 5 years ago (Migrated from github.com)
Owner

I reported my scanning problem to a different issue: #412.

I reported my scanning problem to a different issue: #412.
FichteFoll commented 5 years ago (Migrated from github.com)
Owner

Initial pairing and immediately following firmware update with Mi Fit app:

btsnoop_hci_pair&update.zip

Initial pairing and immediately following firmware update with Mi Fit app: [btsnoop_hci_pair&update.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/533876/btsnoop_hci_pair.update.zip)
Poster
Owner

More logs, thanks :-)

More logs, thanks :-)
Poster
Owner

Short feedback: we needed to write a tool to make the logs readable/understandable/manageable. I had a quick look to implement support for alarms, but the first test wasn't immediately successful.

But progress is happening!

Short feedback: we needed to write a tool to make the logs readable/understandable/manageable. I had a quick look to implement support for alarms, but the first test wasn't immediately successful. But progress is happening!
Poster
Owner

Is there a "Reset Device" or "Reboot Deviice" function in Mi Fit? Min MI2 does not succeed in measuring heart rate anymore, not through Gadgetbridge, nor when pressing the band's button.

@JohnnySun any idea why this might happen or what to do? I'm still on fw 1.0.0.2.

Is there a "Reset Device" or "Reboot Deviice" function in Mi Fit? Min MI2 does not succeed in measuring heart rate anymore, not through Gadgetbridge, nor when pressing the band's button. @JohnnySun any idea why this might happen or what to do? I'm still on fw 1.0.0.2.
santalaus commented 5 years ago (Migrated from github.com)
Owner

I could not find anything like this.
Maybe with Fw Update but all off my Settings survifed an FW Update.
Best regards.

I could not find anything like this. Maybe with Fw Update but all off my Settings survifed an FW Update. Best regards.
cafilho commented 5 years ago (Migrated from github.com)
Owner

The only new thing I've found in the new firmware was the option to "rotate the wrist to switch info on Mi Band" (fw v1.0.0.53)

The only new thing I've found in the new firmware was the option to "rotate the wrist to switch info on Mi Band" (fw v1.0.0.53)
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Thanks @cpfeiffer, setting alarms on the Mi Band 2 works great with the new Gadgetbridge version, however turning them off again doesn't.

Also, in one of your last commits you remarked:

Smart alarms not supported yet.

The smart alarm feature seems to be officially discontinued – the new Mi Fit app doesn't have it anymore (at least I can't find it anymore and others reprted that problem too, see here and here).
The Mi Band Tools app still has it, and it's reported to work with some Mi Band 2s but on the device I tested it, it didn't work. So maybe Xiaomi also removed the feature from newer firmware...

Thanks @cpfeiffer, setting alarms on the Mi Band 2 works great with the new Gadgetbridge version, however turning them off again doesn't. Also, in [one of your last commits](https://github.com/Freeyourgadget/Gadgetbridge/commit/17b70a1b82a261ee9ab114c86d024419a4da5be5) you remarked: > Smart alarms not supported yet. The smart alarm feature seems to be officially discontinued – the new Mi Fit app doesn't have it anymore (at least I can't find it anymore and others reprted that problem too, see [here](http://en.miui.com/thread-267378-1-1.html) and [here](http://c.mi.com/sg/thread-2290-1-1.html)). The Mi Band Tools app still has it, and it's reported to work with some Mi Band 2s but on the device I tested it, it didn't work. So maybe Xiaomi also removed the feature from newer firmware...
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Oh, and about measuring the heart rate:
Measuring the heart rate on the device itself works (most of the time).
In Gadgetbridge, I can now initiate the measurement (the green light from the Mi Band 2's sensor starts to flicker and I get a toast notification about starting the process) but never get a toast about the measured value afterwards.

Oh, and about measuring the heart rate: Measuring the heart rate on the device itself works (most of the time). In Gadgetbridge, I can now initiate the measurement (the green light from the Mi Band 2's sensor starts to flicker and I get a toast notification about starting the process) but never get a toast about the measured value afterwards.
Poster
Owner

@6arms1leg thanks, will have a look at disabling alarms. If smart alarms are removed from the firmware, we can't support them, indeed. At the moment, I simply don't know what to send to the band in order to enable them (assuming they are still present in the firmware).

The hr measurements are not released yet, do you build yourself? You need de46555e37 for the toast. If that doesn't work, could you share a gadgetbridge log?

@6arms1leg thanks, will have a look at disabling alarms. If smart alarms are removed from the firmware, we can't support them, indeed. At the moment, I simply don't know what to send to the band in order to enable them (assuming they are still present in the firmware). The hr measurements are not released yet, do you build yourself? You need de46555e370cd86b90541e9b7406503e9d66a886 for the toast. If that doesn't work, could you share a gadgetbridge log?
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

@cpfeiffer, no I use the F-Droid release version. Sorry, my bad! I thought the heart rate feature was already included in the latest release...

@cpfeiffer, no I use the F-Droid release version. Sorry, my bad! I thought the heart rate feature was already included in the latest release...
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Short feedback, @cpfeiffer:
Disabling alarms and measuring heart rate (from the debug screen) work great now on the latest version of GB. As always, thanks!

Short feedback, @cpfeiffer: Disabling alarms and measuring heart rate (from the debug screen) work great now on the latest version of GB. As always, thanks!
Almtesh commented 5 years ago (Migrated from github.com)
Owner

I saw I could get the heart rate in debug mode.
Would that be possible to get this from another app (i.e. Termux). I'd like to monitor this with a script.
Thanks.

I saw I could get the heart rate in debug mode. Would that be possible to get this from another app (i.e. Termux). I'd like to monitor this with a script. Thanks.
Poster
Owner

This is probably not really possible at the moment. If you're root, you might turn on logging in Gadgetbridge and parse the logfile, but I wouldn't suggest doing that ;-)

Would you like to open a new issue for this?

This is probably not really possible at the moment. If you're root, you might turn on logging in Gadgetbridge and parse the logfile, but I wouldn't suggest doing that ;-) Would you like to open a new issue for this?
Almtesh commented 5 years ago (Migrated from github.com)
Owner

I openned #435 for that, I allready openned a issue to ask that, but it desapeared.

I openned #435 for that, I allready openned a issue to ask that, but it desapeared.
Poster
Owner

Thanks. Weird about the disappeared issue 🙃

Thanks. Weird about the disappeared issue :upside_down_face:
Poster
Owner

Just to report some progress: activity fetching is almost done. It's not pushed yet though, so it might not be part of the next release.

Just to report some progress: activity fetching is almost done. It's not pushed yet though, so it might not be part of the next release.
Almtesh commented 5 years ago (Migrated from github.com)
Owner

Nice!

Nice!
TSG9876 commented 5 years ago (Migrated from github.com)
Owner

Hi ,

I am not sure whether the heart rate measurement return value had been resolved or not for mi band 2 , I just share some log below , return value for mi band 2 is (0x) 00-64 as compared to mi pulse MI1S which is (0x)06-64 for example for 100bpm in hex code.

(00002902-0000-1000-8000-00805f9b34fb)
V 07:25:28.564 Reading descriptor 00002902-0000-1000-8000-00805f9b34fb
D 07:25:28.575 gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
I 07:25:28.650 Read Response received from descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 07:25:28.663 "Notifications enabled" received
V 07:25:29.527 Reading characteristic 00002a39-0000-1000-8000-00805f9b34fb
D 07:25:29.541 gatt.readCharacteristic(00002a39-0000-1000-8000-00805f9b34fb)
I 07:25:29.626 Read Response received from 00002a39-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 07:25:29.638 "(0x) 01-00" received
I 07:25:40.653 Notification received from 00002a37-0000-1000-8000-00805f9b34fb, value: (0x) 00-64
A 07:25:40.687 "Heart Rate Measurement: 100 bpm,
Sensor Contact Not Supported" received
V 07:25:45.810 Reading characteristic 00002a39-0000-1000-8000-00805f9b34fb
D 07:25:45.820 gatt.readCharacteristic(00002a39-0000-1000-8000-00805f9b34fb)

Hi , I am not sure whether the heart rate measurement return value had been resolved or not for mi band 2 , I just share some log below , return value for mi band 2 is (0x) 00-64 as compared to mi pulse MI1S which is (0x)06-64 for example for 100bpm in hex code. (00002902-0000-1000-8000-00805f9b34fb) V 07:25:28.564 Reading descriptor 00002902-0000-1000-8000-00805f9b34fb D 07:25:28.575 gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb) I 07:25:28.650 Read Response received from descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00 A 07:25:28.663 "Notifications enabled" received V 07:25:29.527 Reading characteristic 00002a39-0000-1000-8000-00805f9b34fb D 07:25:29.541 gatt.readCharacteristic(00002a39-0000-1000-8000-00805f9b34fb) I 07:25:29.626 Read Response received from 00002a39-0000-1000-8000-00805f9b34fb, value: (0x) 01-00 A 07:25:29.638 "(0x) 01-00" received **I 07:25:40.653 Notification received from 00002a37-0000-1000-8000-00805f9b34fb, value: (0x) 00-64** A 07:25:40.687 "Heart Rate Measurement: 100 bpm, Sensor Contact Not Supported" received V 07:25:45.810 Reading characteristic 00002a39-0000-1000-8000-00805f9b34fb D 07:25:45.820 gatt.readCharacteristic(00002a39-0000-1000-8000-00805f9b34fb)
Poster
Owner

@TSG9876 I'm not quite sure what you mean with this. Do you mean hr measurement does not work with Gadgetbridge? Or do you mean the value is wrong?

@TSG9876 I'm not quite sure what you mean with this. Do you mean hr measurement does not work with Gadgetbridge? Or do you mean the value is wrong?
TSG9876 commented 5 years ago (Migrated from github.com)
Owner

the log post is non other than just a simple display of the Mi Band 2 heart rate notification return value which take the form of hex code 00-XX as compared to the Mi Band pulse MI1S return hex code in the form as 06-XX as I noticed the heart rate feature seemed still in Alpha or Beta stage for Mi Band 2.

The Hex byte to trigger the heart rate measurement is still 0x15,1,1 for continuous or 0x15,2,1 for interval measurement reading.

the log post is non other than just a simple display of the Mi Band 2 heart rate notification return value which take the form of hex code 00-XX as compared to the Mi Band pulse MI1S return hex code in the form as 06-XX as I noticed the heart rate feature seemed still in Alpha or Beta stage for Mi Band 2. The Hex byte to trigger the heart rate measurement is still 0x15,1,1 for continuous or 0x15,2,1 for interval measurement reading.
Poster
Owner

Oh, thanks, I will try that. So far we only sort manual readings via the debug screen and "sleep assistant", i.e. automatic measurements whole sleeping.

The values we receive should be correct AFAICS.

Oh, thanks, I will try that. So far we only sort manual readings via the debug screen and "sleep assistant", i.e. automatic measurements whole sleeping. The values we receive should be correct AFAICS.
TSG9876 commented 5 years ago (Migrated from github.com)
Owner

Mi Band 1S or 2 Heart rate Notification is received back from UUID service 00002a37-0000-1000-8000-00805f9b34fb,

To trigger heart rate scanning on demand is done via gatt.write characteristic (00002902-0000-1000-8000-00805f9b34fb) with Hex code 0x15,1,1 for continuous or 0x15,2,1 periodic.

Mi Band 1S or 2 Heart rate Notification is received back from UUID service 00002a37-0000-1000-8000-00805f9b34fb, To trigger heart rate scanning on demand is done via gatt.write characteristic (00002902-0000-1000-8000-00805f9b34fb) with Hex code 0x15,1,1 for continuous or 0x15,2,1 periodic.
TSG9876 commented 5 years ago (Migrated from github.com)
Owner

I saw the amendment ,thanks

private void handleHeartrate(byte[] value) {

  •    if (value.length == 2 && value[0] == 6) { // this is for reading MiBand Pulse MI1S and was removed
    
  •    if (value.length == 2 && value[0] == 0) { // this is to cater for MiBand 2 .
           int hrValue = (value[1] & 0xff);
           int hrValue = (value[1] & 0xff);
           if (LOG.isDebugEnabled()) {
           if (LOG.isDebugEnabled()) {
               LOG.debug("heart rate: " + hrValue);
               LOG.debug("heart rate: " + hrValue);
           }
    

Just a note on the continuous heart rate measurement trigger by protocol 0x15,0x01,1, is there a noticeable decrease delay in the value feedback something like after almost 10 times of consistent less than 1second continuous heart beat feedback , delay for almost 5s before resume normally again with continuous feedback of 1 second repeating the same cyclical pattern through out the measurement ? This could may well be the Mi Band 2 inherent feature.

I saw the amendment ,thanks private void handleHeartrate(byte[] value) { - if (value.length == 2 && value[0] == 6) { // this is for reading MiBand Pulse MI1S and was removed + if (value.length == 2 && value[0] == 0) { // this is to cater for MiBand 2 . int hrValue = (value[1] & 0xff); int hrValue = (value[1] & 0xff); if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) { LOG.debug("heart rate: " + hrValue); LOG.debug("heart rate: " + hrValue); } Just a note on the continuous heart rate measurement trigger by protocol 0x15,0x01,1, is there a noticeable decrease delay in the value feedback something like after almost 10 times of consistent less than 1second continuous heart beat feedback , delay for almost 5s before resume normally again with continuous feedback of 1 second repeating the same cyclical pattern through out the measurement ? This could may well be the Mi Band 2 inherent feature.
Poster
Owner

I haven't really done many measurements with Mi Band 2 yet, so I cannot comment on that. I did notice that the band sends measurement results for quite a while even after telling it to stop measuring.

I haven't really done many measurements with Mi Band 2 yet, so I cannot comment on that. I did notice that the band sends measurement results for quite a while even after telling it to stop measuring.
Almtesh commented 5 years ago (Migrated from github.com)
Owner

I tested and it works well. I don't know if step count works, but I have different values on band and phone. I have 109 steps on GB and 966 on band.

I tested and it works well. I don't know if step count works, but I have different values on band and phone. I have 109 steps on GB and 966 on band.
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

@Almtesh: Yes, I also noticed a difference in the step count between GB and the Mi Band 2 itself with the same trend: The Mi Band 2 displays a higher value than GB.

@Almtesh: Yes, I also noticed a difference in the step count between GB and the Mi Band 2 itself with the same trend: The Mi Band 2 displays a higher value than GB.
Poster
Owner

Thanks for the feedback. The steps have been completely in sync for me, so I'm surprised about this. Will have another look.

Thanks for the feedback. The steps have been completely in sync for me, so I'm surprised about this. Will have another look.
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

I now checked the activity data with my Mi Band 2 (FW 1.0.0.19) on GB (v0.14.3) further and also noticed that no sleep data is displayed. The bar graphs show a gap (no bars at all) were the sleep should be. The pie chart indicates 0min of sleep.

I now checked the activity data with my Mi Band 2 (FW 1.0.0.19) on GB (v0.14.3) further and also noticed that no sleep data is displayed. The bar graphs show a gap (no bars at all) were the sleep should be. The pie chart indicates 0min of sleep.
Almtesh commented 5 years ago (Migrated from github.com)
Owner

@cpfeiffer Actually, I installed the update yesterday in the middle of afternoon, so the count starts at this moment, so that's normal it was wrong and it's not anymore.
@6arms1leg I don't have the gap like you, I just got heath rate graph like I want to have for all the day, but there's nothing in the pie chart, like you.

@cpfeiffer Actually, I installed the update yesterday in the middle of afternoon, so the count starts at this moment, so that's normal it was wrong and it's not anymore. @6arms1leg I don't have the gap like you, I just got heath rate graph like I want to have for all the day, but there's nothing in the pie chart, like you.
Almtesh commented 5 years ago (Migrated from github.com)
Owner

@6arms1leg did you check the option to get more precise sleep data with heart rate sensors? I checked it, that's perhaps why I got something when I sleep.

@6arms1leg did you check the option to get more precise sleep data with heart rate sensors? I checked it, that's perhaps why I got something when I sleep.
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

@Almtesh, thanks for your answer.

[...] I installed the update yesterday in the middle of afternoon, so the count starts at this moment, so that's normal it was wrong and it's not anymore.

For me, the step count in GB and on the Mi Band 2 itself still differ, even after midnight (with the Mi Band 2 showing much higher values). 😿

[...] I just got heath rate graph [...]. [...] did you check the option to get more precise sleep data with heart rate sensors? I checked it, that's perhaps why I got something when I sleep.

Heart rate readings during sleep are also not shown at all, although the option "Use Heartrate Sensor to improve sleep" in the settings is checked. However, HR reading on the "Debug" screen seems to work (although I get a reading of 0bpm most of the time, but thats the same with HR readings on the Mi Band 2 itself – they also fail most of the time).

@Almtesh, thanks for your answer. > [...] I installed the update yesterday in the middle of afternoon, so the count starts at this moment, so that's normal it was wrong and it's not anymore. For me, the step count in GB and on the Mi Band 2 itself still differ, even after midnight (with the Mi Band 2 showing much higher values). :crying_cat_face: > [...] I just got heath rate graph [...]. [...] did you check the option to get more precise sleep data with heart rate sensors? I checked it, that's perhaps why I got something when I sleep. Heart rate readings during sleep are also not shown at all, although the option "Use Heartrate Sensor to improve sleep" in the settings is checked. However, HR reading on the "Debug" screen seems to work (although I get a reading of 0bpm most of the time, but thats the same with HR readings on the Mi Band 2 itself – they also fail most of the time).
Almtesh commented 5 years ago (Migrated from github.com)
Owner

@6arms1leg HR is not really efficient on this arm, try one of your five other. You perhaps have to much hairs between the sensor and your skin, since it's a optical sensor.

@6arms1leg HR is not really efficient on this arm, try one of your five other. You perhaps have to much hairs between the sensor and your skin, since it's a optical sensor.
Poster
Owner

Sleep detection is not available in 0.14.3. A first steep towards it will be in 0.14.4, due out soon.

Bit this is really work in progress, as I'm just guessing what the numbers might mean.

Sleep detection is not available in 0.14.3. A first steep towards it will be in 0.14.4, due out soon. Bit this is really work in progress, as I'm just guessing what the numbers might mean.
Poster
Owner

My hr sensor stopped working after a while as well, it always displayed some kind of "invalid measurement" sign on the band the value displayed in Gadgetbridge was 0.

This was fixed with a fw update.

The Mi1S models had the same issue by the way. Out of the box, hr measurement did not work at all. It only started working after a fw update.

My hr sensor stopped working after a while as well, it always displayed some kind of "invalid measurement" sign on the band the value displayed in Gadgetbridge was 0. This was fixed with a fw update. The Mi1S models had the same issue by the way. Out of the box, hr measurement did not work at all. It only started working after a fw update.
Poster
Owner

If someone wants to help implementing support for fw update, please yell. I can give some pointers but lack the time to do it myself right now.

If someone wants to help implementing support for fw update, please yell. I can give some pointers but lack the time to do it myself right now.
Poster
Owner

I guess it's time to close this issue, since we're pretty much beyond "initial support".

Activity detection and synchronization is work in progress, firmware update is requested at #427.

Please open separate issues for further things. Thanks for your support! ❤️

I guess it's time to close this issue, since we're pretty much beyond "initial support". Activity detection and synchronization is work in progress, firmware update is requested at #427. Please open separate issues for further things. Thanks for your support! :heart:
phoenix31121 commented 5 years ago (Migrated from github.com)
Owner

Hi, i was having problems connecting band 2 with gb on galaxy s5 6.0.1 mm. It would connect in bluetooth settings but wouldnt authenticate ie no vibration on device.
But i got hold of the older j5 running 5.0 and gb connected to the band without a hitch.
It seems that newer mm firmwares arent compatible with gb i guess?
I hope this info helps in any way.

Hi, i was having problems connecting band 2 with gb on galaxy s5 6.0.1 mm. It would connect in bluetooth settings but wouldnt authenticate ie no vibration on device. But i got hold of the older j5 running 5.0 and gb connected to the band without a hitch. It seems that newer mm firmwares arent compatible with gb i guess? I hope this info helps in any way.
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Hello @phoenix31121,

does connecting your Mi Band 2 to your S5 work with the Mi Fit app? Actually, I had the same problem with a friends S5 a few months back. But I couldn't even connect using the Mi Fit app (the Mi Band 2 wasn't paired with any other device), so I figured the issue wasn't GB-related...

BTW, although the issues are piling up I recommend opening a new issue for your reports/questions if you think it's GB-related. Posting to an old closed issue, your post will be easily forgotten/overlooked – a separate issue makes it easier to keep track of it.

Hello @phoenix31121, does connecting your Mi Band 2 to your S5 work with the Mi Fit app? Actually, I had the same problem with a friends S5 a few months back. But I couldn't even connect using the Mi Fit app (the Mi Band 2 wasn't paired with any other device), so I figured the issue wasn't GB-related... BTW, although the issues are piling up I recommend opening a new issue for your reports/questions if you think it's GB-related. Posting to an old closed issue, your post will be easily forgotten/overlooked – a separate issue makes it easier to keep track of it.
phoenix31121 commented 5 years ago (Migrated from github.com)
Owner

Hello @6arms1leg,
Yes the band works perfectly with the mi app. I needed gb to downgrade the firmware as the newer fw almost killed the heart rate sensor.
Im totally new to gadgetbridge and this fourm and i have no idea how to create a new issue.

Hello @6arms1leg, Yes the band works perfectly with the mi app. I needed gb to downgrade the firmware as the newer fw almost killed the heart rate sensor. Im totally new to gadgetbridge and this fourm and i have no idea how to create a new issue.
6arms1leg commented 5 years ago (Migrated from github.com)
Owner

Yes the band works perfectly with the mi app.

Then this might actually be GB-related. You should consider opening a separate issue (by clicking the green button labeled "New issue" in the top right corner of this page or any other issue page). Be prepared to attach a GB log file and/or a BT snoop file to your issue. More information on how to do this can be found in the wiki (it's quite easy).

Welcome to Gadgetbridge and GitHub, BTW!

> Yes the band works perfectly with the mi app. Then this might actually be GB-related. You should consider opening a separate issue (by clicking the green button labeled "New issue" in the top right corner of this page or any other issue page). Be prepared to attach a GB log file and/or a BT snoop file to your issue. More information on how to do this can be found in the [wiki](https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files) (it's quite easy). Welcome to Gadgetbridge and GitHub, BTW!
phoenix31121 commented 5 years ago (Migrated from github.com)
Owner

@6arms1leg thank you. i was on mobile the whole time so hadnt seen all the options on the page. i'll try to post the issue. actually im on it now.

@6arms1leg thank you. i was on mobile the whole time so hadnt seen all the options on the page. i'll try to post the issue. actually im on it now.
aytunch commented 2 years ago (Migrated from github.com)
Owner

@TSG9876 Hi,
you said years ago:)

V 07:25:28.564 Reading descriptor 00002902-0000-1000-8000-00805f9b34fb
D 07:25:28.575 gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
I 07:25:28.650 Read Response received from descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 07:25:28.663 "Notifications enabled" received....

and,

Mi Band 1S or 2 Heart rate Notification is received back from UUID service 00002a37-0000-1000-8000-00805f9b34fb,
To trigger heart rate scanning on demand is done via gatt.write characteristic (00002902-0000-1000-8000-00805f9b34fb) with Hex code 0x15,1,1 for continuous or 0x15,2,1 periodic.

You say we need to write 0x15,1,1 to 2902... which is the descriptor for HRM data(or control?). But in the code I can't see any descriptor:

@Override
    public void onEnableRealtimeHeartRateMeasurement(boolean enable) {
        if (characteristicHRControlPoint == null) {
            return;
        }
        try {
            TransactionBuilder builder = performInitialized("Enable realtime heart rate measurement");
            enableNotifyHeartRateMeasurements(enable, builder);
            if (enable) {
                builder.write(characteristicHRControlPoint, stopHeartMeasurementManual);
                builder.write(characteristicHRControlPoint, startHeartMeasurementContinuous);
            } else {
                builder.write(characteristicHRControlPoint, stopHeartMeasurementContinuous);
            }
            builder.queue(getQueue());
            enableRealtimeSamplesTimer(enable);
        } catch (IOException ex) {
            LOG.error("Unable to enable realtime heart rate measurement", ex);
        }
    }

I can collect bits and pieces of information for getting continuous heart rate from MiBand3(which is same with 2 I think) but I can not get it to work. If you still remember these or point to the code, the exact steps to get continuous HRM data? I read on a blog about needing to send a ping every 12-15 seconds to keep on getting data. But i can not find it in the code either. Thanks a lot.

@TSG9876 Hi, you said years ago:) > V 07:25:28.564 Reading descriptor 00002902-0000-1000-8000-00805f9b34fb > D 07:25:28.575 gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb) > I 07:25:28.650 Read Response received from descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00 > A 07:25:28.663 "Notifications enabled" received.... and, > Mi Band 1S or 2 Heart rate Notification is received back from UUID service 00002a37-0000-1000-8000-00805f9b34fb, > To trigger heart rate scanning on demand is done via gatt.write characteristic (00002902-0000-1000-8000-00805f9b34fb) with Hex code 0x15,1,1 for continuous or 0x15,2,1 periodic. You say we need to write 0x15,1,1 to **2902...** which is the descriptor for HRM data(or control?). But in the code I can't see any descriptor: ``` @Override public void onEnableRealtimeHeartRateMeasurement(boolean enable) { if (characteristicHRControlPoint == null) { return; } try { TransactionBuilder builder = performInitialized("Enable realtime heart rate measurement"); enableNotifyHeartRateMeasurements(enable, builder); if (enable) { builder.write(characteristicHRControlPoint, stopHeartMeasurementManual); builder.write(characteristicHRControlPoint, startHeartMeasurementContinuous); } else { builder.write(characteristicHRControlPoint, stopHeartMeasurementContinuous); } builder.queue(getQueue()); enableRealtimeSamplesTimer(enable); } catch (IOException ex) { LOG.error("Unable to enable realtime heart rate measurement", ex); } } ``` I can collect bits and pieces of information for getting continuous heart rate from MiBand3(which is same with 2 I think) but I can not get it to work. If you still remember these or point to the code, the exact steps to get continuous HRM data? I read on a blog about needing to send a ping every 12-15 seconds to keep on getting data. But i can not find it in the code either. Thanks a lot.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.