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.
Parents Reply
  • This behavior when the device is constantly reconnecting occurs only after the MAC reboot. After this, I connected several times, there was no CRC error. Yes, we have a fairly noisy place for ble, but I would not say that all channels are busy.
    See file 1777. Connected with error.pcapng the device is connected there, but with the error described in the header

    The question I have is this:
    The problem occurs after connecting. There is a connection, but the problem arises at the security check stage. Devices exchange this information after connecting and the sniffer does not see these packets. Is there any way to see what is happening at this moment?

    And in which program to open a * .btt file?

    Now I will try to find another ble device and try to connect.

    P.S. I figured out the sniffer nRF_Sniffer_UG_v2.2.pdf

    Here is the capture file Connected with errorFULL.pcapng

Children
  • Hi,

    Yury Morgunov said:
    Is there any way to see what is happening at this moment?

    Looking at "Connected with errorFULL.pcapng" everything seems normal to me. the CONNECT_REQ in #479, followed by MTU update, service discovery, bonding. Then many empty packets (as you would expect to keep the connection active). The encrypted (non-empty) packets are not decrypted by the sniffer, which is a bit odd since the sniffer should be able to sniff the key exchange and decrypt the packets (for legacy pairing as is used here, not LESC). That is likely a problem with the sniffer, though.  

    Yury Morgunov said:
    And in which program to open a * .btt file?

    Sorry, I forgot to mention that. You can view the files with the Ellisys SW. You need to register to download the SW, but it is free to use.

    As you can see from my Ellisys trace, it looks very much like yours, except that the sniffer was able to decrypt the encrypted packets. This trace shows the whole process from connecting and pairing to some button presses.

  • Hi!,

    I noticed that from one of the devices with macOS (Catalina) when connecting to the device, no packets are visible at all in Wireshark. macOS writes connecting and there are no packages in Wireshark. There is no connection either.
    On mac mini (High Sierra) on which I am testing everything, I connected an old version of our device with nrf51 and sdk12 (not sure), which is being developed in VisualStudio. HID worked perfectly on it.
    Therefore, I am testing the connection on it.

    As it turned out, the device connects to windows without problems. I checked on my laptop and from work. The first time, probably, the driver failed.

    Unfortunately, I still have not received a response from Ellisys. Accordingly, I could not read your logs.
    Therefore, I compared the record with the connection to the ipad.
    8750.connect_to_mac_mini.pcapng
    3652.connect_to_ipad.pcapng

    It can be seen that after initiating the exchange of IRK and LTK keys (ipad - packet number 4099) (mac mini - packet number 18854). Received packages are very different.
    As I understand it, after the key exchange, the process of reading the reading of the characteristics from the peripheral device begins.
    Apparently for some reason, mac mini cannot read them. Probably due to some kind of security error.
    Why this happens, I don’t understand at all.

  • Hi,

    Comparing the two sniffer traces the second connection in 8750.connect_to_mac_mini.pcapng is quite similar to 3652.connect_to_ipad.pcapng. There is a difference when pairing is done compared to completing service discovery, but that should not matter. I have also tested this on an old Mac mini with High Sierra, and I am still not able to reproduce the issue. It is strange that the sniffer traces look sensible and that I am not able to reproduce it.

Related