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

  • Hi, 

    Disconnect reason 19 is GATT_CONN_TERMINATE_PEER_USER. Seems like the Macbook proactively disconnect . We will need to take a look a the sniffer trace. Any chance that it was paired with the keyboard before and tried to use old bond information?

    Have you tried with the default keyboard example ?

    mlac said:
    Ignoring data for unknown channel ID 0x003a

    This is just some proprietary thing Apple does and usually get ignored by the peer if it doesnt support this

  • If the sample was previously paired to the MacBook, I should see an icon that allows me to unpair it. But I can't see such an icon.

    Attached are the captured packets. I took the following steps to export them:

    1. I pressed button 4 on the dev board to start advertising
    2. At this point, on the Macbook, the Nordic_HIDS_keyboard shows up
    3. I start the capture
    4. On the Macbook, I tried to connect to the dev board, and it immediately disconnected (assuming it connected at all)
    5. I stopped the capture
    6. I entered the following Wireshark filter: btle.advertising_address == ea:28:02:bf:ad:1b
    7. I selected the filtered packets and used the "File -> Export Specified Packets -> Selected packets only" feature to export the file.

    hids-keyboard-mac.pcapng

  • Hi Mlac, 

    The trace unfortunately doesn't contain much useful information. The reason is that the nRF Sniffer can't capture all connections simultaneously like other professional sniffer. It can only follow one connection at a time. You would need to select the device prior to the connection. 
    There is a device dropdown list that you need to use to select the device. 
    Please follow our guide here: academy.nordicsemi.com/.../

  • Thanks for your further instructions, Hung!

    I've made another capture based on the instructions. Is it useful this time?

    mac.pcapng

Related