Uhubctl

From TheBestLinux.com
Jump to navigation Jump to search

uhubctl

One of the most useful tools for managing not only USB devices, but USB hubs as well, is uhubctl, which is not installed on most Linux distributions by default, but is simple enough to install from the command line, or from any Linux package management tool.

Here is how I just installed it on one of my servers running Fedora Linux 32 Server from the command line in a couple of minutes:

[root@server.dawgland.com:/proc]# dnf install uhubctl
Last metadata expiration check: 2:22:26 ago on Tue 03 Aug 2021 01:28:36 PM PDT.
Dependencies resolved.
================================================================================
 Package          Architecture    Version                Repository        Size
================================================================================
Installing:
 uhubctl          x86_64          2.2.0-1.fc32           updates           31 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 31 k
Installed size: 70 k
Is this ok [y/N]: y
Downloading Packages:
[MIRROR] uhubctl-2.2.0-1.fc32.x86_64.rpm: Curl error (6): Couldn't resolve host name for http://mirror.prgmr.com/pub/fedora/linux/updates/32/Everything/x86_64/Packages/u/uhubctl-2.2.0-1.fc32.x86_64.rpm [Could not resolve host: mirror.prgmr.com]
[MIRROR] uhubctl-2.2.0-1.fc32.x86_64.rpm: Curl error (6): Couldn't resolve host name for http://mirror.siena.edu/fedora/linux/updates/32/Everything/x86_64/Packages/u/uhubctl-2.2.0-1.fc32.x86_64.rpm [Could not resolve host: mirror.siena.edu]
uhubctl-2.2.0-1.fc32.x86_64.rpm                 1.8 kB/s |  31 kB     00:16    
--------------------------------------------------------------------------------
Total                                           1.7 kB/s |  31 kB     00:17     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : uhubctl-2.2.0-1.fc32.x86_64                            1/1 
  Running scriptlet: uhubctl-2.2.0-1.fc32.x86_64                            1/1 
  Verifying        : uhubctl-2.2.0-1.fc32.x86_64                            1/1 

Installed:
  uhubctl-2.2.0-1.fc32.x86_64                                                   

Complete!
[root@server.dawgland.com:/proc]# 


And this confirms uhubctl is installed correctly:

[root@server.dawgland.com:/proc]# uhubctl -v
2.2.0
[root@server.dawgland.com:/proc]# uhubctl -h
uhubctl 2.2.0: utility to control USB port power for smart hubs.
Usage: uhubctl [options]
Without options, show status for all smart hubs.

Options [defaults in brackets]:
--action,   -a - action to off/on/cycle (0/1/2) for affected ports.
--ports,    -p - ports to operate on    [all hub ports].
--location, -l - limit hub by location  [all smart hubs].
--level     -L - limit hub by location level (e.g. a-b.c is level 3).
--vendor,   -n - limit hub by vendor id [any] (partial ok).
--delay,    -d - delay for cycle action [2 sec].
--repeat,   -r - repeat power off count [1] (some devices need it to turn off).
--exact,    -e - exact location (no USB3 duality handling).
--reset,    -R - reset hub after each power-on action, causing all devices to reassociate.
--wait,     -w - wait before repeat power off [20 ms].
--version,  -v - print program version.
--help,     -h - print this text.

Send bugs and requests to: https://github.com/mvp/uhubctl
[root@server.dawgland.com:/proc]#