pio_power_profile
Measure a device's current draw over a set period to report average, min/max, p95, energy use, sleep/active time, and estimated battery life from serial meter data or a Nordic PPK2.
Instructions
Measure the device's current draw for seconds and report average/min/max/p95 mA, energy (mWh and µAh when voltage is known), a bucketed timeline, the share of time in sleep vs active (threshold auto-detected from the two dominant current levels, or sleep_threshold_ma), and a battery-life estimate. source='serial' reads a meter streaming readings on port (INA219/INA226 sketch, USB power meter log; pattern regex with (?P) and optional (?P)/(?P) groups, default: first number with uA/mA/A). source='ppk2' drives a Nordic Power Profiler Kit II (needs the power extra). Set trigger + trigger_session_id to start measuring when the firmware prints a line.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| baud | No | ||
| port | No | ||
| source | No | serial | |
| buckets | No | ||
| pattern | No | ||
| seconds | No | ||
| trigger | No | ||
| voltage_mv | No | ||
| sleep_threshold_ma | No | ||
| trigger_session_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||