Enable to pair between my computer on windows and my board runing the ble sample peripheral_hids_keyboard

Hi

I am using the sample peripheral_hids_keyboard on nRFconnect with toolchain and SDK @ V2.3.0

Using the sample, I've been able to connect and bound with this smartphone : 

I've also been able to bound with an iPhone 11 pro on ios16, after modifing this macro : OUTPUT_REP_KEYS_REF_ID from 1 to 2 (so it is not the same ID as INPUT report)

But I can't connect with a portable computer, I've tried with one on Windows 10 and one on Windows 11. 

Here the log when I try to connect with the PC on Windows 11 : 

As you can see, I've tried to connect 2 times but it failed both. 

I've also can't connect with an Android 13.

Best regards,

Thibaud

  • Did you flash the sample using VS Code, shell commands or the programmer ?

  • But I had to disable the options  CONFIG_BT_SETTINGS and CONFIG_SETTINGS too so it works.

    Did you look into this ?

    Hi, 

    Instead of deleted .passkey_display and .passkey_confirm in the struct conn_auth_callbacks, I deleted this lines in the main and it seems to be ok when I bound in just works with bt_setting enable : 

    I will let you know if this problem comes back.

    Best regards

    Thibaud

  • Hello, 

    Little update, with Zephyr controller, CONFIG_BT_SETTINGS enable and the lines I showed you in comment, I can process just works pairing with Windows computers and phones which I can't when I started this case. 


    But, when I try to connect to the phone which was okay when I started this case it does not work and say "enable to pair with 'BT_DEVICE_NAME' because of a wrong PIN or security key". And I have this LOG from my board : 

    Note : I have the same behavior either the controller I use (Zephyr or SoftController). 

    Disable CONFIG_BT_SETTINGS solves the issue but I need this option.

    EDIT : increase CONFIG_BT_MAX CONN & CONFIG_BT_MAX_PAIRED from 2 to 3 solves the problem but the relation between the solution and the problem is weird so I let the post so you can try to reproduice it.

    Regards

    Thibaud

  • Maybe the original problem you have are due to some existing bonds exists, and you thereby is not able to overwrite them (for security reasons), can you go back again to the default example, and add the following to your prj.conf:

    CONFIG_BT_ID_UNPAIR_MATCHING_BONDS=y
    CONFIG_BT_ID_ALLOW_UNAUTH_OVERWRITE=y
    CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
    CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y

    Kenneth

  • Hello

    I will try to add all, in my application I already added

    CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
    so I can re bound after forgetting  the peripheral from the central.
    Note that I can't enable CONFIG_BT_ID_ALLOW_UNAUTH_OVERWRITE and CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE at the same time
    Regards
    Thibaud
Related