goinsnoopin Posted September 1, 2019 Share Posted September 1, 2019 Is there a command that I can ssh into Unraid and execute to have it be the equivalent of unplugging and reinserting a USB Device? I am passing a USB zigbee coordinator cc2531 to my zigbee2mqtt docker.... everything works fine, however when the docker updates it does not start. When I am home this is no big deal as I just unplug then replug the USB dongle then start the docker container....however sometimes I am away so I would love a command line way to do this. Thanks, Dan 1 Quote Link to comment
b0m541 Posted April 18, 2020 Share Posted April 18, 2020 (edited) +1, this is essential apart from that, what are your experiences, are you happy with it? I am planning to use it with Home Assistant and Mosquitto, each in a docker container. Does that work? Edited April 18, 2020 by b0m541 Quote Link to comment
Squid Posted April 18, 2020 Share Posted April 18, 2020 Google is your friend https://unix.stackexchange.com/questions/7412/how-to-reconnect-a-logically-disconnected-usb-device But, you would have to be very careful to not detach the boot flash drive, as then you'll run into other problems. Quote Link to comment
b0m541 Posted April 18, 2020 Share Posted April 18, 2020 On 9/1/2019 at 1:44 PM, goinsnoopin said: I am passing a USB zigbee coordinator cc2531 to my zigbee2mqtt docker.... there is no unraid container for zigbee2mqtt. which docker hub container are you using? koenkk? Quote Link to comment
Rick_Sanchez Posted January 12, 2021 Share Posted January 12, 2021 (edited) On 4/18/2020 at 10:34 AM, Squid said: Google is your friend https://unix.stackexchange.com/questions/7412/how-to-reconnect-a-logically-disconnected-usb-device But, you would have to be very careful to not detach the boot flash drive, as then you'll run into other problems. I followed the instructions here which works well via command line. The usbfs interaction seems to have changed a number of times since this question was originally answered. So, here's how I cycle hub port power on Ubuntu Oneiric Ocelot from a Bash shell. Search for the bus and device number: sudo lsusb -v|less Locate the device in the bus / hub port hierarchy using the bus and device number: sudo lsusb -t|less The syntax seems to be 'bus-port.port.port.port.port...' For example, my mouse is connected to an external hub which connects to my computer's hub which internally connects to a root hub: /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M |__ Port 1: Dev 3, If 0, Class=hub, Driver=hub/3p, 480M |__ Port 1: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M So, '2-1.1.1' in the above case. Finally, cycle the port power: echo '2-1.1.1'|sudo tee /sys/bus/usb/drivers/usb/unbind sleep 1 echo '2-1.1.1'|sudo tee /sys/bus/usb/drivers/usb/bind Is there a way to automate this to execute at reboot (or at restart of VM, or restart of OZWDaemon docker)? Edited January 12, 2021 by Rick_Sanchez Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.