This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Issues with characteristic values using the pc-ble-driver-py library

Hello!

I am doing some development with pc-ble-driver-py and ran in to some unexpected behaviours when reading characteristics. I have been modifying the nus_collector.py script that was given as an example on this post. I am also using a PCA10028 to scan for devices.

Firstly, when scanning for devices, they last few characters for some devices are missing or corrupted. For example, when receiving the advertising name of a device with the name of "TestDev", the received name is captured as follows:

TesÝgSt -> [84, 101, 115, 221, 103, 83, 116]
TesÝÝÝÝ -> [84, 101, 115, 221, 221, 221, 221]
TesÝÝÝÝ -> [84, 101, 115, 221, 221, 221, 221]
TesÝÝÝ  -> [84, 101, 115, 221, 221, 221, 0]
TesÝÝÝ  -> [84, 101, 115, 221, 221, 221, 0]
TesÝwar -> [84, 101, 115, 221, 119, 97, 114]
TesÝÝÝ5 -> [84, 101, 115, 221, 221, 221, 53]
TesÝÝÝÝ -> [84, 101, 115, 221, 221, 221, 221]
TesÝÝÝI -> [84, 101, 115, 221, 221, 221, 73]
TesÝÝÝÝ -> [84, 101, 115, 221, 221, 221, 221]
TesÝÝÝÝ -> [84, 101, 115, 221, 221, 221, 221]
TesÝÝÝÝ -> [84, 101, 115, 221, 221, 221, 221]

where the expected output should be:

TestDev -> [84, 101, 115, 116, 68, 101, 118]

Upon using nRF Connect (either PC or mobile versions), the correct device name is displayed:

   

This end of device name string corruption does not just happen for this particular device - I have tested scanning other devices where I see a similar behaviour with differing amounts of corruption (e.g. some devices only have 1 character that is corrupted at the end of the string). However, not all of the devices I have scanned display the corruption; some devices have their advertising names being received correctly.



Secondly, when receiving heart rate notifications from a connected device, the data is tens of thousands of values in length. Is there any documentation on how to convert this data so it can be interpreted in beats per minute (bpm)? Note: the heart rate is correctly displayed on nRF Connect (both PC and mobile).

Here is the modified nus_collector.py script that I have been using to test:

import sys
import time
import queue
import logging
from enum import Enum
from functools import wraps

CONN_IC_ID = 'NRF51'

from pc_ble_driver_py import config
config.__conn_ic_id__ = CONN_IC_ID
from pc_ble_driver_py.ble_driver import BLEUUID, BLEUUIDBase, BLEDriverObserver, BLEDriver, BLEEnableParams, BLEAdvData, BLEGapTimeoutSrc
from pc_ble_driver_py.ble_adapter import BLEAdapterObserver, BLEAdapter


TARGET_DEV_NAME = "TestDev"
TARGET_DEV_MAC_ADDRESS = 'DEA01D552902'
CONNECTIONS = 1

def init(conn_ic_id):
    global nrf_sd_ble_api_ver
    nrf_sd_ble_api_ver = config.sd_api_ver_get()

