opc_conf - bruno-beloff/scs_mfr GitHub Wiki

docs > software repositories > scs_mfr > commands > configuration


DESCRIPTION

The opc_conf utility is used to specify whether an Alphasense optical particle counter (OPC) is present and if so, which model is attached. An option is also available to override the host's default SPI bus and SPI chip select lines for the OPC.

The specification also includes the number of seconds between readings by the OPC monitor sub-process. The maximum time between readings is 10 seconds, the minimum five. A 10 second period provides the highest precision, but sampling at this rate may be subject to clipping in extremely polluted environments.

The --restart-on-zeroes flag can be used to test the OPC in some situations, by overriding the default behaviour, which is to restart the OPC if repeated zero readings are presented.

Flags are included to add or remove data interpretation exegetes, together with the source of T / rH readings. Use of these is under development.

Sampling is performed by the scs_dev/particulates_sampler utility. If an opc_conf.json document is not present, the scs_dev/particulates_sampler utility terminates.

Note that the scs_dev/particulates_sampler process must be restarted for changes to take effect.

The OPC-N2, OPC-N3, OPC-R1 and Sensirion SPS30 models are supported.

Alternate exegetes (data interpretation models) can be added or removed - available interpretations can be listed with the --help flag.

Note that, although support is provided for multiple named configurations, the configuration utility will only access unnamed (solitary) configurations.

SYNOPSIS

opc_conf.py [-n NAME] [{ [-m MODEL] [-s SAMPLE_PERIOD] [-z { 0 | 1 }] [-p { 0 | 1 }] [-b BUS] [-a ADDRESS] [-i INFERENCE_UDS] [-e EXEGETE] [-r EXEGETE] | -d }] [-v]

Options
--version show program's version number and exit
-h, --help show this help message and exit
-n NAME, --name=NAME the name of the OPC configuration
-m MODEL, --model=MODEL set MODEL { N2 | N3 | R1 | S30 }
-s SAMPLE_PERIOD, --sample-period=SAMPLE_PERIOD set SAMPLE_PERIOD
-z RESTART_ON_ZEROES, --restart-on-zeroes=RESTART_ON_ZEROES restart on zero readings (default 1)
-p POWER_SAVING, --power-saving=POWER_SAVING enable power saving mode (default 0)
-b SPI_BUS, --spi-bus=SPI_BUS override host SPI bus
-c SPI_DEVICE, --spi-device=SPI_DEVICE override host SPI chip select
-i INFERENCE, --inference=INFERENCE set inference server UDS
-e USE_EXEGETE, --exegete=USE_EXEGETE use EXEGETE { ISLin/Twin/N3/v1 | ISLin/Twin/R1/v1 | ISLin/Urban/N2/v1 | ISLin/Urban/N3/v1 | ISLin/Urban/N3/vLGW | ISLin/Urban/N3/vPLHR }
-r REMOVE_EXEGETE, --remove-exegete=REMOVE_EXEGETE remove named EXEGETE
-d, --delete delete the OPC configuration
-v, --verbose report narrative to stderr

EXAMPLES

./opc_conf.py -m N2 -b 0 -a 1 -e iseceen2v1
./opc_conf.py -m S30 -b 1

DOCUMENT EXAMPLE

{"model": "N3", "sample-period": 10, "restart-on-zeroes": true, "power-saving": false, "inf": "/home/scs/SCS/pipes/lambda-model-pmx-s1.uds", "exg": []}

FILES

~/SCS/conf/opc_conf.json

SEE ALSO

scs_dev/particulates_sampler

scs_mfr/opc_firmware_conf
scs_mfr/opc_version

REFERENCES

https://github.com/bruno-beloff/scs_core/blob/develop/src/scs_core/particulate/exegesis/exegete_catalogue.py

BUGS

The specification allows for a power saving mode - which enables the OPC to shut down between readings - but this is not currently implemented.