sandeepmistry / arduino-BLEPeripheral

An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
MIT License
462 stars 179 forks source link

Windows 10 Driver Error #160

Open mholin1 opened 7 years ago

mholin1 commented 7 years ago

Hello. trying to make a Bluetooth mouse/keyboard for a Windows 10 PC and starting with the "HID_test" Example from the Arduino BLEPeripheral Library on a Sparkfun nRF52832 Breakout Board using only the mouse portion of HID_test for now. The PC sees "HID" local name and starts to pair but then after few seconds displays "Driver Error" and drops the connection. A commercial Bluetooth mouse pairs and works with the same PC however.

Also found the function:

bleHID.clearBondStoreData();

from HID_test conflicts with the nRF52832 Breakout Board bootloader so just using a J-Link to program the application for now.

Hoping someone might have some insight into that Driver Error ?

sandeepmistry commented 7 years ago

@mholin1 I haven't tried this setup myself, but I recall the Windows pairing process being a bit weird compared to Android and iOS.

mholin1 commented 7 years ago

Thanks for taking a look. Someone on the Nordic Developer Zone was getting a similar "Driver Error" and the resolution seemed to be something about bonding? Admittedly I am not familiar enough with the BLE spec. or the Library to know how to implement bonding.

Also, can you say if that bleHID.clearBondStoreData(); statement is necessary for pairing? And any idea why it is conflicting with the bootloader? It looks like you are putting the bond store up at the last page of flash memory which should be fine as far as I can tell.

mholin1 commented 7 years ago

I moved the bond store to just under the bootloader (from default 0x7F000 to 0x79000) but still getting "Driver Error" messages from Windows 10 while attempting to pair. Has anybody ever used this Library successfully with a Windows 10 HID application (mouse or keyboard)?

mholin1 commented 7 years ago

Hi Sandeep,

Can you suggest any way I can get help with this? I set up Nordic's BLE Sniffer and had the Nordic guys take a look but it is not their code and so they really could not help me. Is there anyone who has used the Library on a Windows 10 HID application?

Thanks, Mark


On Sun, 6/18/17, Sandeep Mistry notifications@github.com wrote:

