SolarOS 4.17.7 manual · job
batmon
Battery monitor. It periodically samples battery voltage, maintains a smoothed trend, estimates power state, and can request sleep, deep sleep, or shutdown when the configured minimum voltage is reached.
Usage:
job start batmon [interval-sec] [sleep|deepsleep|shutdown]
job stop batmon
job status batmon
Defaults:
| Setting | Value |
|---|---|
| Interval | 60 seconds |
| Low-voltage action | sleep |
The action can also be supplied without an interval, for example job start batmon shutdown. The selected action appears in the startup log and the job's battery resource details.
| Action | Behavior |
|---|---|
sleep | Request the same light sleep as the sleep command. |
deepsleep | Request the same deep sleep as the deepsleep command. |
shutdown | Run the normal shutdown sequence, including storage cleanup and board power-off when supported. |
Battery limits are configured with the battery shell command:
battery capacity <mAh>
battery min_voltage <volts>
battery max_voltage <volts>
Notes:
- Discharging trend means battery power.
- Charging trend means external power.
- Three consecutive samples at or below
min_voltage, with an established discharging trend and no inferred external power, request the selected action. - The voltage trend needs at least five minutes of history. This check runs only while
batmonis running. - Set
min_voltageabove the board's minimum operating voltage, with margin for voltage drop under load. Changing the action does not change the threshold or bypass the trend and consecutive-sample checks.
Example:
job start batmon 60
job start batmon 30 shutdown