climate_sampler - bruno-beloff/scs_dev GitHub Wiki
docs > software repositories > scs_dev > commands > environmental sampling
DESCRIPTION
The climate_sampler utility reads a Sensirion SHT 31 (or equivalent) sensor - it therefore provides a measurement of temperature and relative humidity. Output values are in degrees centigrade and percentage, respectively.
The climate_sampler utility may also read an ICP-10101 or MPL115A2 digital barometer. Depending on configuration, the report from this sensor includes absolute pressure (pA), and optionally equivalent sea-level pressure (p0) and the MPL115A2 temperature. Pressure is reported in kilopascals.
The climate_sampler writes its output to stdout. As for all sensing utilities, the output format is a JSON document with fields for:
- the unique tag of the device (if the system ID is set)
- the recording datetime in ISO 8601 format
- a value field containing the sensed values
Command-line options allow for single-shot reading, multiple readings with specified time intervals, or readings controlled by an independent scheduling process via a Unix semaphore.
South Coast Science equipment may carry one or two SHT sensors. The configuration is specified by the scs_mfr/sht_conf utility.
SYNOPSIS
climate_sampler.py [{ -s SEMAPHORE | -i INTERVAL [-n SAMPLES] }] [{ -v | -d }]
Options | |
---|---|
--version | show program's version number and exit |
-h, --help | show this help message and exit |
-s SEMAPHORE, --semaphore=SEMAPHORE | sampling controlled by SEMAPHORE |
-i INTERVAL, --interval=INTERVAL | sampling interval in seconds |
-n SAMPLES, --samples=SAMPLES | number of samples (1 if interval not specified) |
-v, --verbose | report narrative to stderr |
-d, --debug | report detailed narrative to stderr |
EXAMPLES
./climate_sampler.py -i10
FILES
~/SCS/conf/schedule.json
~/SCS/conf/sht_conf.json
~/SCS/conf/system_id.json
DOCUMENT EXAMPLE - v0
{"rec": "2021-10-11T10:53:20Z", "tag": "scs-bgx-431", "val": {"hmd": 55.2, "tmp": 16.2, "bar": {"pA": 102.8, "p0": 103.1}}}
DOCUMENT EXAMPLE - v1
{"rec": "2021-10-11T10:52:06Z", "tag": "scs-be2-3", "ver": 1.0, "val": {"hmd": 52.8, "tmp": 21.9, "bar": {"pA": 103.5, "p0": 104.7}}}
SEE ALSO
scs_dev/pressure_sampler
scs_dev/scheduler
scs_mfr/mpl115a2_calib
scs_mfr/pressure_conf
scs_mfr/schedule
scs_mfr/sht_conf
scs_mfr/system_id