psu_monitor - bruno-beloff/scs_dev GitHub Wiki
docs > software repositories > scs_dev > commands > device status
DESCRIPTION
The psu_monitor utility is used to report on the PSU status, and to manage shutdown events initiated by the user (operations pin / switch / shutdown button) or by the PSU itself (loss of power).
If the --config-interval flag is used, frequency of reporting is specified by the PSU configuration. Alternatively, the reporting interval can be set explicitly with the --interval flag. Note that the frequency of polling for user and PSU events is hard-coded, and is typically every second.
If no interval is specified, then the psu_monitor utility delivers one report and stops.
Unless inhibited by the --no-output flag, the report is written to stdout. If the PSU configuration specifies a report file path, then the PSU status report is (also) written to this file. When the utility terminates, the file is deleted.
The status_sampler utility reads the PSU report file, if available. The psu_monitor reporting frequency should therefore be set to match the status_sampler reporting frequency.
SYNOPSIS
psu_monitor.py [{ -c | -i INTERVAL }] [-x] [-o] [-v]
Options | |
---|---|
--version | show program's version number and exit |
-h, --help | show this help message and exit |
-c, --config-interval | use PSU configuration interval specification |
-i INTERVAL, --interval=INTERVAL | sampling interval in seconds |
-x, --ignore-standby | ignore PSU standby status |
-o, --no-output | suppress reporting on stdout |
-v, --verbose | report narrative to stderr |
EXAMPLES
./psu_monitor.py -v -i 10
DOCUMENT EXAMPLE - OUTPUT
{"src": "Cv1", "standby": false, "in": true, "pwr-in": 11.5, "chgr": "TFTF", "batt": {"chg": 99, "tte": null, "ttf": null}, "prot-batt": 4.1}
SEE ALSO
scs_dev/psu
scs_dev/status_sampler
scs_mfr/fuel_gauge_calib
scs_mfr/psu_conf