For starters I used navigator.hid.requestDevice
without any filters. So I can see which devices are available before adding a custom filter, but my device doesn't show up in the HID browser device picker.
However, in the chrome device log chrome://device-log/ I can see connection/disconnection events for the device with both HID and USB labels:
I don't think this device is on the block list, so I'm not really sure why it's not showing up as an option when requesting HID devices. It shows up in Windows in the Device Manager under HID category as well.
If I use navigator.usb
then the device does show up when requested, but when opened the device gets a Security Error, which possibly means it needs WinUSB driver. It's a HID USB device and works with libs outside of WebHID and WebUSB.
Any reasons it's not showing up?
Edit 1:
My device showed up in chrome://usb-internals/ where I see that it says HID is blocked by WebUSB. Not sure how to solve this yet.
Edit 2:
Using Chrome Canary and the devtools console provided a debug message when using the HID Device picker: Chooser dialog is not displaying a device blocked by the HID blocklist: vendorId=7992, productId=258, name='TEST', serial=''
Looking at the HID blocklist https://github.com/WICG/webhid/blob/main/blocklist.txt I still don't see an issue with the vendor id or product id. The usage page and usage don't match either, but the debug message doesn't mention those, so it's hard to say the exact reason.
Edit 3:
With chrome canary 103.0.5034.0
the new output gives this reason this device is blocked:
Chooser dialog is not displaying a device blocked by the HID blocklist: vendorId=7992, productId=258, name='TEST', serial='', numberOfCollections=1, numberOfProtectedInputReports=0, numberOfProtectedOutputReports=0, numberOfProtectedFeatureReports=0
I want to give an extra thanks to François Beaufort for pointing me in the right direction and adding debug logs to
Chrome Canary
specifically forWebHID
testing.The issue was that
WebHID
saw the number of input and output reports both as 0 and blocked the device from appearing in theHID
device picker. Again, the device I was using works natively on Windows, so this issue was hidden until working withWebHID
.The exact issue was in the
HID
descriptor of the device firmware in the input & output sections of theHID
descriptor. While I can't share the whole descriptor the input and output sections look as follows for the fix:The first values
0x81
and0x91
were correct, but the 2nd values needed to be changed to the above values to work. Once the firmware was modified the device immediately displayed using theWebHID
device picker. Communication is working fine withWebHID
now and the device still works natively on Windows as well.