0

How can I unbind an USB interface?

Found multiple pages like this one: Manual driver binding and unbinding or this one: How to unbind/bind a usb device as normal user?

Which suggest to use the following command:

sudo echo -n "1-1:1.0" > /sys/bus/usb/drivers/usb/unbind

This gives me the following response:

echo: write error: No such device

But the folder is available inside my file system: folder found in file system

lsusb gives me:

Bus 001 Device 047: ID 0483:1234 STMicroelectronics USB2CAN converter

and usb-devices:

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 47 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0483 ProdID=1234 Rev=01.00
S:  Manufacturer=8Devices
S:  Product=USB2CAN converter
S:  SerialNumber=5D2C531E
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#=0x0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=ff Prot=ff Driver=usb_8dev

Also if I try to use ’sudo echo -n "0-1:1.0" > /sys/bus/usb/drivers/usb/unbind’ or ’sudo echo -n "1-0:1.0" > /sys/bus/usb/drivers/usb/unbind’ it gives me:

echo: write error: No such device

What works is:

sudo echo -n "1-1" > /sys/bus/usb/drivers/usb/unbind

But if I try to connect like this via Chrome:

navigator.usb.requestDevice({ filters: [{}] })
.then(selectedDevice => {
   device = selectedDevice;
console.log(device);
   return device.open()
    .then(() => device.reset())
    .then(() => device.selectConfiguration(1))
    .then(() => device.claimInterface(device.configuration.interfaces[0].interfaceNumber))
 });

it still gives me:

DOMException: Unable to claim interface.

Also unlike this person How to claim interface using WebUSB? I can select the device.

tl;dr:

I would like to connect to an USB device with the WebUSB API but it's giving me

DOMException: Unable to claim interface.

1 Answer 1

0

So basically you have to do this for "8devices".

/sys/bus/usb/drivers/usb_8dev$ echo "1-1:1.0" > unbind

in long:

cd /sys/bus/usb/drivers/usb_8dev
echo "1-1:1.0" > unbind

You will find a file called something similar to "1-1:1.0" in /sys/bus/usb/drivers/usb_8dev so just do a ls to get the correct file and then exchange "1-1:1.0" for this value.

Also don't forget to set sudo chmod -R -v 777 ./ to the driver(ex. usb_8dev) folder.

Also recommended: Disconnect and reconnect ttyUSB0 programmatically in Linux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.