led_controller - bruno-beloff/scs_dev GitHub Wiki

docs > software repositories > scs_dev > commands > device control


DESCRIPTION

The led_controller utility operates the a two-colour (red / green) LED mounted on the South Coast Science free-to-air SHT board. LEDs can be made to flash or have steady state. The utility is intended to run as a systemd service, or as an (un-managed) background process.

The led_controller waits for data on stdin or the named Unix domain socket, then updates the state of the LEDs accordingly. Updates are in the form of a JSON array containing two single-character strings - the first represents 80% of the duty cycle, the second 20%. If a steady state is required, the two values should be the same.

When the led_controller starts, the LEDs remain in their previous state. When the led_controller terminates, the LEDs remain in their last state.

SYNOPSIS

led_controller -v -u scs_led_control.uds

Options
--version show program's version number and exit
-h, --help show this help message and exit
-u UDS, --uds=UDS receive from Unix domain socket instead of stdin
-v, --verbose report narrative to stderr

EXAMPLES

( tail -f ~/SCS/pipes/led_control_pipe & ) | ./led_controller.py -v &
./led_controller.py -v -u /home/scs/SCS/pipes/scs_led_control.uds

DOCUMENT EXAMPLE

{"colour0": "R", "colour1": "G"}

SEE ALSO

scs_dev/aws_mqtt_client
scs_dev/interface_power
scs_dev/led

RESOURCES

Praxis LED colours

https://unix.stackexchange.com/questions/139490/continuous-reading-from-named-pipe-cat-or-tail-f