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

peer_manager_handler: Connection security failed: error: 1

Hi all,

My device is working as a HID device. it's working on android and iPad but not work on macOS. It's can't solve the security procedure and returning error:
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 1

I was trying to connect to macOS 10.13.6 High Sierra using ble_app_hids_keyboard example. But I got the same error.

My device using NRF52810 with s112 and SDK 15.3.0. Ble_app_hids_keyboard project I had run on pca10040 board with s112 and SDK 15.3.0. The only thing which I changed in ble_app_hids_keyboard example is sdk_config.h

#define NRF_LOG_BACKEND_RTT_ENABLED 1
#define NRF_LOG_DEFAULT_LEVEL 4

Can you help me?
Many thanks in advance.
  • Hi,

    I do not have a High Sierra device at hand, but I tested using macOS Catalina and the ble_app_hids_keyboard example from SDK 15.3. Using that I am not able to reproduce the issue, and pairing succeeds as expected. Are you able to reproduce this with Catalina?

  • I have tested an example on Catalina. 
    I also could not connect from it, but there is no this error. There are no events in the logs when trying to connect as if no one was trying to connect.
    Now I’ll try to use another board and another SDK, let's see what happens
    Can you send me your hex file? 

  • I tested an example from the SDK on three boards.
    On two PCA10040 and one with BMD-350
    Tested SDK 15.2, SDK15.3 and SDK15.3 newly downloaded from the site.
    I downloaded the hex file of the example lying in the folder with the example into the board and tested it on two macOS on High Sierra and Catalina

    I could not connect. But now in the debugger there were no events on any of the versions. Which is strange.

    After rebooting High Sierra, the connection almost happened. in macOS, the inscription connected, disconnected, about 4 times per second quickly changed. This is for the hex file taken from the example.

    For compiled by me:
    I get the same error
    <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 1


    After rebooting the PC, I get a tighter picture, constantly writing connection \ disconnect
    This is not a big piece of log:
    00> <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    00>
    00> <info> app: Fast advertising.
    00>
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 150 bytes on connection 0x0.
    00>
    00> <info> app: Connected
    00>
    00> <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    00>
    00> <info> app: Fast advertising.
    00>
    00> <info> app: Disconnected
    00>
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 150 bytes on connection 0x0.
    00>
    00> <info> app: Connected
    00>
    00> <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    00>
    00> <info> app: Fast advertising.
    00>
    00> <info> app: Disconnected
    00>
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 150 bytes on connection 0x0.
    00>
    00> <info> app: Connected
    00>
    00> <debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 104 bytes.
    00>
    00> <debug> nrf_ble_gatt: Updating ATT MTU to 104 bytes (desired: 150) on connection 0x0.
    00>
    00> <debug> nrf_ble_gatt: ATT MTU updated to 104 bytes on connection 0x0 (response).
    00>
    00> <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    00>
    00> <info> app: Fast advertising.
    00>
    00> <info> app: Disconnected

    In all cases, the ipad connects without problems.

  • tested on old macbook air. not connected. Macbook writes it was not possible to create a pair, nothing happens on the device side.

  • Hi,

    I have tested several Mac's and MacOS versions now, and I am not able to reproduce this. This is basically an unmodified SDK example, just with the additional logging you have added. Do you still get problems using this hex (ble_app_hids_keyboard_pca10040_s132_merged.hex - include both app and SoftDevice)?

    It is a bit difficult to read your RTT logs and some things seem missing, which may be because you probably have NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED set to 1 in the sdk_config.h. Please set this to 0.

    The only problem I am able to reproduce is a few expected problems. When deleting the bonding information on the Mac but not on the nRF, I get this:

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

    And when deleting the donging information on the nRF only, I get this:

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

Related