abdul
abdul

Reputation: 3

GATTTool fails to read characteristics/attribute for Heart Beat data

I'm trying to read the heart rate data from my Xiaomi Mi Band 8 using BlueZ's gatttool. The heart rate data is found in the characteristic with UUID 0x2a37, which has the property NOTIFY.

However, when I attempt to read this characteristic, I receive the following error:

Error: Characteristic value/descriptor read failed: Attribute can't be read

Here's what I've done so far:

Discover all characteristic descriptors:

[AA:BB:CC:DD:EE:FF][LE]> char-desc 0x0025 0xffff
handle: 0x0026, uuid: 00002a37-0000-1000-8000-00805f9b34fb  (Heart Rate Measurement characteristic)
handle: 0x0027, uuid: 00002902-0000-1000-8000-00805f9b34fb  (Client Characteristic Configuration Descriptor)

Enabled notifications for the heart rate measurement characteristic:

[AA:BB:CC:DD:EE:FF][LE]> char-write-req 0x0026 0100
Characteristic value was written successfully

However, I do not receive any notifications after performing these steps. I ensured that the fitness tracker is properly worn and active in measuring heart rate.

Tried to read Heart Beat Data

[AA:BB:CC:DD:EE:FF][LE]> char-read-hnd 0x0026
Error: Characteristic value/descriptor read failed: Attribute can't be read

Why can't I receive heart rate notifications from my Xiaomi Mi Band 8, and how can I successfully get the heart rate data using gatttool?

Any help will be appreciated.

Upvotes: 0

Views: 106

Answers (1)

Risto
Risto

Reputation: 1648

To configure the Heart Rate Measurement characteristic you must write the Client Characteristic Configuration Descriptor.

To enable notifications, you must issue this:

[AA:BB:CC:DD:EE:FF][LE]> char-write-req 0x0027 0100

Upvotes: 0

Related Questions