Usage
Stabilizer supports run-time settings configuration using MQTT or the USB port.
Settings can be stored in the MQTT broker so that they are automatically applied whenever Stabilizer reboots and connects. This is referred to as "retained" settings. Broker implementations may optionally store these retained settings as well such that they will be reapplied between restarts of the MQTT broker.
Stabilizer also supports storing run time settings on the device. Any configurations saved to stabilizer via the USB port will be automatically reapplied when Stabilizer reboots. MQTT settings retained on the broker or settings published after the device has connected to the broker override the settings saved on Stabilizer.
Settings are specific to a device. Any settings configured for one Stabilizer will not be applied to another. Disambiguation of devices is done by using Stabilizer's MQTT identifier, which is defaulted to Stabilizer's MAC address.
Settings are specific to an application. If two identical settings exist for two different applications, each application maintains its own independent value.
Miniconf installation
Create a virtual python environment with python -m venv --system-site-packages .venv
and activate it with source .venv/bin/activate
.
Refer to the venv
tutorial for more information on activating the
virtual environment. The command depends on the operating system.
Next, install prerequisite packages with python -m pip install py/
.
To use the miniconf
command line too see python -m miniconf --help
.
Miniconf also exposes a programmatic Python API, so it's possible to write automation scripting of Stabilizer as well.
Settings
The Miniconf Python utility utilizes a unique "device prefix". The device prefix is always of the
form dt/sinara/<app>/<mac-address>
, where <app>
is the name of the application and
<mac-address>
is the MAC address of the device, formatted with delimiting dashes, and lower case letters.
Settings have a path
and a value
being configured. The value
parameter is JSON-encoded data
and the path
value is a path-like string.
python -m miniconf -b mqtt -d dt/sinara/dual-iir/+ stream='"10.34.16.123:4000"'
Where mqtt
is the MQTT broker (host name or address) that matches the one used by the application
(set using the USB terminal) and 10.34.16.123
and 4000
are the desired stream target IP and port.
The prefix can be discovered as above or determined for a specific device through the USB serial terminal.
Refer to the application documentation for the exact settings and values exposed for each application.
The rules for constructing path
values are documented in miniconf
's
documentation
Refer to the documentation for Miniconf for a description of the possible error codes that Miniconf may return if the settings update was unsuccessful.
Telemetry
Stabilizer applications publish telemetry utilizes MQTT for managing run-time settings configurations as well as live telemetry reporting.
Telemetry is defined as low rate, general health information. It is not intended for high throughput or efficiency. Telemetry is generally used to determine that the device is functioning nominally.
Stabilizer applications publish telemetry over MQTT at a set rate. Telemetry data units are defined by the application. All telemetry is reported using standard JSON format.
Telemetry is intended for low-bandwidth monitoring. It is not intended to transfer large amounts of data and uses a minimal amount of bandwidth. Telemetry is published using "best effort" semantics - individual messages may be dropped or Stabilizer may fail to publish telemetry due to internal buffering requirements.
In its most basic form, telemetry publishes the latest ADC input voltages, DAC output voltages, and digital input states.
Refer to the respective application documentation for more information on telemetry.
Stream
Stabilizer supports streaming real-time data over UDP. The stream is intended to be a high-bandwidth mechanism to transfer large amounts of data from Stabilizer to a host computer for further analysis.
Streamed data is sent with "best effort" - it's possible that data may be lost due to network congestion.
Refer to the the respective application documentation for more information.
stabilizer-stream
is an application that supports process
the stream and measures power spectral density/integrated RMS in real time.