Man page - rpi-power-hat(1)

Packages contas this manual

Manual

rpi-power-hat(1) User Commands rpi-power-hat(1)

rpi-power-hat - control power HAT ports, flash images, monitor power/current, and SSH

rpi-power-hat COMMAND [ARGS]
rpi-power-hat help
rpi-power-hat list

rpi-power-hat is a wrapper around utility scripts for the Raspberry Pi Power Control HAT. It manages per-port power, mass-storage gadget boot, image flashing, logging of current/power and SSH access based on per-port configuration.

Show power status for a port or all ports.
Turn power OFF(0)/ON(1) for a port or all ports.
Boot the connected device as a mass-storage gadget. MODEL: 5 (default), 4, 0. When MODEL is specified, it will be written to the configuration file for the port.
Flash an OS image to the device mapped to PORT, generating a firstrun script, keys and hostname per the configuration. Generates unique hostname and SSH keys, updates config file, and creates SSH client configuration snippets. Keys are stored under /var/lib/rpi-power-hat/keys/
Log current in mA at 100 Hz to console or CSV (with -s).
Log power in mW at 100 Hz to console or CSV (with -s).
SSH into the device mapped to PORT using generated keys.
Print the current hostname for PORT; with -h, show hostname history entries.
SSH to the device on PORT, set the hostname, and update local configuration. Updates both hostname and ssh_host in config file upon success.

Most subcommands support -h, --help or -help.

/etc/rpi-power-hat/ports.conf
Per-port settings: hostname, username, ssh_host, model, image_path, etc.
/etc/rpi-power-hat/network.conf
Per-port Wi-Fi settings: wlan_ssid, wlan_password.
/etc/rpi-power-hat/hardware.conf
Hardware mappings for hwmon and GPIO per port.
/var/lib/rpi-power-hat/
Data directory for images, keys, history, and working files.

Turn on port B1:

rpi-power-hat set B1 1

Gadget boot Pi 5 on B2:

rpi-power-hat mass-storage B2 5

Flash latest image to T1:

rpi-power-hat flash-image T1

Stream current for 30s and save CSV:

rpi-power-hat log-current B1 30 -s

gpiod(1), i2c-tools(8), rpi-imager(1)

Raspberry Pi Power HAT contributors

rpi-power-hat