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

Adding custom service UUID in pc_ble_driver_py

Hi 

I made a custom service for sending radar data from a NRF52 DK and I'm trying to access it with my computer using the pc_ble_driver_py. 

I tried to modify the heart_rate_collector.py example to fit my application, but I am not able to add my custom service UUID.  I followed a similar thread regarding the same issue(How to write to a custom 128 UUID service using pc-ble-driver-py), but it does not work. 

I get the error:

  File "C:\Users\akkvj\Anaconda2\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 254, in enable_notification
raise NordicSemiException('CCCD not found')
pc_ble_driver_py.exceptions.NordicSemiException: CCCD not found

Can you explain how I can modify the heart rate example to enable my custom service? The data I'm transferring are very similar to heart-rate data. 

I'm using Anaconda python distribution package and a nRF52840 DK. 

Thank you very much

--

Aksel

Parents
  • I figured out what was wrong: 

    Decleared BASE_UUID in the init

    BASE_UUID = BLEUUIDBase([0xAD, 0x4A, 0x00, 0x41, 0x55, 0x62, 0x41, 0x12, 0x9A, 0xA8, 0x0A, 0xA2, 0x3D, 0x0C, 0xE5, 0x7A]) 

    This needs to be the big-endian version of what is written on the client. 

    Then the UUID that is going to be notifying 

    X4_UUID = BLEUUID(0x0041, BASE_UUID)

    Add it by writing: 

    self.adapter.driver.ble_vs_uuid_add(BASE_UUID)

    under the line 

    self.adapter.driver.ble_enable(ble_enable_params)

    Then enable notification on X4_UUID

    self.adapter.enable_notification(new_conn, X4_UUID)

    I know this is basically the same as written in other threads, but I just wanted to explain what i did before closing the thread. 

Reply
  • I figured out what was wrong: 

    Decleared BASE_UUID in the init

    BASE_UUID = BLEUUIDBase([0xAD, 0x4A, 0x00, 0x41, 0x55, 0x62, 0x41, 0x12, 0x9A, 0xA8, 0x0A, 0xA2, 0x3D, 0x0C, 0xE5, 0x7A]) 

    This needs to be the big-endian version of what is written on the client. 

    Then the UUID that is going to be notifying 

    X4_UUID = BLEUUID(0x0041, BASE_UUID)

    Add it by writing: 

    self.adapter.driver.ble_vs_uuid_add(BASE_UUID)

    under the line 

    self.adapter.driver.ble_enable(ble_enable_params)

    Then enable notification on X4_UUID

    self.adapter.enable_notification(new_conn, X4_UUID)

    I know this is basically the same as written in other threads, but I just wanted to explain what i did before closing the thread. 

Children
No Data
Related