[nRF Connect SDK] Pairing failure

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v2.0.0

original case
(+) [nRF Connect SDK]Force to make pairing(bonding) - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)

Here is my test step. (Nordic: peripheral role)

1) Nordic begins advertising (custom UUID like peripheral_uart sample)
2) Android app gets predefined bt mac (example 00:16:7F:11:22:36).
There were no BLE scan. and connect to Nordic.

3) Nordic connected and initiate pairing
bt_set_bondable(true);
bt_conn_set_security(conn, BT_SECURITY_L4);

Result
Much of case my Android (MTK) failed to make pairing. (Especially right after android rebooted) 

MTK have told me Nordic should provide solution to resolve this issue.

RTT Viewer
00> Connected secmode 4
00> HS connected
00> HS Connected 00:16:7F:40:1E:D0 (public)
00> D:
00> D: 00:16:7F:40:1E:D0 (public)
00> D: prnd 7d93ec3b4828ce3b4210d054f903653a
00> D: chan 0x20001f54 cid 0x0006
00> D: status 0x8
00> D: chan 0x20001f54 conn 0x20001c90 handle 0 encrypt 0x00 hci status 0x1f
00> Security failed: 00:16:7F:40:1E:D0 (public) level 1 err 9
(Android public mac 00:16:7F:40:1E:D0)

2772.sf650_error_03Nov2022.7z



BTW, Nordic required sniff log for analyzing pairing error. However, I hardly get sniff log.
I can get CONNECT_IND then drops next packets. Do you have any idea?






nrf_sniffer_for_bluetooth_le_4.1.1
wireshark 4.0.1
nRF52DK dev borad
J-Link 6.88a


  • One more question:

    6. If you add CONFIG_BT_SMP_ENFORCE_MITM=n to your app, can pairing consistently work?

  • Thank you for your kind response.

    0. For app log: 
    nRF Connect, 2022-11-14
    Nordic_UART_Service (00:16:7F:11:22:36)
    V 14:27:21.563 Connecting to 00:16:7F:11:22:36...
    D 14:27:21.564 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D 14:27:22.357 [Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E 14:27:22.357 Error 133 (0x85): GATT ERROR
    I 14:27:22.357 Disconnected

    1. Can your Android app or device consistently successfully pair with any BLE device? A BLE mouse, for example?
    -> Pairing failed at first time after reboot or Bluetooth turned on. I try again, pairing works. 

    2. Can your current nRF52 device consistently successfully pair with any Android/iOS/Windows device?
    -> If nRF52 device means my project, the answer is Yes.

    3. Are you working in an environment with a lot of 2.4GHz signals?
    -> It is noisy somehow. But other Androids work well. Noise does not matter, I guess.

    4. Is there any reason why you push aside my request for sniffer logs with the pairing procedure?
    -> I spent lots of time for taking sniffer log. But I could not get air log well. so I asked logging know-how.

    5. Can you also zip up and send us the modified peripheral_uart project which you are using? You can use west build -t clean to remove all build artifacts to keep the file light.
    -> peripheral_uart_1114_MTK.case.7z

    6. CONFIG_BT_SMP_ENFORCE_MITM=n
    -> It seems that there was no difference.
    ----------------------------------------------------------------------------------

    1. "hci status 0x1f"
    12 days ago, I had no idea about "hci status 0x1f" so I made this case
    D: chan 0x20001f54 conn 0x20001c90 handle 0 encrypt 0x00 hci status 0x1f

    Now I understand where 0x1f is from. And you told me what 0x5 is too.
    And I could get event 0x5 with unexpected Android disconnection (for example I put it shield box)
    00> [00:02:19.647,460] <dbg> sdc_hci_driver: event_packet_process: Event (0x05) len 4

    2. "No pairing reponse"
    1) Nordic sent security request,
    2) MTK send pairing request,
    3) but Nordic did not send pairing response.

    In sf650_error_03Nov2022.pcapng, we could see this symptom in this log.
    (Unfortunately, Sniff logs are different every time with Nordic sniffer, Lots of packets are dropped)
    In this case, RTT log had Event(0x5) but air log shows MTK send packets to Nordic.
    What do you think about that? 

    5466.sf650_error_03Nov2022.pcapng


    3. Work with MTK
    This issue already reported to MTK and I provided Nordic nRF52 DK Ev board with my code
    (peripheral_uart_1114_MTK.7z) They will get it soon. And test it by themselves. 




  • 6. CONFIG_BT_SMP_ENFORCE_MITM=n
    -> It seems that there was no difference.

  • Hi Tim,

    My apology for the long wait with no follow up.

    I am having some health issues and will likely be out of office for a few more days.

    I will let you know when I can reply to your question as soon as possible.

    Hieu

  • I hope you get better. 

    I sent Nordic Evaluation board to my partner in China, and they can reproduce this issue.
    Further analysis is delayed due to covid19 in China. I will ask you again when MTK request is arrived.
    I'll hold this case until then.

    Thank you.

Related