PiKVM

Manage PiKVM operations.

AttributeTypeRequiredDefaultDescription
cmdconstYespikvmCommand name.
namestringYesUnique identifier for the teststep.
optionsOptionsObjectNoAdditional command options.
parametersPiKVMOptionsYesParameters for the pikvm command.

PiKVM Options

AttributeTypeRequiredDefaultDescription
commandstringYes (must be one of: image, screenshot, keyboard, atx)Operation to perform via the PiKVM interface.
hoststringYesHostname or IP address of the PiKVM (format: “https://hostname”).
authobjectYes (must include username and password)Authentication details for the PiKVM API.
imageobjectConditionally required when command is imageImage configuration. Contains a path property with the image file path to upload and mount.
keyboardobjectConditionally required when command is keyboardKeyboard input configuration. Use either the keys (array of key sequences) or text (string) property. With keys, delay sets the pause after each key as a duration such as 500ms or 1s (default 500ms).
atxobjectConditionally required when command is atxATX power control, see PiKVM ATX Power.

The screenshot opens the PiKVM’s video stream itself, so no browser has to show it. It fails if the PiKVM gets no picture from the DUT within 10 seconds.

PiKVM ATX Power

Switches the DUT’s power through the PiKVM’s ATX board. The board must be wired to the DUT’s front panel header, including the power LED. Set exactly one of action and button.

AttributeTypeRequiredDefaultDescription
actionstringOne of action or buttonPower state to reach: on, off (short press, the operating system shuts down), off_hard (long press) or reset_hard (reset button).
buttonstringOne of action or buttonButton to click: power, power_long or reset.
waitbooleanNofalseWait until the PiKVM has finished the press.

The PiKVM reads the power LED before an action: it presses for on only while the LED is off, and for off, off_hard and reset_hard only while it is on. The step succeeds in both cases, so check the DUT’s state in a later step. A button always presses. Without a wired power LED, the PiKVM always reads “off”: on then turns a running DUT off, and the other actions press nothing.

PiKVM Examples

Image mounting:

cmd: pikvm
name: Mount OS Image via PiKVM
parameters:
  command: image
  host: "[[attributes.PiKVMHost]]"
  auth:
    username: root
    password: root
  image:
    path: "[[storage.Image]]/nixos.img"

Screenshot:

cmd: pikvm
name: Capture PiKVM Screenshot
parameters:
  command: screenshot
  host: "[[attributes.PiKVMHost]]"
  auth:
    username: root
    password: root

Keyboard input:

cmd: pikvm
name: Send Keyboard Input via PiKVM
parameters:
  command: keyboard
  host: "[[attributes.PiKVMHost]]"
  auth:
    username: root
    password: root
  keyboard:
    text: "INPUTTEXT"

or

cmd: pikvm
name: Send Keyboard Input via PiKVM
parameters:
  command: keyboard
  host: "[[attributes.PiKVMHost]]"
  auth:
    username: root
    password: root
  keyboard:
    keys: ["CTRL + C", "I", "N", "P", "U", "T", "ENTER"]
    delay: 1s

ATX power, switching the DUT on and waiting for the press:

cmd: pikvm
name: Power on via ATX
parameters:
  command: atx
  host: "[[attributes.PiKVMHost]]"
  auth:
    username: root
    password: root
  atx:
    action: "on"
    wait: true

or a long press of the power button, whatever the power LED shows:

cmd: pikvm
name: Force off via ATX
parameters:
  command: atx
  host: "[[attributes.PiKVMHost]]"
  auth:
    username: root
    password: root
  atx:
    button: power_long