Skip to content

Stream Configuration

Ellis Percival edited this page Jan 20, 2021 · 1 revision

Configuration of stream inputs and outputs is done by configuring a stream module, then configuring some inputs and/or outputs.

stream_modules

List of dictionary values which will contain the following options. Further options may be added by the stream module itself.

TODO: Add the options for all of the individual modules

name

Name of this module configuration. This is an arbitrary string that is used by the stream_reads and stream_writes configurations to specify which stream module is being used.

module

Name of the class of stream module used (currently only streamserial) for this configuration.

cleanup

Whether to run the 'cleanup' functions for this module when the software exits. Defaults to true.

stream_reads

List of dictionary values which will contain the following options. Further options may be added by the stream module itself.

TODO: Add the options for all of the individual modules

name

Name of this stream. This will be used as part of the MQTT topic when data is read from the stream and an MQTT message is sent with its value. For example: <topic_prefix>/stream/<name>.

module

Name of the module configuration to use for this input. This is the name used in the stream_modules section documented above.

retain

Boolean value that specifies whether to use the retain flag when publishing MQTT messages for data received on this stream.

encoding

How the data read from the stream should be encoded before publishing it to the relevant MQTT topic. By default, the data are left as bytes.

interval

Number of seconds to wait between polling the stream for new data. Default is 60.

stream_writes

List of dictionary values which will contain the following options. Further options may be added by the stream module itself.

TODO: Add the options for all of the individual modules

name

Name of this stream. This must be used as part of the MQTT topic when sending data to this stream. For example, to send data, you'd publish your payload to the <topic_prefix>/stream/<name> topic.

module

Name of the module configuration to use for this output. This is the name used in the stream_modules section documented above.