After obtaining access to an attached device using navigator.usb.requestDevice
I'm trying to open a connection with an attached device as follows:
device.open()
.then(() => device.selectConfiguration(1))
.then(() => device.claimInterface(1))
It seemingly successfully selects the configuration, however the claimInterface
step will produce the following error:
DOMException: Unable to claim interface.
I'm running Chrome 55.0.2883.75 beta with the --disable-webusb-security
flag as root (without those I didn't get any devices) on Ubuntu 16.10.
How can I get the connection up and running?
Edit:
It seems that the cdc_acm driver already claimed the interface since device I'm trying to attach is a serial device, unloading the driver will allow you to claim the device (however after this it complains about interface 1 not being available, as well as 0 or 2).
Once the configuration is selected, you can find the right interface number in device.configuration.interfaces[0].interfaceNumber
:
device.open()
.then(() => device.selectConfiguration(1))
.then(() => device.claimInterface(device.configuration.interfaces[0].interfaceNumber))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With