When our USB device is not enumerated, we can restart the USB device and disconnect the USB power supply in the following way:
- Install and compile uhubctl
sudo apt-get install gcc
sudo apt-get install make
sudo apt-get install libusb-1.0
sudo apt-get install git
git clone git://github.com/mvp/uhubctl
make
sudo ./uhubctl
At present, it is possible to restart the four USB ports at the same time. When the fourth USB is turned off, all USB ports will be closed.
sudo ./uhubctl -l 1-1 -p 1 -a off&&sudo ./uhubctl -l 1-1 -p 2 -a off&&sudo ./uhubctl -l 1-1 -p 3 -a off&&sudo ./uhubctl -l 1-1 -p 4 -a off
- USB power on
sudo ./uhubctl -l 1-1 -p 1 -a on