nRF SDK 3.0.1, bluetooth peripheral_hid_mouse example fails in connecting windows10 laptop

Development Environment

    - nRF52840DK_nRF52840

    - vscode on Windows10 laptop

    - source code :   C:\ncs\v3.0.1\nrf\samples\bluetooth\peripheral_hids_mouse\

    - vscode + nRF connect

    - no modification on source code and project files

    - compile with default configuration

        - SDK, toolchain  v3.0.1

        - board target   nrf52840dk/nrf52840

        - (no additional settings)

                 Build system default   (which is the default setting)

    - Compile and flash run without error

With Android phone

- Everything is okay

With Windows10 laptop

- Scanning the device runs okay

- But, when I tried to pair, the device print the log as below capture and the pairing failed. 

Does anyone have idea what is wrong in my test ?

Regards,

Kenny

Parents Reply Children
  • Hi bluemountain and Turbo J,

    Turbo J said:
    The pairing to the android phone was still in the device memory, you don't want that specifically for any HID device. Those rely on a 1:1 relationship with the host.

    So, I only partially agree with this.

    Firstly, regarding connection, connecting to multiple centrals is technically possible. Multi device control is a real use case that has been done. I personally haven't been convinced of its usefulness to my day-to-day workflow, but I can see how some people might find it useful.

    Secondly, maintaining multiple bonds with multiple centrals is definitely useful. It allows faster switching of which central the HID device connects to.

    Onto the issue, I went ahead and tested the sample myself. I don't have a Windows 10 machine, but my Windows 11 machine paired/bonded with the sample just fine. Here is a log of the device first paired with my phone and then with my laptop. The centrals' identity addresses are redacted.

    *** Booting nRF Connect SDK v3.0.1-9eb5615da66b ***
    *** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
    Starting Bluetooth Peripheral HIDS mouse sample
    I: 2 Sectors of 4096 bytes
    I: alloc wra: 0, fd0
    I: data wra: 0, 1c
    I: SoftDevice Controller build revision: 
    I: 89 9a 50 8a 95 01 9c 58 |..P....X
    I: fc 39 d2 c1 10 04 ee 02 |.9......
    I: 64 ce 25 be             |d.%.    
    I: HW Platform: Nordic Semiconductor (0x0002)
    I: HW Variant: nRF52x (0x0002)
    I: Firmware: Standard Bluetooth controller (0x00) Version 137.20634 Build 2617349514
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    I: Identity: E0:FC:C7:9A:53:D1 (random)
    I: HCI: version 6.0 (0x0e) revision 0x10f3, manufacturer 0x0059
    I: LMP: version 6.0 (0x0e) subver 0x10f3
    Regular advertising started
    Connected 60:58:BE:94:11:13 (random)
    Regular advertising started
    Passkey for 60:58:BE:94:11:13 (random): 885359
    Press Button 1 to confirm, Button 2 to reject.
    Numeric Match, conn 0x20002170
    Security changed: 60:58:BE:94:11:13 (random) level 4
    Pairing completed: an:dr:oi:d4:3D:3C (public), bonded: 1
    button_changed(): left
    button_changed(): left
    button_changed(): up
    button_changed(): up
    button_changed(): right
    button_changed(): right
    button_changed(): right
    button_changed(): down
    button_changed(): down
    button_changed(): left
    button_changed(): left
    Disconnected from an:dr:oi:d4:3D:3C (public), reason 0x13 
    Direct advertising to an:dr:oi:d4:3D:3C (public) started
    Direct advertising to an:dr:oi:d4:3D:3C (public) timed out
    Regular advertising started
    Connected wi:nd:ow:s4:7E:A8 (public)
    Direct advertising to an:dr:oi:d4:3D:3C (public) started
    Direct advertising to an:dr:oi:d4:3D:3C (public) timed out
    Regular advertising started
    Passkey for wi:nd:ow:s4:7E:A8 (public): 640090
    Press Button 1 to confirm, Button 2 to reject.
    Numeric Match, conn 0x20002170
    Security changed: wi:nd:ow:s4:7E:A8 (public) level 4
    Pairing completed: wi:nd:ow:s4:7E:A8 (public), bonded: 1
    I: BAS Notifications enabled
    button_changed(): left
    button_changed(): left
    button_changed(): left
    button_changed(): up
    button_changed(): up
    button_changed(): up
    button_changed(): right
    button_changed(): right
    button_changed(): right
    button_changed(): down
    button_changed(): down
    button_changed(): down
    button_changed(): down

    Regarding connection, the sample is actually configured to allow connection with two centrals. 
    I am quite surprised to see that possible but couldn't get it to work very well. My Android phones always get disconnected due to 0x2A. This seem to be a problem with my phone though, so I don't draw any conclusion here. It's besides the current topic anyway.

    Turbo J said:
    Try a chip erase / recover to get rid of the android bonding information.

    I second this recommendation. Let's see if a "fresh" device can pair with the Windows machine in the first place. Please also try a different Windows machine, preferably of different make, if possible.

    Hieu

Related