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

MAC Address Incrementation Pairing issue

Hi,


We are testing mass pairing on our windows machines, as we have seen problems with a high number of paired devices.

I am able to increment the mac address by using sd_ble_gap_addr_set, and saving it in a noinit ram section, and soft reseting the device.

I also erase bonds post reset, and have tried pre reset as well.

I see the advertisement on the incremented mac address, but I receive a pairing error (136 - which from what I have seen, is the result of an invalid state of the PM).

What can I do to fix this?

Thanks!

Roi

  • Hi,

    Error 136 corresponds to BLE_GAP_SEC_STATUS_UNSPECIFIED assuming it reported via the PM security failed event, so it's not the most helpful error code I'm afraid. I'm not sure how I should try to replicate this error here, can you maybe provide the steps for me?

    high number of paired devices

    Just to confirm, is this an issue on the Windows PC or on the nRF side?

    I also erase bonds post reset, and have tried pre reset as well.

     On PC, nRF, or both?

    I see the advertisement on the incremented mac address

     What's the purpose changing the address, is it to make the windows PC see the nRF as a new device.

    Thanks,

    Vidar

  • Hi Vidar!

    1. Yes, the problem we see is definitely on the windows side. We simply want to try and estimate the number of paired devices windows can deal with before "going crazy".
    2. I erase bonds only on the nRF end, because part of the issue on the windows end is the amount of LTKs and cached GATT tables, so I want to keep them.
    3. You are correct - we want the windows PC to pair with the incremented mac as if it is a new device. Is there a more elegant solution that you can suggest?

    Thanks for your quick reply!

    Roi

  • Hi Roi,

    I think I would probably have created a random BLE address after every boot so I didn't have to keep track of the increment in RAM. Apart from that, it sounds like a good way to test this issue.

    As for the pairing issue, did you try to reset the device after deleting the bonds? It may be an idea to use nrfjprog to erase the flash pages between each test to be absolutely sure the bonding information is erase:

    1. nrfjprog --erasepage <fds_page_start-fds_page_end>

    2. nrfjprog --reset

    Vidar

  • Hi Vidar,
    I also tried erasing bonds before the reset, to no avail.
    We want this test to be able to happen w/o being physically connected to a debugger, so the nrjfprog option is not possible for us.

    Thanks!
    Roi

  • Same problem here,

    <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 136

    after trying to connect on incremented mac. This is happening on a windows device, android is working fine.

     

    <debug> nrf_sdh_ble: BLE event: 0x10.
    <debug> nrf_ble_gatt: Requesting to update ATT MTU to 256 bytes on connection 0x0.
    <info> app: Connected
    <debug> nrf_sdh_ble: BLE event: 0x23.
    <debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
    <debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
    <debug> nrf_sdh_ble: BLE event: 0x24.
    <debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
    <debug> nrf_ble_gatt: max_rx_octets: 27
    <debug> nrf_ble_gatt: max_tx_octets: 27
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <debug> nrf_ble_gatt: max_tx_time: 328
    <debug> nrf_sdh_ble: BLE event: 0x55.
    <debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 527 bytes.
    <debug> nrf_ble_gatt: Updating ATT MTU to 256 bytes (desired: 256) on connection 0x0.
    <debug> nrf_sdh_ble: BLE event: 0x3A.
    <debug> nrf_ble_gatt: ATT MTU updated to 256 bytes on connection 0x0 (response).
    <debug> nrf_sdh_ble: BLE event: 0x13.
    <debug> peer_manager_handler: Event PM_EVT_CONN_SEC_START
    <debug> peer_manager_handler: Connection security procedure started: role: Peripheral, conn_handle: 0, procedure: Bonding
    <debug> peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ
    <debug> peer_manager_handler: Security parameter request
    <debug> nrf_sdh_ble: BLE event: 0x1A.
    <debug> nrf_sdh_ble: BLE event: 0x19.
    <debug> peer_manager_handler: Event PM_EVT_CONN_SEC_FAILED
    <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 136
    <debug> peer_manager_handler: Error (decoded): BLE_GAP_SEC_STATUS 0x88
    <debug> nrf_sdh_ble: BLE event: 0x11.
    <info> app: Fast advertising.
    <info> app: Disconnected
    

Related