aws_mqtt_client - bruno-beloff/scs_dev GitHub Wiki

docs > software repositories > scs_dev > commands > subscribing to / publishing live data


DESCRIPTION

The aws_mqtt_client utility is used to subscribe or publish using the South Coast Science / AWS messaging infrastructure.

Documents for publication are gained from stdin by default, otherwise from the specified Unix domain socket (UDS). Likewise, documents gained from subscription are written to stdout, or a specified UDS.

Subscriptions can be specified either by a project channel name, or by an explicit messaging topic path. Documents gained by subscription may be delivered either to stdout, or to a specified Unix domain socket.

In order to operate effectively in environments with unreliable communications, the aws_mqtt_client buffers messages prior to publication. The size of the buffer is set by the scs_mfr/mqtt_conf utility.

An explanation of the LED colour patters generated by the aws_mqtt_client utility are detailed in the Wiki entry Praxis LED colours.

The aws_mqtt_client utility requires AWS client authorisation to operate.

Only one MQTT client should run at any one time, per TCP/IP host.

SYNOPSIS

aws_mqtt_client.py [-p UDS_PUB] [-s] { -c { C | G | P | S | X } (UDS_SUB_1) | [SUB_TOPIC_1 (UDS_SUB_1) .. SUB_TOPIC_N (UDS_SUB_N)] } [-e] [-l LED_UDS] [-v]

Options
--version show program's version number and exit
-h, --help show this help message and exit
-p UDS_PUB_ADDR, --pub-addr=UDS_PUB_ADDR read publications from UDS instead of stdin
-s, --sub write subscriptions to UDS instead of stdout
-c CHANNEL, --channel=CHANNEL subscribe to channel
-e, --echo echo input to stdout (if not writing subscriptions to stdout)
-l LED_UDS, --led=LED_UDS send LED commands to LED_UDS
-v, --verbose report narrative to stderr

EXAMPLES

( cat < /home/scs/SCS/pipes/mqtt_publication_pipe & ) | /home/scs/SCS/scs_dev/src/scs_dev/aws_mqtt_client.py -v -cX -l /home/scs/SCS/pipes/scs_led_control.uds  > /home/scs/SCS/pipes/control_subscription_pipe

FILES

~/SCS/aws/aws_client_auth.json
~/SCS/aws/certs/NNNNNNNNNN-certificate.pem.crt
~/SCS/aws/certs/NNNNNNNNNN-private.pem.key
~/SCS/aws/certs/NNNNNNNNNN-public.pem.key
~/SCS/aws/certs/root-CA.crt

SEE ALSO

Praxis LED colours

scs_dev/aws_topic_publisher
scs_dev/aws_topic_subscriber
scs_dev/led_controller

scs_mfr/aws_client_auth
scs_mfr/aws_project
scs_mfr/mqtt_conf

BUGS

When run as a background process, aws_mqtt_client will exit if it has no stdin stream.