Skip to main content
Install, list and remove custom drivers. A custom driver controls an instrument that Lager does not include, such as an in-house test fixture. The driver code is stored on the box only, so it never has to be published in Lager or installed on each user’s computer. After you install a driver, add a net that uses it with lager nets add-custom. Then every user can drive that net with the standard CLI, in one of two forms:
See lager custom for running actions, and Custom drivers for how to write a driver.

Syntax

Commands


Command Reference

list

List the custom drivers installed on a box, with their version, status, Python packages and the nets that use them.
Options:
  • --box BOX - Lager Box name or IP address
  • --json - Print the box response as JSON
Output:
A driver whose bundle cannot be loaded is listed with error: and the reason. Other drivers are not affected. The Deps column shows how many Python packages a driver has, or - if it has none. It shows stale when the packages were installed for a different Python version or CPU; run reinstall-deps to fix that.

show

Show a driver’s net settings, actions and action arguments, as the box reads them from the driver’s manifest.
Arguments:
  • TYPE - The driver type, for example stepper
Options:
  • --box BOX - Lager Box name or IP address

install

Install a driver from a bundle directory, or replace an installed driver of the same type. The directory must contain lager_driver.json and driver.py. The box checks the manifest, and installs nothing if it is not valid.
Arguments:
  • BUNDLE_DIR - Local path to the bundle directory
Options:
  • --box BOX - Lager Box name or IP address
  • --yes - Replace an installed driver without asking
The bundle must be smaller than 5 MB. The box keeps it in /etc/lager/drivers/, so it stays installed after lager update. If the manifest names a requirements file, the box also installs those Python packages, which can take a few minutes. If they cannot be installed, the driver is not installed. See Python packages. Examples:

reinstall-deps

Install a driver’s Python packages again, from the requirements file in the installed bundle. Use it when lager drivers list shows the packages as stale.
Arguments:
  • TYPE - The driver type
Options:
  • --box BOX - Lager Box name or IP address
If the install fails, the packages that were installed before are kept.

remove

Remove a driver from a box. The box refuses while nets use the driver, because those nets then stop working.
Arguments:
  • TYPE - The driver type
Options:
  • --box BOX - Lager Box name or IP address
  • --force - Remove the driver even if nets still use it
  • --yes - Skip the confirmation prompt

Notes

  • A driver type cannot use the name of a built-in net role or lager command, for example supply or uart.
  • The driver runs on the box with the same access as a lager python script. It is kept out of the public Lager code, but a person who can connect to the box can read it.
  • The Python packages a driver lists also run on the box with that access. Install only packages you trust.