WebUSB has very limited coverage, but that's okay for this project.
The navigator.usb.requestDevice
method succeeds:
navigator.usb.requestDevice({
filters: [{
vendorId: RECEIVER_VENDOR_ID,
productId: RECEIVER_PRODUCT_ID
}]
})
Chrome receives permission (via modal interaction) to access the device.
To the browser, the device exists:
console.log(device)
USBDevice {usbVersionMajor: 2, usbVersionMinor: 0, usbVersionSubminor: 0, deviceClass: 2, deviceSubclass: 2, …}
configuration: null
configurations: [USBConfiguration]
deviceClass: 2
deviceProtocol: 0
deviceSubclass: 2
deviceVersionMajor: 2
deviceVersionMinor: 0
deviceVersionSubminor: 0
manufacturerName: "STMicroelectronics"
opened: true
productId: 22336
productName: "STM32 Virtual ComPort"
serialNumber: "355837673037"
usbVersionMajor: 2
usbVersionMinor: 0
usbVersionSubminor: 0
vendorId: 1155
__proto__: etc...
The example receiver I am following echoes the Mozilla docs:
await usbDevice.selectConfiguration(1)
Making my way through a Web.dev article on Accessing USB via the web, and hoping, meanwhile, for some SO Magic.
What am I not seeing/doing?
Thanks.
Update
Checking chrome://device-log (level Debug) returns:
USBUser[14:51:38] USB device added: vendor=1155 "STMicroelectronics", product=22336 "STM32 Virtual ComPort", serial="355837673037", guid=2bd99a9a-75bf-4782-8a0d-2f9e13b06e86
USBUser[14:51:30] USB device removed: guid=1b763328-45db-4152-9c56-9b592d614c3e
USBEvent[14:51:30] Failed to clear halt: Pipe error