sensboston / BLEConsole

Bluetooth Low Energy device console app
https://sensboston.github.io/BLEConsole
MIT License
196 stars 73 forks source link

Mi Band 4 #15

Closed Zibri closed 2 years ago

Zibri commented 2 years ago

I am trying to read the hart rate or (if possible) the raw pulse from a Mi Band 4.

BLE: st Device Mi Smart Band 4 is connected. Available services:

00: GenericAccess

01: GenericAttribute

02: DeviceInformation

03: Custom Service: 00001530-0000-3512-2118-0009af100700

04: AlertNotification

05: ImmediateAlert

06: HeartRate

07: 65248

08: 65249

09: 14338

Selected service: HeartRate Available characteristics:

00: HeartRateMeasurement N

01: HeartRateControlPoint RW

if I do r #01 I get protocol error. device information works. any idea?

sensboston commented 2 years ago

Sorry, I don't have Mi Smart Band 4 so I can't test. if you want, drop me email to sens@senssoft.com, send me device (you're also should provide a shipping label to receive your device back), and I can test code with the actual device.

It's the best option I can offer; usually, I'm charging $85/h for the gigs/custom job request ;)

JoeGarcia2 commented 2 years ago

Did you ever get the Protocol Error issue figured out? I'm getting the same error with a Gopro

sensboston commented 2 years ago

Yes. Check this https://stackoverflow.com/questions/56138054/uwp-app-cant-get-data-from-heart-rate-monitor-receiving-protocol-error

JoeGarcia2 commented 2 years ago

Thanks. Is this the correct method? sub #5/#0 ?

BLE: set #5 Selected service Custom Service: b5f90001-aa8d-11e3-9046-0002a5d5c51b.

00: Custom Characteristic: b5f90002-aa8d-11e3-9046-0002a5d5c51b RW

01: Custom Characteristic: b5f90003-aa8d-11e3-9046-0002a5d5c51b RW

02: Custom Characteristic: b5f90004-aa8d-11e3-9046-0002a5d5c51b W

03: Custom Characteristic: b5f90005-aa8d-11e3-9046-0002a5d5c51b R

04: Custom Characteristic: b5f90006-aa8d-11e3-9046-0002a5d5c51b R

BLE: sub #5/#0 The attribute cannot be written. (Exception from HRESULT: 0x80650003)

sensboston commented 2 years ago

No, for subscription characteristic should have an attribute Notify (N)

sensboston commented 2 years ago
Available characteristics:
#00: HeartRateMeasurement N

You should be able to subscribe for that characteristic (from your post above); BLEConsole will display received value in the current format (you may also change format globally).

JoeGarcia2 commented 2 years ago

I'm not the OP. I actually hijacked this thread. I'm working with a GoPRO. I'm getting a ProtocolError when trying to read characteristics:

Selected service Custom Service: b5f90001-aa8d-11e3-9046-0002a5d5c51b.

00: Custom Characteristic: b5f90002-aa8d-11e3-9046-0002a5d5c51b RW

01: Custom Characteristic: b5f90003-aa8d-11e3-9046-0002a5d5c51b RW

02: Custom Characteristic: b5f90004-aa8d-11e3-9046-0002a5d5c51b W

03: Custom Characteristic: b5f90005-aa8d-11e3-9046-0002a5d5c51b R

04: Custom Characteristic: b5f90006-aa8d-11e3-9046-0002a5d5c51b R

BLE: read #5/#0 Read failed: ProtocolError

sensboston commented 2 years ago

@JoeGarcia2 , it's bad for you - the only thing I can say šŸ˜‰ I don't have GoPRO and have no plans to get one.

JoeGarcia2 commented 2 years ago

What triggers "ProtocolError" that I can investigate?

sensboston commented 2 years ago

Try to learn how to use google first. After that, you can find some articles about that error, like this https://stackoverflow.com/questions/56138054/uwp-app-cant-get-data-from-heart-rate-monitor-receiving-protocol-error My app just showing a system exception message (it's open source and you can check yourself).

JoeGarcia2 commented 2 years ago

You keep linking to that post about a heart rate monitor, which I am not using. Iā€™m not a csharp programmer. Just looking for a tool like yours to communicate with a GoPro. If googling for ā€œBLEConsole GoPro ProtocolErrorā€ turned anything up, I wouldnā€™t be asking for your help. Maybe someone else friendlier will see this someday with the same problem and will contribute an answer.

sensboston commented 2 years ago

Yes, I do 'cause it looks like you're not reading or not understanding what that discussion said šŸ˜‰ "Protocol error" means this property is not readable at all (even it's marked as "readable") or might be requires some device permissions. I can't help you, and actually I don't provide a support about specific devices, I can only support my code as well.