Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

You can make USB devices disappear using sysfs. I have tested this with a Logitech Unifying USB receiver. Although lsusb listed the device, key presses weren't processed when the device was removed using this method.

  1. Determine the ID associated with your USB device using dmesg. For instance, after plugging the USB receiver in, I get 1-1.2 as ID:

    usb 1-1.2: new full-speed USB device number 4 using dwc_otg
    usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52b
    usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 1-1.2: Product: USB Receiver
    usb 1-1.2: Manufacturer: Logitech
    
  2. Remove and re-insert the device:

    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/unbind'
    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/bind'
    
  3. Profit!

You may also have success by writing unbind and bind on the driver for your camera driver. Use ls -l /dev/bus/[DRIVER]/devices to determine the driver.

(Inspired by an answer on Unix.SEan answer on Unix.SE)

You can make USB devices disappear using sysfs. I have tested this with a Logitech Unifying USB receiver. Although lsusb listed the device, key presses weren't processed when the device was removed using this method.

  1. Determine the ID associated with your USB device using dmesg. For instance, after plugging the USB receiver in, I get 1-1.2 as ID:

    usb 1-1.2: new full-speed USB device number 4 using dwc_otg
    usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52b
    usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 1-1.2: Product: USB Receiver
    usb 1-1.2: Manufacturer: Logitech
    
  2. Remove and re-insert the device:

    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/unbind'
    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/bind'
    
  3. Profit!

You may also have success by writing unbind and bind on the driver for your camera driver. Use ls -l /dev/bus/[DRIVER]/devices to determine the driver.

(Inspired by an answer on Unix.SE)

You can make USB devices disappear using sysfs. I have tested this with a Logitech Unifying USB receiver. Although lsusb listed the device, key presses weren't processed when the device was removed using this method.

  1. Determine the ID associated with your USB device using dmesg. For instance, after plugging the USB receiver in, I get 1-1.2 as ID:

    usb 1-1.2: new full-speed USB device number 4 using dwc_otg
    usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52b
    usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 1-1.2: Product: USB Receiver
    usb 1-1.2: Manufacturer: Logitech
    
  2. Remove and re-insert the device:

    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/unbind'
    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/bind'
    
  3. Profit!

You may also have success by writing unbind and bind on the driver for your camera driver. Use ls -l /dev/bus/[DRIVER]/devices to determine the driver.

(Inspired by an answer on Unix.SE)

Source Link
Lekensteyn
  • 1.5k
  • 1
  • 15
  • 24

You can make USB devices disappear using sysfs. I have tested this with a Logitech Unifying USB receiver. Although lsusb listed the device, key presses weren't processed when the device was removed using this method.

  1. Determine the ID associated with your USB device using dmesg. For instance, after plugging the USB receiver in, I get 1-1.2 as ID:

    usb 1-1.2: new full-speed USB device number 4 using dwc_otg
    usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52b
    usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 1-1.2: Product: USB Receiver
    usb 1-1.2: Manufacturer: Logitech
    
  2. Remove and re-insert the device:

    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/unbind'
    sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/bind'
    
  3. Profit!

You may also have success by writing unbind and bind on the driver for your camera driver. Use ls -l /dev/bus/[DRIVER]/devices to determine the driver.

(Inspired by an answer on Unix.SE)