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

pc-ble-driver-py max connection count

Hello,

I am using pc-ble-driver-py 0.14.1 running on python3.8 and Ubuntu Desktop with  nRF52840-Dongle. Dongle is running connectivity_4.1.1_usb_with_s135_5.1.0.hex. Dongle is running as central and I need to make up to 8 connections. I am using this to increase connection count -

 

gap_cfg = BLEConfigConnGap()
gap_cfg.conn_count = 8
gap_cfg.event_length = 12
gap_cfg.tag = CFG_TAG
self.adapter.driver.ble_cfg_set(BLEConfig.conn_gap, gap_cfg)      

This partly works, now max connection count appears to be 3 instead of 1. But when trying to connect to 4th device I get NRF_ERROR_CONN_COUNT. Is this expected behavior and the hard cap for pc-ble-driver-py with nRF52840-Dongle is 3 connections? Is there any setting that I am missing to increase connection cap?

Parents
  • Hi,

    There are role count parameters in addition to the conn_cfg.conn_count parameter. Default value for central_role_count is 3, so if you need more than three connections as central, you should set the BLEConfigGap setting as well:

        cfg = BLEConfigGap()
        cfg.central_role_count = 4
        cfg.periph_role_count = 0
        cfg.central_sec_count = 1
        ble_tester.driver.ble_cfg_set(BLEConfig.role_count, cfg)

    For details on the above parameters you can have a look at ble_gap_cfg_role_count_t in the SoftDevice API documentation.

    Regards,
    Terje

  • Hi, your suggestion works with minor changes.I was unable to find BLEConfigGap in ble_driver.py, but found BLEConfigGapRoleCount. The following code worked for me to increase central connection count to 8:

    cfg = BLEConfigGapRoleCount()
    cfg.central_role_count = 8 #8 central connections
    cfg.periph_role_count = 0
    cfg.central_sec_count = 0
    self.adapter.driver.ble_cfg_set(BLEConfig.role_count, cfg)

Reply
  • Hi, your suggestion works with minor changes.I was unable to find BLEConfigGap in ble_driver.py, but found BLEConfigGapRoleCount. The following code worked for me to increase central connection count to 8:

    cfg = BLEConfigGapRoleCount()
    cfg.central_role_count = 8 #8 central connections
    cfg.periph_role_count = 0
    cfg.central_sec_count = 0
    self.adapter.driver.ble_cfg_set(BLEConfig.role_count, cfg)

Children
No Data
Related