"Driver Error" when trying BLE HIDS mouse example disabling SMP

Hi! 

I have a working example of BLE HIDs mouse in nRF52DK. I changed the HID report and works ok in Windows 10.

My problem is I need to connect to PC without confirming connection from MCU side. I tried disabling SMP and it connects automatically, but then after a few seconds, Windows shows "driver error"

Any suggestion? Is it possible to pair with Windows without SMP? Any way to use SMP and automatically accept connection? Any way to do not see the confirmation numbers from Windows?

Thank you!

Pedro.

Parents
  • Hi Pedro, 

    By spec, the communication between a HID device (mouse/keyboard) and the host must be encrypted. It's not allowed to have open connection for a mouse/keyboard for security reason. So Windows expect the device to support SMP (pairing) if the device doesn't have it supported Windows will display "Driver error". 

    One option I can think of is to run your own application on Windows. Then you can make your device connect to Windows via the app. It doesn't need to be HIDs hence doesn't require encryption. Your app on Windows should be incharge of converting BLE data to mouse/keyboard input to Windows. 

  • Hi Hung Bui,

    Thank you for your answer. I need to use HID so I will enable SMP and automatically accept connection from MCU.

    Is there any way to do not show "Numeric Match"? 

  • Hi Hung,

    I've done it, commenting out display and keyboard callbacks, and commenting out all functions related to mitm management. And now I have two problems:

    1- If I just do that, it can't be paired to Windows. 

    Connected 00:1A:7D:DA:71:15 (public)
    Security failed: 00:1A:7D:DA:71:15 (public) level 1 err 4
    Disconnected from 00:1A:7D:DA:71:15 (public) (reason 19)

    Then I have to disable CONFIG_BT_SETTINGS and CONFIG_SETTINGS in prj.conf and it can connect and be paired (But then never connects automatically).

    2- Although it is connected successfully, mouse does not work.

    I don't know why. I call hid_init() after bt_enable(NULL), and then in ble connected callback, I call bt_hids_connected(). 

    Please I need some help.

    Thank you and kind regards,

    Pedro.

  • Hi Pedro, 
    Have you tried to test with the default peripheral_hids_mouse examle in nRF Connect SDK ? 


    I did this modification: 

    And it worked fine with my Windows machine. The device can be paired/bonded with Windows without the number confirmation.

     I attached here the hex file that worked for me on a nRF52832 Dev Kit. It compiled with nRF Connect SDK v2.3

    0118.zephyr.hex

    If it works please check what's the difference between your project and the sample in the SDK. 
    Notice : CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y  in prj.conf. 

    Note that if you disable CONFIG_BT_SETTINGS and CONFIG_SETTINGS , it will not able to re-connect as the bond information is not stored in flash. 

  • hi Hung,

    I've done same than you in a nRF52DK and it works. I have to check the differences and why it is not working in my Nicla Sense Me board.

    Now something very strange happened. Maybe you can help me.

    To program nRF52832 in Nicla Sense Me board I'm using a Segger J-LINK programmer/debugger. Now it is not detected by Nordic pluggin in Visual Studio Code, but it is detected by PC and I can use it with Segger utilities.

    When I press refresh button in NRF CONNECT: CONNECTED DEVICES, J-link led blinks, as it is having some kind of communication, but it is not detected by Nordic pluggin.

    I've restarted PC and reinstalled Nordic vscode pluggin. Also tried with another USB cable.

    It happened suddenly. Any idea?

    Thanks again!

  • Hi Pedro, 


    Did it work before ?  Or it has always been like that ? 

    Which Jlink you used ? In my computer it does show up in CONNECTED DEVICES regardless if I connect the debugger to a external board or not. 


    Could you try doing debugging and programming via our DK (that connect to your custom board via Debug Out) ? 


  • Yes it worked before. It always worked. Just suddenly stopped appearing in available devices.

    In my computer it does show up in CONNECTED DEVICES regardless if I connect the debugger to a external board or not

    Mine had same behaviour when it worked. I have J-Link BASE Classic.

    Could you try doing debugging and programming via our DK (that connect to your custom board via Debug Out) ?

    I can do that, but I'd prefer to use J-Link.

    It's very strange. I don't know what more to do. Maybe clean uninstall and reinstall of vscode?

Reply
  • Yes it worked before. It always worked. Just suddenly stopped appearing in available devices.

    In my computer it does show up in CONNECTED DEVICES regardless if I connect the debugger to a external board or not

    Mine had same behaviour when it worked. I have J-Link BASE Classic.

    Could you try doing debugging and programming via our DK (that connect to your custom board via Debug Out) ?

    I can do that, but I'd prefer to use J-Link.

    It's very strange. I don't know what more to do. Maybe clean uninstall and reinstall of vscode?

Children
Related