Cannot run sample: Peripheral HIDS mouse on nRF52 Dongle

Hi,

While I understand that the sample code is not intended for the nRF52 Dongle, I am still wondering if I can make it work on it.

I have successfully tested it on the nRF52DK with nRF52832.

First, I used a custom overlay for device tree to deal with the issue where Dongle only has 1 button while the DK has 4

I had no problem building and flashing the app.

However, when I got the following serial print from the nRF52 Dongle during the pairing:

*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
Starting Bluetooth Peripheral HIDS mouse example
I: 4 Sectors of 4096 bytes
I: alloc wra: 0, e70
I: data wra: 0, 324
I: SoftDevice Controller build revision:
I: d6 da c7 ae 08 db 72 6f |......ro
I: 2a a3 26 49 2a 4d a8 b3 |*.&I*M..
I: 98 0e 07 7f |....
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: EE:F5:A3:B1:C2:53 (random)
I: HCI: version 5.4 (0x0d) revision 0x11fb, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x11fb
Regular advertising started
Connected 04:CF:4B:E5:1B:8A (public)
Regular advertising started
Passkey for 04:CF:4B:E5:1B:8A (public): 511736
Press Button 1 to confirm, Button 2 to reject.
Numeric Match, conn 0x20002030
Security changed: 04:CF:4B:E5:1B:8A (public) level 4
E: pairing failed (peer reason 0x8)
Disconnected from 04:CF:4B:E5:1B:8A (public) (reason 19)

During pairing, right after I both clicked accept on Windows11 and pressed the button on the dongle, it says

E: pairing failed (peer reason 0x8)
Disconnected from 04:CF:4B:E5:1B:8A (public) (reason 19)

Could you help me with this issue? Thank you!

  • Hi

    Just to confirm, you have set up the button on the Dongle to work as the "confirm" button during pairing, right? And then press it when the pairing prompts you to. The pairing failed reason seems to point to a timeout while the disconnect reason is pointing towards the remote user terminating the connection, so whatever you're trying to connect/pair to is deciding to disconnect. Likely because the pairing timed out. Can you share some details on what device it is that's functioning as the central here? A phone, a DK or computer? Does it have a log that might show of what's going wrong?

    Best regards,

    Simon

  • you have set up the button on the Dongle to work as the "confirm" button during pairing, right?

    Yes

    I was using a Windows11 device. I was in system's bluetooth setting page.

    When I see the pairing numbers, I clicked accept on the computer first, then press the button.

    The same procedure worked for nRF52DK, but not for the nRF52840 Dongle

  • Hi

    Then I'm inclined to think that the button on the Dongle is not set up correctly as "button 1" in the sample. Have you made sure to change the main file so that the pairing check actually polls the status of the correct pin for the Dongle's button, and that you build the sample for the nRF52840 Dongle board so the button is set correctly there.

    Best regards,

    Simon

  • Hi,

    In my understanding, since the Serial Print said

    "Numeric Match, conn 0x20002030
    Security changed: 04:CF:4B:E5:1B:8A (public) level 4
    "

    That means the "accept" buttons has been pressed successfully, right? 

  • Seems like it, but it is still the pairing itself that is failing, so they don't actually reach the pairing status. Are you able to debug and find from what function this pairing failed error is triggered, or where it stops during pairing before it times out I guess is more correct. Could be that the service discovery is what is taking long and just timing out, but it's hard to say with just these messages. Have you set enabled any debugging logging to get more details on what's going on. Debugging in nRF Connect SDK is very well described in lesson 2 of our NCS intermediate course on the DevAcademy.

    Another idea could be to sniff the connection using a spare nRF52 DK and the nRF Sniffer firmware and Wireshark to see what's going on over the air, as that might point out what is causing the pairing process to time out and fail like this.

    Best regards,

    Simon

Related