Skip to main content
Read power, current, and voltage measurements from watt meter Nets through the Lager CLI. Supports Yocto-Watt, Joulescope JS220, and Nordic PPK2 hardware.

Syntax

With no COMMAND, lager watt NET_NAME reads power (watts). The current, voltage, and all subcommands read the other quantities (Joulescope JS220 and Nordic PPK2 only).

Commands

Options

These options are available on each read subcommand (power/current/voltage/all). --box is also accepted directly after lager watt NET_NAME for the default power read.

Arguments

Usage

If NET_NAME is omitted and no default is set, lager watt lists all available watt meter nets on the box.

Output

Lager scales each reading to a milli, micro or nano prefix and prints three decimals, the same format as lager energy. A 52.34 µW load prints as 52.340 µW:
all prints all three quantities:
With --json, output is a single JSON object (units are base SI — amps, volts, watts):
The default reading timeout is 30 seconds (scaled up for long --duration windows). If no reading arrives within that time, the command exits with an error. The error names the two likely causes: a disconnected device, or a USB fault.

Increasing resolution

Two levers improve a power/current reading:
  • Display — output uses a milli, micro or nano prefix with three decimals. A sub-milliwatt reading prints as, for example, 52.340 µW, not as zero. A reading too small even for nano appears in scientific notation, so a nonzero reading is never lost to rounding.
  • Averaging window — pass --duration to average over a longer capture. A longer window reduces noise on the mean, giving a steadier, higher-effective-resolution value:

Long averaging windows

--duration also works for long windows — e.g. the average current over a minute:
On a Joulescope JS220, a window longer than ~10 s uses the instrument’s on-device charge accumulator (average current = Δcharge ÷ Δt). The JS220 does not buffer raw samples for such a window. That approach is gapless: it captures every transient, not just the sampled fraction. It also uses constant memory, so it scales to a window of any length — a minute, ten minutes, longer. A short window continues to use direct sampling.

Supported Hardware

Hardware Feature Comparison

The current, voltage, and all subcommands require a Joulescope JS220 or Nordic PPK2. On a Yocto-Watt (power only) they exit with a clear “not supported” message — use lager watt NET_NAME for power instead. The same readings are also available through the Python API.

Instrument Name Matching

The backend driver is selected based on the instrument name in the net configuration:

Default Net

Set a default watt meter net, then leave out NET_NAME:
lager defaults add --watt-meter-net saves the key net_watt_meter. lager watt also reads net_watt when net_watt_meter is not set, so an older .lager that has that key keeps working.

Examples

Scripting Examples

Power Threshold Check (JSON)

Current Profiling (JSON)

Troubleshooting

Notes

  • Readings print with an SI prefix (mW, µA, …) and three decimals; a value too small for nano appears in scientific notation instead of 0. --json emits base units (W, A, V).
  • --duration sets the averaging window; the Joulescope JS220 and Nordic PPK2 honor it, while the Yocto-Watt returns an instantaneous value and ignores it. On the JS220, windows longer than ~10 s are measured gaplessly with the on-device charge accumulator (constant memory, any length).
  • The Nordic PPK2 operates in source mode (supplies a configurable voltage 0.8–5V and measures current); its voltage reading is the configured source voltage.
  • The current, voltage, and all subcommands must follow the net name: lager watt NET_NAME current.
  • Net names refer to names assigned when setting up your testbed.
  • Use lager nets to see available watt meter nets, and lager instruments --box <box> to verify the device is detected.