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

Parents
  • Hello,

    I did a quick test on ncs v2.5.0, where the only modification I did was to disable NFC_OOB_PAIRING in kconfig

    It seems to work with both my iPhone 15 pro and my Windows desktop. Though make sure to press button 1 to bond, ref:

    Kenneth 

  • hello,

    As I was saying last time I have problem using ble samples. I can't bound to any windows (10&11) computers and had issues with an android smartphone too. 

    In my open space we have 5 computers, 4 on Windows 10 and 1 on Windows 11. On all that computers I can bound with only one and it was difficult, I had to try to connect around 5 or 6 times before it asks me the sequence with the passkey, every other times it ended up in "Try to reconnect your device".

    Using the zephyr bluetooth LE controller instead of the SoftDevice Controller resolved my problems. 

    The thing is, I would prefer to use the SoftDevice Controller since Nordic designed it for nFR series and I think it would be simplier if I need support in the future. 

    So, I've setup your sniffer with wireshark and here is my LOGs : 

    Radio_frame_windows_10 : 

    LOG from the board : 

    Radio_frame_windows_11 : 

    Log from the board : 

    Wireshark file from windows 11 bounding try :   windows_11_frame.pcapng

    Seems I have been able to work with the zephyr controller I mooved on and satrted developping my application, but I had an other issue . Seems my peripheral doesn't have IO or Display I need a Just Works pairing with the central. To do that I deleted the lines : 

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

    If I use those options I can't connect to any central in Just Works, I have to enable the passkey pairing which I don't want.

    I have the problem with both Zephyr and Nordic Controler.

    Do you have ever heard of this problem ?This is kind of a big deal seems i need those options to reconnect to a central after a reset.

    I am using SDK v2.3.0 since v2.5.0 does not solve any of my issues.

    Best regards

    Thibaud

  • What can you tell me about the nRF52840-DK you are using? Version and pca number?

    Kenneth

  • Hi

    It has always been working on iPhone the problem came with Windows. I have the same behavior with the sdk v2.5.0 and NFC_OOB_PAIRING disable. 

    I tried with two nRF52840dk : v2.0.1 - 2020.37 and v3.0.1 - 2023.14 both PCA10056

    Radio_frame_windows_11 : 

    Note that we see here that the peripheral rejected the pairing, not the central.

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

    Did you look into this ?

    Regards

    Thibaud HABRAND

  • 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

Reply
  • 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

Children
  • 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
  • I will try this afternoon if it help me to decrease CONFIG_BT_MAX CONN & CONFIG_BT_MAX_PAIRED to 2, because I don't have anymore the phone which is causing me troubles. 

    But it did not help me to go back to the SoftDevice Controller. I still need Zephyr controller to be able to bound with Windows computer

    Regards

    Thibaud

  • The only two you should need are really:

    CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
    CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y

    Also, maybe the Windows PC's you have issue with le secure connections, it should be possible to disable le secure connection by for instance using:

    BT_TINYCRYPT_ECC=n
    BT_CTLR_ECDH=n

    I rather you experiment with this than you start modifying the application in any way. I am not able to see anyone else reporting your problems, so I still suspect it is something in specific at your end that cause this.

    Kenneth

  • Hi

    I need secure connection for HID keyboard on iPhone.

    I also spend a lot of time on the devzone searching for someone with the same problem and I didn't find anyone.
    Which I do not understand because I tried to flash the sample from a couple of computer and with all recent sdk versions and everytime it ended up the same. I can't connect to Windows PC. We have 5 PC in the room, every one on windows and  I can connect to only one, after a lot of try.

    I tried to flash the sample with the programmer in nRF Connect for Desktop and same issue.

    This issue is annoying me a lot, I saw on the devzone that Nordic does not certify Zephyr Controller on nRF series and my product need to be certify.

    Do you know anything about disconnection for reason 8. I know it is BLE_HCI_CONNECTION_TIMEOUT  but I do not change anything in this part so it should not be a problem isn't it ?

    At this moment the LOGs when I try to connect to my PC  are : 

    Sometimes it is reason 19 (0x13) as I send at the begining of this case, and sometimes it is 8.

    Regards

    THibaud

Related