Subject: Re: [sandeepmistry/arduino-BLEPeripheral] Windows 10 Driver Error (#160) To: "sandeepmistry/arduino-BLEPeripheral" arduino-BLEPeripheral@noreply.github.com Cc: "mholin1" mholin@yahoo.com, "Mention" mention@noreply.github.com Date: Sunday, June 18, 2017, 10:02 AM

@mholin1 I haven't tried this setup myself, but I recall the Windows pairing process being a bit weird compared to Android and iOS.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

varunhr commented 6 years ago

Same problem with me as well..... Would some one help us with this issue?

Regards Varun

mholin1 commented 6 years ago

Hello Varun, I eventually had to give up. No real support from any entity involved. Tried the Cypress PSoC 4 parts and it works fine. PSoC Creator light years simpler development environment. Cypress tech support is as abysmal as this Nordic platform but at least the parts work as advertised.

Note: At least Nordic Tech Support tried to help but it was not their code.

RicoKirstein commented 6 years ago

I had a problem with the GATT HID driver in windows 10 as well. Uncommenting the line "bleHIDPeripheral.setReportIdOffset(1);" solved it for me.

mholin1 commented 6 years ago

Thanks for your input. I don't see that line in the original Example HID_test.ino. Is it in one of the header files? Also i do recall there was a conflict between the bootloader so moving the bond store offset to 0x79000 solved that problem but I still got the Win 10 Driver Error.

So does your device (mouse in my case) now work on Win 10? If so could you please attach your sketch?

Thanks for posting.

Mark


On Fri, 12/8/17, RicoKirstein notifications@github.com wrote:

Subject: Re: [sandeepmistry/arduino-BLEPeripheral] Windows 10 Driver Error (#160) To: "sandeepmistry/arduino-BLEPeripheral" arduino-BLEPeripheral@noreply.github.com Cc: "mholin1" mholin@yahoo.com, "Mention" mention@noreply.github.com Date: Friday, December 8, 2017, 7:24 AM

I had a problem with the GATT HID driver in windows 10 as well. Uncommenting the line

"bleHIDPeripheral.setReportIdOffset(1);" solved it for me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

RicoKirstein commented 6 years ago

I have my BLE nano 2 on a swd probe, so I haven't ran into any bootloader issued. The line was in the HID_Keyboard example. I haven't had any successful inputs send from the device yet, but the driver error went away and the device is loaded correctly according to windows. I'm currently on the windows 10 1709 thing. My sketch is just the HID_Keyboard example with the ifdef surrounding bleHIDPeripheral.setReportIdOffset(1) removed.

mholin1 commented 6 years ago

Thanks. That ifdef isn't even in HID_test. If you are having issues with Win 10 versions, I do recall one of the recent Microsoft "upgrades" no longer reports the Driver Error but the mouse still does not function. A commercial BLE mouse does function on the same PC however.

Good Luck. Please post if you find anything further.


On Fri, 12/8/17, RicoKirstein notifications@github.com wrote:

Subject: Re: [sandeepmistry/arduino-BLEPeripheral] Windows 10 Driver Error (#160) To: "sandeepmistry/arduino-BLEPeripheral" arduino-BLEPeripheral@noreply.github.com Cc: "mholin1" mholin@yahoo.com, "Mention" mention@noreply.github.com Date: Friday, December 8, 2017, 9:15 AM

I have my BLE nano 2 on a swd probe, so I haven't ran into any bootloader issued.

The line was in the HID_Keyboard example. I haven't had any successful inputs send from the device yet, but the driver error went away and the device is loaded correctly according to windows. I'm currently on the windows 10 1709 thing. My sketch is just the HID_Keyboard example with the ifdef surrounding bleHIDPeripheral.setReportIdOffset(1) removed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

varunhr commented 6 years ago

Hai thank you very much for the info. I too moved to TI's CC2541 chip(HM 10 module). Its working in win 10 with some bugs. Trying to debug them.

Regards Varun h r

On Fri, Dec 1, 2017 at 6:01 PM, mholin1 notifications@github.com wrote:

Hello Varun, I eventually had to give up. No real support from any entity involved. Tried the Cypress PSoC 4 parts and it works fine. PSoC Creator light years simpler development environment. Cypress tech support is as abysmal as this Nordic platform but at least the parts work as advertised.

Note: At least Nordic Tech Support tried to help but it was not their code.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sandeepmistry/arduino-BLEPeripheral/issues/160#issuecomment-348483227, or mute the thread https://github.com/notifications/unsubscribe-auth/AUX_zNrvN9sZ7ynpTPNr50npaEdElOt9ks5s7_GZgaJpZM4N0AdS .

RicoKirstein commented 6 years ago

Can you post a link to the libraries you're using? Maybe it's just a problem with the descriptor used in this library. Cheers Rico

mholin1 commented 6 years ago

As I recall it is just the Arduino BLEPeripheral Library downloaded straight from the Arduino IDE. Where you referring to a different Library?

Thanks for the help :)


On Mon, 12/11/17, RicoKirstein notifications@github.com wrote:

Subject: Re: [sandeepmistry/arduino-BLEPeripheral] Windows 10 Driver Error (#160) To: "sandeepmistry/arduino-BLEPeripheral" arduino-BLEPeripheral@noreply.github.com Cc: "mholin1" mholin@yahoo.com, "Mention" mention@noreply.github.com Date: Monday, December 11, 2017, 9:02 AM

Can you post a link to the libraries you're using? Maybe it's just a problem with the descriptor used in this library.

Cheers

Rico

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

RicoKirstein commented 6 years ago

It seems we're missing 2 BLE reports. The standart says there should be 2 more for keyboards at least. BootKeyboardOutputReport and BootKeyboardInputReport For Mouse it should be BootMouseInputReport. Can you check with a BLE explorer tool if your working devices have those services? Cheers Rico

mholin1 commented 6 years ago

Interesting. You mean the Nordic sniffer on the commercial BLE mouse ?


On Mon, 12/11/17, RicoKirstein notifications@github.com wrote:

Subject: Re: [sandeepmistry/arduino-BLEPeripheral] Windows 10 Driver Error (#160) To: "sandeepmistry/arduino-BLEPeripheral" arduino-BLEPeripheral@noreply.github.com Cc: "mholin1" mholin@yahoo.com, "Mention" mention@noreply.github.com Date: Monday, December 11, 2017, 10:51 AM

It seems we're missing 2 BLE reports. The standart says there should be 2 more for keyboards at least.

BootKeyboardOutputReport and BootKeyboardInputReport

For Mouse it should be BootMouseInputReport.

Can you check with a BLE explorer tool if your working devices have those services?

Cheers

Rico

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

RicoKirstein commented 6 years ago

Yes

RicoKirstein commented 6 years ago

I also finally gave up on this. The nordic sdk keyboard sample works with some changes. I got my usb to ble keyboard adapter working using a max3421E and a blenano2.

mholin1 commented 6 years ago

Glad to hear you got something to work. I could have probably gotten the Nordic ble mouse example to work but then there would be no code memory room left for the rest of my application due to the 32K limit of the free Keil compiler. Tried un-checking the various added code options but that just produced tons of compiler errors that would have to track down. On the other hand, the Cypress hardware and software worked right out of the box.

Just really unfortunate the BLEPeripheral Library does not support Windows 10.


On Tue, 1/2/18, RicoKirstein notifications@github.com wrote:

Subject: Re: [sandeepmistry/arduino-BLEPeripheral] Windows 10 Driver Error (#160) To: "sandeepmistry/arduino-BLEPeripheral" arduino-BLEPeripheral@noreply.github.com Cc: "mholin1" mholin@yahoo.com, "Mention" mention@noreply.github.com Date: Tuesday, January 2, 2018, 7:50 PM

I also finally gave up on this. The nordic sdk keyboard sample works with some changes. I got my usb to ble keyboard adapter working using a max3421E and a blenano2.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

kheek commented 6 years ago

Hi @sandeepmistry is it correct the BLEPeripheral Library does not support Windows 10? I tried for many hours to get the HID example working, bonding with Windows 10, but without result. The sample works fine with Macbook & iPhone, but not with Windows 10. I'm really desperate, because I like to control my powerpoint presentation via a Neoplc UC + NRF52 board. Can you confirm Windows 10 HID is not supported so I can look after alternatives? Greetz from The Netherlands, Klaas Heek

joric commented 6 years ago

Same here on BLE400 + Core51822 on windows 10. It connects then disconnects and shows "driver error". Both s110 and s130. I get no "driver error" from Nordic SDK 11 HID sample but I'd rather use Arduino IDE.

Upd. I confirm uncommenting bleHIDPeripheral.setReportIdOffset(1); in the HID_keyboard.ino solves the "driver error" but I still get no real response from the bluetooth keyboard over the air in windows 10. The very same sample works fine for the Android phone though.

Upd. Still get occasional "Driver error" with uncommented setReportIdOffset(1). "This device cannot start. (Code 10) A bad report ID value was found.Report IDs must be within the range of 1-255."

andysheen commented 5 years ago

Sorry to open this, but wondering if anyone has any thoughts on this and have tried getting it working with a BLE HID Gamepad. I've got something working perfectly in OSX, but windows 10 will pair and connect, but display no input. Playing with the offset seems to allow some kind of data to be input appear, but definitely not valid.

Gallium70 commented 4 years ago

Moving bond store actually DOES solve the problem, at least for me...but not with a shift of 6(as mentioned in #https://github.com/sandeepmistry/arduino-BLEPeripheral/issues/164). I tried a shift of 10(i.e. BLEBondStore(10) ), and it works. Evil magic numbers. And i'm not sure if anyone still cares about this in 2020...hope this might help someone.

Fressco0 commented 1 year ago

Moving bond store actually DOES solve the problem, at least for me...but not with a shift of 6(as mentioned in ##164). I tried a shift of 10(i.e. BLEBondStore(10) ), and it works. Evil magic numbers. And i'm not sure if anyone still cares about this in 2020...hope this might help someone.

Even in 2023! Where to change what to do this? And does then also needs to change smth in e.g. clearBondStoreData();?

mholin1 commented 1 year ago

Hey thanks for the update. I don't recall if I tried different offsets. Very painful experience I really do not care to go back to :( Cypress app code worked right out of the box but good to know you had success.

Thx, M. On Thursday, May 25, 2023, 06:53:20 AM EDT, Fressco0 @.***> wrote:

Moving bond store actually DOES solve the problem, at least for me...but not with a shift of 6(as mentioned in ##164). I tried a shift of 10(i.e. BLEBondStore(10) ), and it works. Evil magic numbers. And i'm not sure if anyone still cares about this in 2020...hope this might help someone.

Even in 2023! Where to change what to do this? And does then also needs to change smth in e.g. clearBondStoreData();?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>