LAA cli (also known as laacli)

laacli is a command line application, running on the LAA, allowing to control the LAA hardware.

$ laacli --help
Linaro Automation Appliance CLI

Usage: laacli <COMMAND>

Commands:
  button      Virtual buttons
  eeprom      Read and write eeprom
  history     Sensor history (JSON)
  led         User LED
  power       Power rails
  rev         LAA Hardware Revision
  screenshot  Save OLED screenshot
  temp        Query temperature (in Β°C)
  usb         USB Hub
  usbg-ms     USB Gadget Mass storage emulation
  watt        Power consumption
  help        Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Commands

button

Control the virtual buttons via the optocouplers.

$ laacli button --help
Virtual buttons

Usage: laacli button <BUTTON> <STATE>

Arguments:
  <BUTTON>  Virtual button [possible values: 1, 2, power, reset]
  <STATE>   Desired state [possible values: on, off]

eeprom

Read and write the EEPROMs on the MIB and SIB on your LAA setup.

Read

$ laacli eeprom read --help
Usage: laacli eeprom read <BOARD> <FIELD>

Arguments:
  <BOARD>  Board [possible values: sib, mib]
  <FIELD>  Field [possible values: type, rev, sid]

Write

$ laacli eeprom write --help
Usage: laacli eeprom write <BOARD> <FIELD> <VALUE>

Arguments:
  <BOARD>  Board [possible values: sib, mib]
  <FIELD>  Field [possible values: type, rev, sid]
  <VALUE>  Data

datatype

EEPROM accepts and return a double for each data field.

Write Protect

Make sure the write protect mechanism is disabled before writing to the eeprom.

history

Return sensors history. The daemon is reading and recording sensors data every 100 ms.

$ laacli history --help
Sensor history (JSON)

Usage: laacli history [OPTIONS]

Options:
      --since <SINCE>  How far back (e.g. 90s, 5m, 2h, 1d) [default: 1h]
      --end <END>      End of the window as an epoch (default: now)
  -h, --help           Print help

led

Control the color of the user led.

$ laacli led --help
User LED

Usage: laacli led <STATE>

Arguments:
  <STATE>  Desired state [possible values: on, off]

power

Control the state of the different power rails.

$ laacli power --help
Power rails

Usage: laacli power <VBUS> <STATE>

Arguments:
  <VBUS>   VBus rail [possible values: 1v8, 3v3, 5v, 12v]
  <STATE>  Desired state [possible values: on, off, reset, status]

rev

Print the LAA hardware revision.

$ laacli rev
LAA rev 1.01

screenshot

Take a screenshot of the LAA OLED display.

Save OLED screenshot

Usage: laacli screenshot

Options:
  -h, --help  Print help

temp

Print the thermal probe values.

$ laacli temp --help
Query temperature (in Β°C)

Usage: laacli temp <PROBE>

Arguments:
  <PROBE>  Probe name [possible values: amb, dut, sys]

usb

Control the DUT USB ports state.

$ laacli usb --help
USB Hub

Usage: laacli usb <PORT> <STATE>

Arguments:
  <PORT>   USB port
  <STATE>  Desired state [possible values: on, off, reset, start, status, vbus]

Valid port range

The valid port numbers are:

  • 0: the usb hub itself : 1 to 4: the usb ports

reset and start

reset and start commands are only available for port 0, which identify the usb hub itself. For this port, on, off status and vbus are invalid.

status VS vbus

  • β€œstatus” returns the logical state of the USB port, it is not affected if the USB port has expreienced an OCP condition and shutdown or if it’s being backfed power from a misbehaving DUT.

  • β€œvbus” returns the physical state of the USB port. It returns β€œHIGH” if there is 5v present and β€œLOW” if not on the V_BUS pin of the specified USB port.

usbg-ms

Control the USB OTG port to act as a USB mass storage device using USB gadget mode (USB mass storage emulation).

$ laacli usbg-ms --help
USB Gadget Mass storage emulation

Usage: laacli usbg-ms <STATE> [FILENAME]

Arguments:
  <STATE>     Desired state [possible values: on, off, status]
  [FILENAME]  filename [default: ]

Calling On or Off twice

If you call laacli usbg-ms on <FILE> or laacli usbg-ms off twice in a row, the second call will fail and return 1.

This is expected, using laacli usbg-ms status will print the current state (On or Off).

watt

Print the instant power consumption of the power rails.

$ laacli watt --help
Power consumption

Usage: laacli watt <VBUS>

Arguments:
  <VBUS>  VBus rail [possible values: 1v8, 3v3, 5v, 12v]

laacli will return:

$ laacli watt 5v
4.968V
0.433A
2.14344W