peripheral_hids_keyboard only works with some hosts

Hi there,

I'm running the peripheral_hids_keyboard sample of the nRF Connect SDK 2.5.1 on my nRF52840-DK. After pushing button 4, advertising starts as expected, but I can only connect with some of my phones/tablets.

I can connect with:
- OnePlus 9 Pro phone running Android 13
- Huawei P20 Pro running Android 10

I can't connect with:
- MacBook Air running macOS Ventura 13.6.3 - After pressing the Connect button, a progress indicator shortly appears and then disappears.
- Huawei MediaPad M5 lite 10 tablet running Android 8.0.0 - Upon trying to pair, I get the "Pairing failed. Incorrect pairing key or the device you want to pair with is configured incorrectly" message.
- NPad-Pro tablet running Android 12 - "Pairing..." momentarily appears, then disappears.

The sample doesn't show up in the Bluetooth devices list:
- ThinkPad T520 running Windows 20 Pro 22H2

Can you reproduce such discrepancies across various hosts, and can you make them connect?

Parents
  • Hi Mlac, 

    Do you have any modification to the sample ? Do you use any filter accept list  ? 

    Do you see any log on the NRF52 when you try to pair from those it can not connect ? 

    I would suggest to try capture a sniffer trace so that we can inspect further. 

  • Hi Hung,

    - As it turns out, the NPad-Pro tablet is a piece of crap that doesn't pair with any keyboard. :)
    - The ThinkPad T520 doesn't list other BLE keyboards either. I think it has a Bluetooth classic module that doesn't support BLE.
    - The Huawei MediaPad M5 lite 10 tablet actually works with the peripheral_hids_keyboard sample. I'm unsure why it didn't work the last time.

    This leaves us with the MacBook Air running macOS Ventura 13.6.3. When trying to connect, I can see the following in the console:

    Connected 10:B5:88:72:9A:E6 (public)
    W: Ignoring data for unknown channel ID 0x003a
    Disconnected from 10:B5:88:72:9A:E6 (public) (reason 19)

    Does the above ring a bell? (I've installed the sniffer, but filtering the device seems a bit tricky. I can try to capture a trace if still needed.)

    Thanks for everything!

  • Thanks for explaining what `nrfjprog --recover` does, Hung. It makes sense.

    The nrf_desktop sample did work. I can connect it to my Mac, and the mouse pointer moves when pressing the buttons.

    The peripheral_hids_mouse sample still doesn't work, even if I run `nrfjprog --recover` before flashing it, and my Mac doesn't remember any pairing information from before because when it does, it always offers to forget it for the device.

    Would you be able to test peripheral_hids_mouse on a Mac? I use a MacBook Air M1, 2020 running macOS Ventura 13.6.3, but any new Mac with an M chip should work.

  • Hi Mlac, 
    I'm not so familiar with MAC device, but I did a test on a Macbook Air here and saw the same issue. 
    Doesn't seem pairing is occurring. I will need to check internally here to see why. 
    My suggestion in the mean time is to take a look at the nRF Desktop and check why it works with nRF Desktop but not the BLE mouse sample.

  • Thanks for confirming this bug, Hung. I will work on other parts of my project until this gets fixed.

    I keep this conversation unresolved until the issue gets fixed.

  • Hi mlac, 
    Could you try testing the peripheral_hids_mouse again , this time with 

    CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y 
    It seems to work for me. 
  • Hi Hung,

    The CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT option is enabled by default in the prj.conf of the peripheral_hids_mouse peripheral_hids_mouse sample, so I don't understand what has changed.

    You wrote earlier that you could also reproduce this issue. I assume you haven't changed the CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y option either when testing the peripheral_hids_mouse sample.

Reply
  • Hi Hung,

    The CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT option is enabled by default in the prj.conf of the peripheral_hids_mouse peripheral_hids_mouse sample, so I don't understand what has changed.

    You wrote earlier that you could also reproduce this issue. I assume you haven't changed the CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y option either when testing the peripheral_hids_mouse sample.

Children
Related