[nRF Connect SDK]Force to make pairing(bonding)

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v2.0.0

I'm testing NCS 2.0 with Android 12.

Making pairing with Android, I call two API when connected.

bt_set_bondable(true);
bt_conn_set_security(conn, BT_SECURITY_L4);

It worked well so far (under Android 11)

BTW Android 12 make trouble security level 1 error.


[log]
00> HS connected
00> HS Connected 4A:B4:CA:22:85:2D (random)
00> Connection parameters updated.
00> interval: 6, latency: 0, timeout: 500
00> Conn params updated: interval 7 ms, latency 0, timeout: 5000 ms
00> Security failed: 4A:B4:CA:22:85:2D (random) level 1 err 2
00> Disconnected: 4A:B4:CA:22:85:2D (random) (reason 34)

Can I have another option to make pairing automatically?

  • Hello,

    I can't find anything wrong with how the peripheral device behave here, so the problem seem to be on the central side. From what I can see from your description some rather old phones show the issue, and it's not a generic Android 12 issue. The problem seem to only occur on first bonding attempt, and the second one works. It only seem to occur after bootup and after scan BT off/on. I can understand that this may be a hazzle for anyone having those phones, but I don't see any additional tasks I can do on this issue. I think it is a good idea to report it to the phone vendor so they may look into improving it. 

    Best regards,
    Kenneth

  • Okay. I'm waiting for MTK HQ reply. It will be updated when ready.

    Thank you.



    • MTK asked me why BLE did not response for "LL_FEATURE_REQ" 5 seconds.
      In RTT log, no specific operation was found for 5 seconds
      Can you please explain it?

      00> [00:00:00.068,420] <dbg> bt_smp: bt_smp_pkey_ready:
      00> [00:01:19.375,610] <dbg> bt_keys: bt_keys_find_irk: 5D:DF:91:AC:9C:62 (random)
      00> [00:01:19.375,854] <dbg> bt_keys: bt_keys_find_irk: No IRK for 5D:DF:91:AC:9C:62 (random)
      00> [00:01:19.375,915] <dbg> bt_conn: bt_conn_ref: handle 0 ref 1 -> 2
      00> [00:01:19.375,946] <dbg> bt_conn: bt_conn_unref: handle 0 ref 2 -> 1
      00> [00:01:19.375,946] <dbg> bt_conn: bt_conn_ref: handle 0 ref 1 -> 2
      00> [00:01:19.376,037] <dbg> bt_conn: bt_conn_set_state: connecting-adv -> connected
      00> [00:01:19.376,068] <dbg> bt_smp: bt_smp_accept: conn 0x200038a0 handle 0
      00> [00:01:19.376,098] <dbg> bt_smp: bt_smp_connected: chan 0x20003b64 cid 0x0006
      00> [00:01:19.376,464] <dbg> bt_keys: bt_keys_find_addr: 5D:DF:91:AC:9C:62 (random)
      00> [00:01:19.376,800] <inf> peripheral_uart: ####Connected 5D:DF:91:AC:9C:62 (random)
      00> [00:01:19.376,831] <dbg> bt_conn: bt_conn_ref: handle 0 ref 2 -> 3
      00> [00:01:19.377,319] <dbg> bt_conn: bt_conn_prepare_events:
      00> [00:01:19.377,380] <dbg> bt_conn: conn_prepare_events: Adding conn 0x200038a0 to poll list
      00> [00:01:19.377,929] <dbg> bt_conn: bt_conn_prepare_events:
      00> [00:01:19.377,929] <dbg> bt_conn: conn_prepare_events: Adding conn 0x200038a0 to poll list
      00> [00:01:19.378,509] <dbg> bt_conn: bt_conn_prepare_events:
      00> [00:01:19.378,540] <dbg> bt_conn: conn_prepare_events: Adding conn 0x200038a0 to poll list
      00> [00:01:19.378,631] <dbg> bt_conn: bt_conn_unref: handle 0 ref 3 -> 2
      00> [00:01:24.376,220] <dbg> bt_conn: deferred_work: conn 0x200038a0
      00> [00:01:24.376,251] <dbg> bt_conn: send_conn_le_param_update: conn 0x200038a0 features 0x00 params (24-40 0 42)
      [nordic_log.txt]

    • Pairing_failed.7z
  • I assume because due to the master does not send anything for 100 events (~5seconds):


    The LL_FEATURE_RSP is sent on the first next connection event after LL_FEATURE_REQ is received, in this case there is 100 event gap without any communication from the central.

    Best regards,
    Kenneth

  • Thanks for updating.

    Let me tell you test steps.
    1. Nordic BLE start advertisement.
    2. Android(Nordic app) begin scan.
    3. Android(Nordic app) select "Bond" menu.

    First of all, I will forward your opinion to MTK immediately.
    BTW, from sniff.pcap file, Master is Android and slave is Nordic BLE, I think. Or let me know.
    (Slave address 00:16:7f:ab:cd:20 is nordic ble)

    In addition, my company's RF guy measured if MTK(Android)'s 2.4GHz meets the requirement. And he said it's okay. 


    Thank you.

Related