remotely_unplugging_usb

Realsense is finicky; seems to freeze and require physically unplug-replug in sensor to work.

Obvious a no-go when working remotely. So how to do in software?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
|__ Port 4: Dev 7, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 1, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 2, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 3, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 4, Class=Video, Driver=uvcvideo, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/14p, 480M
|__ Port 12: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 12: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M


ur5@mars:~$ $ dmesg | grep usb | tail -n 20



[ 3390.718413] usb 4-4: new SuperSpeed USB device number 8 using xhci_hcd
[ 3390.738924] usb 4-4: New USB device found, idVendor=8086, idProduct=0ad3
[ 3390.738927] usb 4-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3390.738928] usb 4-4: Product: Intel(R) RealSense(TM) Depth Camera 415
[ 3390.738930] usb 4-4: Manufacturer: Intel(R) RealSense(TM) Depth Camera 415
[ 3390.738932] usb 4-4: SerialNumber: 821413023306
[ 3390.741624] input: Intel(R) RealSense(TM) Depth Ca as /devices/pci0000:00/0000:00:14.0/usb4/4-4/4-4:1.0/input/input20


ur5@mars:~$ $ sudo sh -c 'echo 4-1 > /sys/bus/usb/drivers/usb/unbind'
sh: echo: I/O error

ur5@mars:~$ $ sudo sh -c 'echo 4-4 > /sys/bus/usb/drivers/usb/unbind'
ur5@mars:~$ $ sudo sh -c 'echo 4-4 > /sys/bus/usb/drivers/usb/bind'

as per https://superuser.com/a/1075286