class NUSCollector(BLEDriverObserver, BLEAdapterObserver):

    def __init__(self, adapter):
        super(NUSCollector, self).__init__()
        self.adapter    = adapter
        self.conn_q     = queue.Queue()
        self.adapter.observer_register(self)
        self.adapter.driver.observer_register(self)
        global GFIT_CS_BASE_UUID, HRS_UUID, DEVICE_NAME_UUID, MANUFACTURER_NAME_UUID
        global FIRMWARE_REVISION_UUID, SOFTWARE_REVISION_UUID, FITNESS_MACHINE_FEATURES_UUID
        global FITNESS_MACHINE_STATUS_UUID, TREADMILL_DATA_UUID, CROSS_TRAINER_DATA_UUID
        global STEP_CLIMBER_DATA_UUID, ROWER_DATA_UUID, INDOOR_BIKE_DATA_UUID
        global SUPPORTED_INCLINATION_RANGE_UUID, SUPPORTED_RESISTANCE_LEVEL_RANGE_UUID
        global SUPPORTED_HEART_RATE_RANGE_UUID, SUPPORTED_POWER_RANGE_UUID
        global GFIT_CS_CONTROL_POINT_UUID, GFIT_CS_CUSTOM_DATA_UUID


        HRS_UUID = BLEUUID(BLEUUID.Standard.heart_rate)
        DEVICE_NAME_UUID = BLEUUID(0x2A00)
        MANUFACTURER_NAME_UUID = BLEUUID(0x2A29)
        FIRMWARE_REVISION_UUID = BLEUUID(0x2A26)
        SOFTWARE_REVISION_UUID = BLEUUID(0x2A28)

        FITNESS_MACHINE_FEATURES_UUID = BLEUUID(0x2ACC)
        FITNESS_MACHINE_STATUS_UUID = BLEUUID(0x2ADA)
        TREADMILL_DATA_UUID = BLEUUID(0x2ACD)
        CROSS_TRAINER_DATA_UUID = BLEUUID(0x2ACE)
        STEP_CLIMBER_DATA_UUID = BLEUUID(0x2ACF)
        ROWER_DATA_UUID = BLEUUID(0x2AD1)
        INDOOR_BIKE_DATA_UUID = BLEUUID(0x2AD2)

        SUPPORTED_INCLINATION_RANGE_UUID = BLEUUID(0x2AD5)
        SUPPORTED_RESISTANCE_LEVEL_RANGE_UUID = BLEUUID(0x2AD6)
        SUPPORTED_HEART_RATE_RANGE_UUID = BLEUUID(0x2AD7)
        SUPPORTED_POWER_RANGE_UUID = BLEUUID(0x2AD8)

    def open(self):
        self.adapter.driver.open()



        ble_enable_params = BLEEnableParams(vs_uuid_count      = 1,
                                            service_changed    = False,
                                            periph_conn_count  = 0,
                                            central_conn_count = CONNECTIONS,
                                            central_sec_count  = CONNECTIONS)
        if nrf_sd_ble_api_ver >= 3:
            print("Enabling larger ATT MTUs")
            ble_enable_params.att_mtu = 50

        self.adapter.driver.ble_enable(ble_enable_params)


    def close(self):
        self.adapter.driver.close()


    def connect_and_discover(self):
        self.adapter.driver.ble_gap_scan_start()
        new_conn = self.conn_q.get(timeout = 60)

        if nrf_sd_ble_api_ver >= 3:
            att_mtu = self.adapter.att_mtu_exchange(new_conn)

        self.adapter.service_discovery(new_conn)

        status, data = self.adapter.read_req(new_conn, DEVICE_NAME_UUID)
        data = ''.join([chr(c) for c in data])
        print('Device Name = {} status = {}'.format(data, status))

        self.adapter.enable_notification(new_conn, HRS_UUID)

        return new_conn


    def on_gap_evt_connected(self, ble_driver, conn_handle, peer_addr, role, conn_params):
        print('New connection: {}'.format(conn_handle))
        self.conn_q.put(conn_handle)


    def on_gap_evt_disconnected(self, ble_driver, conn_handle, reason):
        print('Disconnected: {} {}'.format(conn_handle, reason))


    def on_gap_evt_timeout(self, ble_driver, conn_handle, src):
        if src == BLEGapTimeoutSrc.scan:
            ble_driver.ble_gap_scan_start()


    def on_gap_evt_adv_report(self, ble_driver, conn_handle, peer_addr, rssi, adv_type, adv_data):
        dev_name_list = None
        if BLEAdvData.Types.complete_local_name in adv_data.records:
            dev_name_list = adv_data.records[BLEAdvData.Types.complete_local_name]
        elif BLEAdvData.Types.short_local_name in adv_data.records:
            dev_name_list = adv_data.records[BLEAdvData.Types.short_local_name]
        else:
            return

        dev_name = ''.join(chr(e) for e in dev_name_list)
        print('{} -> {}'.format(dev_name, dev_name_list))

        address_string  = ''.join("{0:02X}".format(b) for b in peer_addr.addr)
        # print('Received advertisement report, address: 0x{}, device_name: {}'.format(address_string,
                                                                                    # dev_name))
        if (dev_name in TARGET_DEV_NAME):
            self.adapter.connect(peer_addr)


    def on_notification(self, ble_adapter, conn_handle, uuid, data):
        if (uuid.value.value == BLEUUID.Standard.heart_rate.value):
            if (len(data) > 32):
                print('Heart Rate Received: {}...'.format(data[:10]))
                print('Data Length: {}'.format(len(data)))
            else:
                print('Heart Rate Received: {}'.format(data))
        else:
            print('Connection: {}, {} = {}'.format(conn_handle, uuid, data))

    def on_gattc_evt_read_rsp(self, ble_driver, conn_handle, status, error_handle, attr_handle, offset, data):
        print('Read Response event - Connection: {}, {} = {}'.format(conn_handle, attr_handle, data))


    def on_att_mtu_exchanged(self, ble_driver, conn_handle, att_mtu):
        print('ATT MTU exchanged: conn_handle={} att_mtu={}'.format(conn_handle, att_mtu))


    def on_gattc_evt_exchange_mtu_rsp(self, ble_driver, conn_handle, **kwargs):
        print('ATT MTU exchange response: conn_handle={}'.format(conn_handle))


