How to Make nRF52833 Mouse Re-Advertise and Pair as a Completely New Device After Reset?

I have a mouse that is advertising, and I paired it with my host. It always stays in connected mode. When I press the three buttons — middle, left, and right — for 5 seconds, the host changes from connected to paired mode, and the mouse starts advertising again. It also appears again in the host’s scanner, and I can pair it again. It behaves like a new device.

I want to know what changes are required so that it always appears as a completely new device.

So far, I have done the following:

  1. I have deleted the peer data.

  2. I have changed the MAC address.

It advertises as a new device, but it does not pair.

Parents
  • Hi Amit,

    • I have deleted the peer data.

    • I have changed the MAC address.

    This is correct. After this, could you try to advertise in open mode i.e. without the Filter Accept List (BT_LE_ADV_OPT_FILTER_CONN) ?  If you continue to use the accept list, only previously bonded devices will be able to connect, and new pairing will not be possible.

    This is mentioned in a previous ticket.

    -Priyanka

  • Thank you for the information. However, I am using nRF SDK 17.1, and there is no flag corresponding to this. I have also tried alternative methods, but I am still encountering the issue .

  • Hi Amit,

    I thought you were working with the nRF Connect SDK. 

    Since it's the nRF5 SDK, I will just check this with experts and get back to you.

    You mention that:

    It advertises as a new device, but it does not pair.

    Do you get any errors codes from the pairing procedure, or have some logs that you can share that shows this.

    -Priyanka

  • These are the logs I am receiving.

    <info> app_timer
    : RTC: initialized.
    <info> app: RNG initialized.
    <info> app: HID Keyboard example started.
    <debug> peer_manager_handler: Event PM_EVT_PEERS_DELETE_SUCCEEDED
    <info> peer_manager_handler: All peers deleted.
    <info> app: pm_peers_delete requested.
    <warning> rng: Function: nrf_drv_rng_rand, error code: NRF_SUCCESS.
    <info> app: New random static address set.
    <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    <info> app: Fast advertising.
    <info> app: Advertising restarted as fresh device.
    <debug> peer_manager_handler: Event PM_EVT_CONN_CONFIG_REQ
    <debug> peer_manager_handler: Connection configuration request
    <info> app: Connected
    <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_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: 330
    <debug> nrf_ble_gatt: max_tx_time: 328
    <debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 527 bytes.
    <debug> nrf_ble_gatt: Updating ATT MTU to 23 bytes (desired: 23) on connection 0x0.
    <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> 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
    <warning> peer_manager_handler: Disconnecting conn_handle 0.
    <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    <info> app: Fast advertising.
    <info> app: Disconnected
    <debug> peer_manager_handler: Event PM_EVT_CONN_CONFIG_REQ
    <debug> peer_manager_handler: Connection configuration request
    <info> app: Connected
    <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_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 527 bytes.
    <debug> nrf_ble_gatt: Updating ATT MTU to 23 bytes (desired: 23) on connection 0x0.
    <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: 330
    <debug> nrf_ble_gatt: max_tx_time: 328
    <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> 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
    <warning> peer_manager_handler: Disconnecting conn_handle 0.
    <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    <info> app: Fast advertising.
    <info> app: Disconnected
  • Hi,

    Error 136 corresponds to BLE_GAP_SEC_STATUS_UNSPECIFIED

    Maybe you could try this workaround provided by a colleague of mine.

    Please take a look at that ticket, which also had issues with this Error 136.

    -Priyanka

  • My code is working, thank you very much for the helpful support.

Reply Children
No Data
Related