Syntax
Global Options
Arguments
Commands
cycle options
Usage
List USB Nets
When invoked without a net name, lists all USB nets on the box:Control USB Port Power
Power cycle a device
cycle cuts power, waits, restores it, and waits for the device to come back:
cycle returns as soon as the hub reports the device reconnecting, which is
a few hundred milliseconds. Linux has not finished re-enumerating at that
instant, so a device node or /dev/ttyUSB* may not be back yet, and a /sys
read taken immediately still shows the pre-cycle values. If the next step opens
the device, wait for its node rather than assuming cycle returning means it is
ready.disable/sleep/enable. It holds the hub for the
whole sequence, so nothing else can switch the port while it is dark; it
restores power on every failure path, so a command that dies partway through
cannot strand a port; and it reports whether the device actually came back
instead of leaving you to guess.
--off-time defaults to 1 second, comfortably above the slowest cold boot
measured on real hardware. Too short an off time is the failure that
matters: the device’s rails do not fully discharge, so it warm-starts while
looking like it was reset. Raise it for a device with large bulk capacitance;
values below 0.5s or above 10s are refused.
Recover a port left unpowered
If a command was interrupted between powering a port down and back up,recover
restores power:
recover is usually
that something is off and it is not obvious what.
Read port state (read-only)
state reports whether a port is currently enabled or disabled without
changing it. The value is read live from the hub hardware, so it always
reflects the real port state — nothing is cached or stored:
toggle: use state to check a port,
toggle to flip it (which also reports the resulting state).
toggle reports the resulting state so you can tell which way it flipped:enable and disable confirm the action explicitly (USB port 'USB1' enabled).Examples
Supported Hardware
See Supported Instruments for
which ports on a Plugable dock switch power and which do not.
Notes
- Net names (e.g.,
USB1,CAM_USB) refer to USB ports configured on your testbed - Commands are case-insensitive (
enable,ENABLE, andEnableall work) - Useful for power cycling USB devices during testing
- USB hubs must be connected to the box and configured as instruments
- Default net can be set with
lager defaults add --usb-net - Create USB nets with
lager nets add <name> usb <channel> <address>