def main(serial_port):
    print('Serial port used: {}'.format(serial_port))
    driver    = BLEDriver(serial_port=serial_port, auto_flash=True)
    adapter   = BLEAdapter(driver)
    collector = NUSCollector(adapter)
    collector.open()
    global name
    for i in range(CONNECTIONS):
        conn_handle = collector.connect_and_discover()

    time.sleep(10)
    print('Closing')
    collector.close()


def item_choose(item_list):
    for i, it in enumerate(item_list):
        print('\t{} : {}'.format(i, it))
    print(' ')

    while True:
        try:
            choice = int(input('Enter your choice: '))
            if ((choice >= 0) and (choice < len(item_list))):
                break
        except Exception:
            pass
        print ('\tTry again...')
    return choice


if __name__ == "__main__":
    serial_port = None
    if len(sys.argv) < 2:
        print("Please specify connectivity IC identifier (NRF51, NRF52)")
        exit(1)
    init(sys.argv[1])
    if len(sys.argv) == 3:
        serial_port = sys.argv[2]
    else:
        descs       = list(BLEDriver.enum_serial_ports())
        choices     = ['{}: {}'.format(d.port, d.serial_number) for d in descs]
        choice      = item_choose(choices)
        serial_port = descs[choice].port
    main(serial_port)
    quit()

Any help with either of these issues would be greatly appreciated!

Regards,

Scott

