Skip to main content
Read power consumption measurements from watt meter Nets through the Lager CLI.

Syntax

lager watt [OPTIONS] NET_NAME

Options

OptionDescription
--box BOXLagerbox name or IP address
--helpShow help message and exit

Arguments

ArgumentDescription
NET_NAMEName of the watt meter net to read

Usage

lager watt NET_NAME [--box BOX]
Arguments:
  • NET_NAME - Name of the watt meter net. Can be omitted if a default is set.
Examples:
# Read power from watt meter
lager watt POWER_METER --box my-lager-box

# Read using default net
lager watt

Setting Default Net

To avoid specifying the net name each time:
lager defaults add --watt-net POWER_METER
Then you can simply run:
lager watt

Output

Returns the power measurement in watts (W).
Power: 5.23 W

Supported Hardware

ManufacturerModelFeatures
YoctoWatt modulesReal-time power measurement

Use Cases

Power Profiling

Monitor device power consumption during different operating modes:
# Measure idle power
lager watt POWER --box gateway

# Measure active power (during operation)
lager watt POWER --box gateway

Battery Life Estimation

Combine with other measurements:
# Get power consumption
lager watt POWER

# Calculate estimated battery life
# Battery capacity (mAh) / Current draw (mA) = Hours

Automated Testing

Integrate power measurement into test scripts:
#!/bin/bash
# Verify power consumption is within limits

POWER=$(lager watt POWER --box gateway)
if [ "$POWER" -gt "10" ]; then
    echo "FAIL: Power consumption too high"
    exit 1
fi
echo "PASS: Power within limits"

Notes

  • Power is returned in watts (W)
  • Net names refer to names assigned when setting up your testbed
  • Use lager nets to see available watt meter nets
  • For high-precision measurements, ensure proper calibration of the watt meter