hub
Control a programmable USB port controller to toggle per-port power and USB2 data lines, cold-boot STM32 boards, sample voltage/current, and serve a live dashboard.
Instructions
Programmable USB hub: per-port power, USB2 data lines, cold boot, and V/I sampling. action=describe | power(state[,channel,confirm]) | data(state[,channel,exclusive,confirm]) | cycle([channel,off_ms,settle_ms,confirm]) | measure([channel,duration_sec,interval_sec,all_channels]) | discover([apply,force,settle_sec]) | dashboard([state,port,interval_sec,open_browser]). dashboard serves a read-only live web page on 127.0.0.1 and returns its URL. state=on|off; channel is 1-based and defaults to the session's mapped hub channel. Removing port power cold-boots that board and un-enumerates its probe.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | HTTP port on 127.0.0.1 (default 8765). | |
| apply | No | Write the discovered map into the debug profile. | |
| force | No | Run even though a GDB server is alive on this session. | |
| state | No | Target state for the port. | |
| action | Yes | Which operation to perform. | |
| off_ms | No | Milliseconds to hold power off (default 400). | |
| channel | No | 1-based hub channel. Defaults to the session's mapped hub channel. | |
| confirm | No | Required to cut power/data when the guard is in confirm mode or a session is live. | |
| session | No | Optional debug-session name. Omit for the default target. | |
| exclusive | No | With state=on, disconnect every other port's data line. | |
| settle_ms | No | Milliseconds to wait after restoring power (default 1500). | |
| settle_sec | No | Seconds to wait for USB re-enumeration per toggle (default 1.0). | |
| all_channels | No | Sample every channel instead of just one. | |
| duration_sec | No | Sampling window; 0 (default) takes one snapshot. | |
| interval_sec | No | Delay between samples (default 0.05). | |
| open_browser | No | Also open the page in the default browser. |