"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"? 

  • When did it stopped working, is it when you disconnect the mouse from the PC , or it's when you turn off and on the mouse ?

    First, I tested a clean example in nrF52DK with display and keyboard callbacks commented out and worked fine. Then I copied exact that code to my project with custom board and also worked.

    Seeing it worked, I commited the project. Then I commented out some code about reading buttons to move the cursor and build and flashed the code, and stopped working.

    It was strange because that code had nothing related to BLE. I reverted the changes, and with the code exactly the same as before, it never worked again.

    I tried a new clean example with the DK, commented out the 2 lines and didn´t work.

    And everything works fine if you enable passkey ? 

    Yes, if I enable passkey it works. After disabling passkey I remove (unbond) the device from the PC.

    Have you managed to re-connect after disconnect ? 

    Yes, many times and always receive error in log.

    Have you tried to test on other PC just to check if it's the PC issue or it's the nRF5 issue ?

    I tried in 2 PCs (One with ble 5.2, other with 4.0) and with one mobile phone (not sure if hid mouse is compatible with android phone).

    I also tried with ncs v2.0.2 and ncs v2.3.0

  • Hi Pedro, 

    I would suggest to do a full erase of the chip before testing. On PC, in addition to remove bonding please also try reset the device. 

    Could you try capture a sniffer trace when the issue happen ? 

    The error:
    Security failed: 00:1A:7D:DA:71:15 (public) level 1 err 4
    means: 

        /** The requested security level could not be reached. */
        BT_SECURITY_ERR_AUTH_REQUIREMENT,
    This suggests that there is an issue with the level of security, most likely one of the peers require MITM protection which your device doesn't support (no display or keyboard). 

    This is pretty strange as most mouse doesn't have keyboard or display. 

    Could you clarify, on the first time when it worked, did you turn it off and on and it still worked ? I'm interested in if it can re-connect and re-encrypt the link when it worked. 
  • Hi Hung,

    I would suggest to do a full erase of the chip before testing.

    That was the problem! I thought when flashing from vscode and says in first step "Erase file" it erased the chip fully, but no. I "Erased all" from nordic programmer and then flashed again and now it works!

    I think it had in the memory some bond data from when it was paired using mitm and that was the problem.

    Can I suggest adding "Erase all" option in vscode pluggin?

    Again, thank you very much Hung. You've helped me a lot.

    Kind regards,

    Pedro.

  • Hi Pedro, 
    Good to know that you found the issue. 
    As far as I know if you click on the two arrows button, the flash will be fully erased before flashing: 

  • Thank you Hung! I didn't notice that two arrows button.

Reply Children
No Data
Related