Parents
  • Hi,

    Which device are you testing this against? Are you running the HRS example from the SDK? Are you seeing this name issue with other peripherals as well, or only this device?

    Could you give an example of the HRS data issue? The data should only contain the bpm value.

    Best regards,
    Jørgen

  • Yes, I have tried the Heart Rate Collector example in the repository and the same behaviour occurred.

  • I am running Windows 10 and using Python 3.7.3. I am using pc-ble-driver version 0.12.0 which was installed through PyPi.

    I have not tested this on another PC - it may not be feasible for me to do so, but I will look into it.

  • I tried reproducing this on a similar environment, but I'm not able to see this issue. Did you test with the HRS example from the SDK? Have you made any modifications to the pc-ble-driver-py libraries?

    This is the output when I run the sample you posted above when testing against SDK HRS example:

    >python nus_collector.py NRF51
            0 : COM58: 683716957
            1 : COM10: 681512033
            2 : COM57: 683088727
    
    Enter your choice: 1
    Serial port used: COM10
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    BBC micro:bit [gaput] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 103, 97, 112, 117, 116, 93]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    BBC micro:bit [gaput] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 103, 97, 112, 117, 116, 93]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    LE-Nighthawk -> [76, 69, 45, 78, 105, 103, 104, 116, 104, 97, 119, 107]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    LE-Nighthawk -> [76, 69, 45, 78, 105, 103, 104, 116, 104, 97, 119, 107]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    TestDev -> [84, 101, 115, 116, 68, 101, 118]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    BBC micro:bit [vigav] -> [66, 66, 67, 32, 109, 105, 99, 114, 111, 58, 98, 105, 116, 32, 91, 118, 105, 103, 97, 118, 93]
    New connection: 0
    Read Response event - Connection: 0, 3 = [84, 101, 115, 0, 0, 0, 183]
    Device Name = Tes   · status = BLEGattStatusCode.success
    Heart Rate Received: [20, 250, 227, 0, 228, 0, 229, 0, 230, 0, 231, 0, 232, 0, 233, 0, 0, 0, 0, 0]
    Heart Rate Received: [20, 240, 237, 0, 238, 0, 239, 0, 240, 0, 241, 0, 242, 0, 243, 0, 0, 0, 0, 0]
    Heart Rate Received: [20, 230, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 0, 0, 117, 116]
    Heart Rate Received: [20, 220, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 0, 0, 112, 113]
    Heart Rate Received: [20, 210, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 0, 0, 117, 116]
    Heart Rate Received: [22, 200, 47, 1, 48, 1, 49, 1, 50, 1, 51, 1, 52, 1, 53, 1, 0, 0, 117, 116]
    Heart Rate Received: [22, 190, 56, 1, 57, 1, 58, 1, 59, 1, 60, 1, 61, 1, 62, 1, 0, 0, 112, 113]
    Heart Rate Received: [22, 180, 65, 1, 66, 1, 67, 1, 68, 1, 69, 1, 70, 1, 71, 1, 0, 0, 117, 116]
    Heart Rate Received: [22, 170, 89, 1, 90, 1, 91, 1, 92, 1, 93, 1, 94, 1, 95, 1, 0, 0, 112, 113]
    Heart Rate Received: [22, 160, 98, 1, 99, 1, 100, 1, 101, 1, 102, 1, 103, 1, 104, 1, 0, 0, 103, 97]
    Closing

  • I do see the corruption issue in your output in line 26. "TestDev" is the string of your device name but once the connection is established it is read as "Tes   ·" - the last 4 characters are overwritten.

    This is the output I get when testing against the HRS example in the SDK:

    > python3 .\nus_collecter.py NRF51
            0 : COM3: 681802590
            1 : COM4: 683838020
    
    Enter your choice: 0
    Serial port used: COM3
    HMIdesk_17490245 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 50, 52, 53]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    RSI_BLE_SIMPLE_PRIVACY -> [82, 83, 73, 95, 66, 76, 69, 95, 83, 73, 77, 80, 76, 69, 95, 80, 82, 73, 86, 65, 67, 89]
    RSI_BLE_SIMPLE_PRIVACY -> [82, 83, 73, 95, 66, 76, 69, 95, 83, 73, 77, 80, 76, 69, 95, 80, 82, 73, 86, 65, 67, 89]
    HRM-Pro:6507Ý  -> [72, 82, 77, 45, 80, 114, 111, 58, 54, 53, 48, 55, 221, 0]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HMIdesk_174903A2 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 51, 65, 50]
    nRF5x Mesh Light -> [110, 82, 70, 53, 120, 32, 77, 101, 115, 104, 32, 76, 105, 103, 104, 116]
    HMIdesk_17490245 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 50, 52, 53]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HMIdesk_17490116 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 49, 49, 54]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HMIdesk_17490147 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 49, 52, 55]
    HMIdesk_17490245 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 50, 52, 53]
    nRF5x Mesh Light -> [110, 82, 70, 53, 120, 32, 77, 101, 115, 104, 32, 76, 105, 103, 104, 116]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    nRF5x Mesh Light -> [110, 82, 70, 53, 120, 32, 77, 101, 115, 104, 32, 76, 105, 103, 104, 116]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HMIdesk_174903A2 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 51, 65, 50]
    HMIdesk_1749013B -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 49, 51, 66]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    UAT-3393 -> [85, 65, 84, 45, 51, 51, 57, 51]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HMIdesk_17490245 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 50, 52, 53]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HMIdesk_17490116 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 49, 49, 54]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    GFIÝÝ   -> [71, 70, 73, 221, 221, 0, 0]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    HMIdesk_174903E5 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 51, 69, 53]
    nRF5x Mesh Light -> [110, 82, 70, 53, 120, 32, 77, 101, 115, 104, 32, 76, 105, 103, 104, 116]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Forerunner 945 -> [70, 111, 114, 101, 114, 117, 110, 110, 101, 114, 32, 57, 52, 53]
    HMIdesk_174903E5 -> [72, 77, 73, 100, 101, 115, 107, 95, 49, 55, 52, 57, 48, 51, 69, 53]
    nRF5x Mesh Light -> [110, 82, 70, 53, 120, 32, 77, 101, 115, 104, 32, 76, 105, 103, 104, 116]
    HUB_BLE -> [72, 85, 66, 95, 66, 76, 69]
    Nordic_HRM -> [78, 111, 114, 100, 105, 99, 95, 72, 82, 77]
    New connection: 0
    Read Response event - Connection: 0, 3 = [78, 111, 114, 100, 105, 99, 220, 121, 158, 99]
    Device Name = NordicÜyžc status = BLEGattStatusCode.success
    Heart Rate Received: [22, 180, 141, 1, 140, 1, 139, 1, 138, 1, 137, 1, 136, 1, 135, 1, 221, 221, 221, 221]
    Heart Rate Received: [22, 190, 132, 1, 131, 1, 130, 1, 129, 1, 128, 1, 127, 1, 126, 1, 221, 221, 221, 221]
    Heart Rate Received: [22, 200, 123, 1, 122, 1, 121, 1, 120, 1, 119, 1, 118, 1, 117, 1, 221, 221, 221, 221]
    Heart Rate Received: [22, 210, 99, 1, 98, 1, 97, 1, 96, 1, 95, 1, 94, 1, 93, 1, 221, 221, 221, 221]
    Heart Rate Received: [22, 220, 90, 1, 89, 1, 88, 1, 87, 1, 86, 1, 85, 1, 84, 1, 221, 221, 221, 221]
    Heart Rate Received: [20, 230, 81, 1, 80, 1, 79, 1, 78, 1, 77, 1, 76, 1, 75, 1, 221, 221, 221, 221]
    Heart Rate Received: [20, 240, 57, 1, 56, 1, 55, 1, 54, 1, 53, 1, 52, 1, 51, 1, 221, 221, 221, 221]
    Heart Rate Received: [20, 250, 48, 1, 47, 1, 46, 1, 45, 1, 44, 1, 43, 1, 42, 1, 221, 221, 221, 221]
    Heart Rate Received: [21, 4, 1, 39, 1, 38, 1, 37, 1, 36, 1, 35, 1, 34, 1, 221, 221, 221, 221]
    Heart Rate Received: [21, 14, 1, 15, 1, 14, 1, 13, 1, 12, 1, 11, 1, 10, 1, 221, 221, 221, 221]
    Closing

    Corruption can be seen on lines 15, 55, and 72.

  • Hi,

    is currently out-of-office.

    I have not (as of yet) been able to reproduce for received advertising data, but I have reproduced for listing the device name upon connection:

    Nordic_HRM -> [78, 111, 114, 100, 105, 99, 95, 72, 82, 77]
    New connection: 0
    Device Name = Noïz·=?  ? status = BLEGattStatusCode.success

    Clearly something is not right, and I am investigating further.

    Regards,
    Terje

  • Hi,

    We are consistently reproducing the Device Name read issue, and have isolated it to be in either pc-ble-driver or pc-ble-driver-py. (I.e. it is not a connectivity firmware issue, and not a UART issue.)

    Regarding the values read from the Heart Rate Measurement characteristic, those should not be 36660+ bytes long. Via bluetooth.com you can find the format for the HRM value. Studying the log output, it seems the last few bytes of "Heart Rate Received" are corrupted as well. Looks to me like a "use after free" issue somewhere in either pc-ble-driver or pc-ble-driver-py. The team is looking into it.

    Regards,
    Terje

Reply
  • Hi,

    We are consistently reproducing the Device Name read issue, and have isolated it to be in either pc-ble-driver or pc-ble-driver-py. (I.e. it is not a connectivity firmware issue, and not a UART issue.)

    Regarding the values read from the Heart Rate Measurement characteristic, those should not be 36660+ bytes long. Via bluetooth.com you can find the format for the HRM value. Studying the log output, it seems the last few bytes of "Heart Rate Received" are corrupted as well. Looks to me like a "use after free" issue somewhere in either pc-ble-driver or pc-ble-driver-py. The team is looking into it.

    Regards,
    Terje

Children
No Data
Related