JonasPrimbs / movesense-ble-ecg-firmware

A custom firmware for Movesense ECG devices which implements a Bluetooth Low Energy (BLE) GATT Service for electrocardiograph voltage measurements.
Other
6 stars 1 forks source link

Heart Rate Service - No data on Heart Rate Measurement notification Characteristic 0x2a37 #1

Closed stuartlynne closed 1 year ago

stuartlynne commented 1 year ago

Describe the bug With the v.0.5.0 firmware installed, the ECG data works correctly, data arrives via Notify for the ECG Voltage Characteristic, and the ECG Measurment Interval Characteristic works for read.

The ECG Voltage Characteristic does not send any data.

I have verified both with my own Python application.

I have also verified using Zwift that it can correctly get the Heart Rate data with the standard firmware. And that it recognizes the Movesense with the ECG firmware installed, can connect to it, but no heart rate data arrives.

To Reproduce Steps to reproduce the behavior: With Zwift, in the connection screen, for heart rate, select the Movesense. Then start the game, and look at the heart rate data, there is no valid data.

Expected behavior Data should arrive on the ECG Voltage Characteristic via NOTIFY access.

       try:
            await client.start_notify(self._characteristic, self._data_conv)
        except Exception as e:
            print("BLE_Data.start_notify[%d:%s][%s]: exception e: %s" % (self.tid, self.name, self.data_name, e), file=sys.stderr)
            self.data_info(self.data_name, f" start_notify failed {e}")

N.b. We do not see the exception. The start_notify() does not fail. Just do not see data arrive and the self._data_conv() function called.

My test code works correctly with the standard Movesense firmware, also Polar H10 and Garmin Dual.

Desktop (please complete the following information): Zwift on Windows. Also, my own Python app connecting with Bleak.

Additional context The Movesense Showcase app in IOS does continue to be able to get the heart rate. I suspect it is using their Whiteboard protocol, not the GATT Heart Rate Service.

I will be using this to add support for Movesense ECG to my dashboard and ecg apps. https://www.fitnesshrv.com/

stuartlynne commented 1 year ago

I have verified that I see the same problem with the 0.4.0 firmware.

JonasPrimbs commented 1 year ago

If I understand you correctly: In Version 0.5.0

But the normal Heart Rate Service (UUID 0x180D) does not send any data on NOTIFY?

I can reproduce this issue in the nRF Connect app on Android. Subscribing to changes works, but I do not receive any data from the device.

I guess that this is a bug in the Movesense Firmware since we used the provided heart rate service implementation of Movesense and did not change anything. This has maybe something to do with the limited number of custom BLE GATT services.

I will have a deeper look at this in the next weeks, please stay patient and trigger me if I will not reply within the next two weeks.

stuartlynne commented 1 year ago

Thanks for your response!

I think that sums it up correctly.

The other bit of data is that there is no error while waiting for the data.

I don't know enough about BLE, Python Bleak to know if that indicates that something is working, e.g. low-level handshake between the client and service. But I know from working with other devices that problems on the device would occasionally show up as timeouts or errors or exceptions from the function call waiting for the data to arrive.

You might want to create an Issue in the Movesense Device Library git archive. I know that Movesense is working on 2.2 and is (will be) doing some work with BLE, at least to the extent that they plan to support two BLE connections in the next release.

On Tue, Feb 7, 2023 at 3:20 AM Jonas Primbs @.***> wrote:

If I understand you correctly: In Version 0.5.0

  • The ECG voltage characteristic (UUID 0x2BDD) works on NOTIFY
  • The ECG measurement interval characteristic (UUID 0x28BE) works on READ and write

But the normal Heart Rate Service (UUID 0x180D) does not send any data on NOTIFY?

I can reproduce this issue in the nRF Connect app on Android. Subscribing to changes works, but I do not receive any data from the device.

I guess that this is a bug in the Movesense Firmware since we used the provided heart rate service implementation of Movesense and did not change anything. This has maybe something to do with the limited number of custom BLE GATT services.

I will have a deeper look at this in the next weeks, please stay patient and trigger me if I will not reply within the next two weeks.

— Reply to this email directly, view it on GitHub https://github.com/JonasPrimbs/movesense-ble-ecg-firmware/issues/1#issuecomment-1420612639, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACIUWNJXAOY66M5246UZW3WWIVYLANCNFSM6AAAAAAUROATZQ . You are receiving this because you authored the thread.Message ID: @.***>

-- __O____ -\<,____ ____()/()___


@.***>__604-518-1749(m)604-461-7532(h)

stuartlynne commented 1 year ago

Just checking if you have had a chance to look at this. I'd like to make sure it works before pushing out the next release of my app. Currently, I'm supporting Polar H10, and this will add Movesense. Have the ECG support working. In theory, the Heartrate and RR data should just work once the firmware is fixed.

stuartlynne commented 1 year ago

Just another ping.

JonasPrimbs commented 1 year ago

Thanks, sorry for the delay. I will have a look at it in the next days.

JonasPrimbs commented 1 year ago

Again, sorry for the long delay. Took me longer than expected, but I think I have fixed it right now. I will test it further. If everything works fine, I will push the updated code in the next few hours and reply here.

JonasPrimbs commented 1 year ago

Tests were successful. I just published version 0.5.1. Thank you very much for reporting this bug. If you still see this bug in the latest version, feel free to re-open this issue!

stuartlynne commented 1 year ago

Thanks. Should be able to test next week.

On Sat, Apr 29, 2023 at 9:47 AM Jonas Primbs @.***> wrote:

Closed #1 https://github.com/JonasPrimbs/movesense-ble-ecg-firmware/issues/1 as completed.

— Reply to this email directly, view it on GitHub https://github.com/JonasPrimbs/movesense-ble-ecg-firmware/issues/1#event-9130991365, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACIUWPVFEJF26GT44E37W3XDVAZNANCNFSM6AAAAAAUROATZQ . You are receiving this because you authored the thread.Message ID: <JonasPrimbs/movesense-ble-ecg-firmware/issue/1/issue_event/9130991365@ github.com>

-- __O____ -\<,____ ____()/()___


@.***>__604-518-1749(m)604-461-7532(h)