Service MQTT API (DAQAstra)

All DAQAstra services communicate over MQTT using a publish / subscribe model.

A service topic prefix is always:

{firmware_name}/{service_name}

Spaces in service_name are converted to underscores.

Below each service lists:

  • Command (subscription) topics it listens on
  • Publish (output / status) topics it emits
  • Payload schemas (JSON unless otherwise noted)
  • Notes / semantics

Topic layouts are derived from the code in config-schema/src/schema/topics.rs (see the large comment block there) and the message structs in config-schema/src/messaging/*.rs.
If a field is optional it may be omitted or sent as null.

Version note: This document supersedes older copies that mixed legacy names. Always regenerate if message structs change.


Conventions

TermMeaning
{prefix}{firmware_name}/{service_name}
Booleantrue / false
MillisecondsUnsigned 16/32-bit depending on context (see field)
TemperatureDegrees Celsius unless otherwise stated
Percent / Ratio0.0 – 1.0 floating-point
Integer rangesUnless stated, unsigned and constrained by underlying hardware width

actuator

Generic actuator command, state and fault reporting

Topic SuffixDirKindExample JSON
/commandincmd{ "command": "OPEN" }
/stateouttelemetry{ "command": "OPEN", "state": "OPEN", "success": true }
/faultoutevent{ "error": "Unknown State", "state": "Unknown", "attempted_command": "OPEN" }
Payload Schemas

/command ActuatorCommand

{ "command": "OPEN" }

/state ActuatorState

{ "command": "OPEN", "state": "OPEN", "success": true }

/fault ActuatorFault

{ "error": "Unknown State",  "state": "Unknown", "attempted_command": "OPEN" }

aht20

AHT20 humidity / temperature sensor data

Topic SuffixDirKindExample JSON
``outtelemetry{ "temperature": { "value":22.8, "unit":"C" }, "humidity": { "value":40.1, "unit":"%RH" }, "dewpoint": { "value":9.7,…
Payload Schemas

`` Aht20Data

{ "temperature": { "value":22.8, "unit":"C" }, "humidity": { "value":40.1, "unit":"%RH" }, "dewpoint": { "value":9.7, "unit":"C" } }

analog_in

Analog input channel telemetry and configuration

Topic SuffixDirKindExample JSON
''outtelemetry{ "value": 0.123, "unit": "V" }
/configincmd{ "conversion": { "Polynomial": [0.0, 1.0, 0.0, 0.0] } }
Payload Schemas

'' AnalogInData

{ "value": 0.123, "unit": "V" }

/config AnalogConversionConfig

{ "conversion": { "Polynomial": [0.0, 1.0, 0.0, 0.0] } }

analog_out

DAC / analog output configuration and feedback

Topic SuffixDirKindExample JSON
/configincmd{ "value": 2.5, "max_volts": 5.0, "enabled": true }
/responseouttelemetry{ "value": 2.5, "max_volts": 5.0, "enabled": true, "error": null }
Payload Schemas

/config DacConfig

{ "value": 2.5, "max_volts": 5.0, "enabled": true }

/response DacConfig

{ "value": 2.5, "max_volts": 5.0, "enabled": true, "error": null }

bang_bang

Bang-bang control loop command and status

Topic SuffixDirKindExample JSON
/configincmd{ "upper_threshold": 50.0, "lower_threshold": 40.0, "update_frequency": 1000, "pause_output": false, "pause_target_in…
/responseouttelemetry{ "upper_threshold": 50.0, "lower_threshold": 40.0, "update_frequency": 1000, "pause_output": false, "pause_target_in…
/outputouttelemetry{ "output": true, "input": 41.2 }
Payload Schemas

/config BangBangCommandandResponse

{ "upper_threshold": 50.0, "lower_threshold": 40.0, "update_frequency": 1000, "pause_output": false, "pause_target_input": false }

/response BangBangCommandandResponse

{ "upper_threshold": 50.0, "lower_threshold": 40.0, "update_frequency": 1000, "pause_output": false, "pause_target_input": false }

/output BangBangData

{ "output": true, "input": 41.2 }

bme280

BME280 environmental sensor (temperature, pressure, humidity, dewpoint)

Topic SuffixDirKindExample JSON
/configincmd{ "standby":"62ms", "mode":"Weather", "offset":0.0 }
/dataouttelemetry{ "temperature": { "value":23.5, "unit":"C" }, "pressure": { "value":101325, "unit":"Pa" }, "humidity": { "value":45.…
/responseouttelemetry{ "temperature": { "value":23.5, "unit":"C" }, "pressure": { "value":101325, "unit":"Pa" }, "humidity": { "value":45.…
Payload Schemas

/config Bme280Command

{ "standby":"62ms", "mode":"Weather", "offset":0.0 }

/data Bme280Data

{ "temperature": { "value":23.5, "unit":"C" }, "pressure": { "value":101325, "unit":"Pa" }, "humidity": { "value":45.2, "unit":"%RH" }, "dewpoint": { "value":11.2, "unit":"C" } }

/response Bme280Data

{ "temperature": { "value":23.5, "unit":"C" }, "pressure": { "value":101325, "unit":"Pa" }, "humidity": { "value":45.2, "unit":"%RH" }, "dewpoint": { "value":11.2, "unit":"C" } }

command

Send an arbitrary command to another service in-firmware

Topic SuffixDirKindExample JSON
``incmd{ "data":true }
Payload Schemas

`` CommandCmd

{ "data":true }

complementary_pwm

Complementary PWM output pair with deadtime

Topic SuffixDirKindExample JSON
/configincmd{ "enable":true, "duty":0.4, "frequency":20000, "deadtime":0.02 }
/responseouttelemetry{ "enable":true, "duty":0.4, "frequency":20000, "deadtime":0.02, "error":null }
Payload Schemas

/config ComplementaryPwmCommand

{ "enable":true, "duty":0.4, "frequency":20000, "deadtime":0.02 }

/response ComplementaryPwmCommandResponse

{ "enable":true, "duty":0.4, "frequency":20000, "deadtime":0.02, "error":null }

digital_in

Digital input state reporting

Topic SuffixDirKindExample JSON
/outouttelemetry{ "data": true }
Payload Schemas

/out DigitalInData

{ "data": true }

digital_out

Digital output control and feedback

Topic SuffixDirKindExample JSON
/configincmd{ "command": true }
/responseouttelemetry{ "data": true }
Payload Schemas

/config DigitalOutCommand

{ "command": true }

/response DigitalOutData

{ "data": true }

flowmeter

Flow meter pulse counting and rate reporting

Topic SuffixDirKindExample JSON
/configincmd{ "slope":1.0, "offset":0.0, "measurement_interval":1000 }
/responseouttelemetry{ "slope":1.0, "offset":0.0, "measurement_interval":1000 }
/dataouttelemetry{ "value": 3.21, "units": "L/min" }
Payload Schemas

/config FlowMeterConfig

{ "slope":1.0, "offset":0.0, "measurement_interval":1000 }

/response FlowMeterConfig

{ "slope":1.0, "offset":0.0, "measurement_interval":1000 }

/data FlowMeterData

{ "value": 3.21, "units": "L/min" }

ir_cam

IR camera max pixel and frame row data. One frame consists of 36 rows of 24 pixels.

Topic SuffixDirKindExample JSON
/maxouttelemetry{ "data": 41.7 }
/{row}outtelemetry[23.1, 23.5, 23.6, ... 24 vals]
Payload Schemas

/max IrCamMaxData

{ "data": 41.7 }

/{row} IrCamFrameRow

[23.1, 23.5, 23.6, ... 24 vals]

loadcell

Load cell data (publishes raw/converted weight) and tare command

Topic SuffixDirKindExample JSON
``outtelemetry{ "value": 12.34, "unit": "g" }
/tareincmdtrue
Payload Schemas

`` LoadCellData

{ "value": 12.34, "unit": "g" }

/tare LoadCellTareCommand

true

math

Arbitrary math expression using other services in a firmware. Result will either be f32 or bool depending on the configured output type of the channel.

Topic SuffixDirKindExample JSON
/pauseincmdtrue
/ch{0..num_channels}intelemetry{"data": 1.0 } or {"data": true }
/responseouttelemetry{ "data":true }
Payload Schemas

/pause MathPauseCommand

true

/ch{0..num_channels} MathResult

{"data": 1.0 } or {"data": true }

/response MathPauseResponse

{ "data":true }

mpu6050

MPU6050 IMU configuration and accel/gyro telemetry

Topic SuffixDirKindExample JSON
/configincmd{ "accel": 2, "gyro": 1 }
/accelouttelemetry{ "x":0.01, "y":-0.02, "z":0.98, "temp":36.5, "roll":1.2, "pitch":-0.7 }
/gyroouttelemetry{ "x":0.1, "y":-0.1, "z":0.05, "temp":36.5 }
/responseouttelemetry{ "accel": "2g", "gyro": "250dps" }
Payload Schemas

/config MpuConfig

{ "accel": 2, "gyro": 1 }

/accel MpuAccelData

{ "x":0.01, "y":-0.02, "z":0.98, "temp":36.5, "roll":1.2, "pitch":-0.7 }

/gyro MpuGyroData

{ "x":0.1, "y":-0.1, "z":0.05, "temp":36.5 }

/response MpuConfigResponse

{ "accel": "2g", "gyro": "250dps" }

pds

Power distribution system channel & rail configuration and telemetry

Topic SuffixDirKindExample JSON
/configincmd{ "rail":"Vcc2I", "over_current_limit":10, "over_voltage_limit":26, "enable":true }
/ch0outtelemetry{ "state":"Running", "current":0.12, "enabled":true, "power_good":true }
/ch1outtelemetry{ "state":"Running", "current":0.5, "enabled":true, "power_good":true }
/ch2outtelemetry{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }
/ch3outtelemetry{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }
/ch4outtelemetry{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }
/ch5outtelemetry{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }
/ch6outtelemetry{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }
/ch7outtelemetry{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }
/vcc1iouttelemetry{ "state":"Running", "current":0.50, "voltage":5.05, "enabled":true }
/vcc2iouttelemetry{ "state":"Running", "current":0.40, "voltage":12.08, "enabled":true }
Payload Schemas

/config PowerRailConfig

{ "rail":"Vcc2I", "over_current_limit":10, "over_voltage_limit":26, "enable":true }

/ch0 PowerChannelResponse

{ "state":"Running", "current":0.12, "enabled":true, "power_good":true }

/ch1 PowerChannelResponse

{ "state":"Running", "current":0.5, "enabled":true, "power_good":true }

/ch2 PowerChannelResponse

{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }

/ch3 PowerChannelResponse

{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }

/ch4 PowerChannelResponse

{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }

/ch5 PowerChannelResponse

{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }

/ch6 PowerChannelResponse

{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }

/ch7 PowerChannelResponse

{ "state":"Disabled { rt: None }", "current":0, "enabled":false, "power_good":false }

/vcc1i PowerRailResponse

{ "state":"Running", "current":0.50, "voltage":5.05, "enabled":true }

/vcc2i PowerRailResponse

{ "state":"Running", "current":0.40, "voltage":12.08, "enabled":true }

pid

PID controller command, response, and output topics

Topic SuffixDirKindExample JSON
/configincmd{ "kp":0.2, "ki":0.02, "kd":0.4, "setpoint":1.0, "pause_output":false, "pause_target_input":false }
/responseouttelemetry{ "kp":0.2, "ki":0.02, "kd":0.4, "setpoint":1.0, "pause_output":false, "pause_target_input":false }
/outputouttelemetry{ "output":0.15, "last_output":0.14, "setpoint":1.0, "input":0.92 }
Payload Schemas

/config PidCommandAndResponse

{ "kp":0.2, "ki":0.02, "kd":0.4, "setpoint":1.0, "pause_output":false, "pause_target_input":false }

/response PidCommandAndResponse

{ "kp":0.2, "ki":0.02, "kd":0.4, "setpoint":1.0, "pause_output":false, "pause_target_input":false }

/output PidData

{ "output":0.15, "last_output":0.14, "setpoint":1.0, "input":0.92 }

pwm

Standard PWM output control and response

Topic SuffixDirKindExample JSON
/configincmd{ "enable":true, "duty":0.5, "frequency":1000 }
/responseouttelemetry{ "enable":true, "duty":0.5, "frequency":1000, "error":null }
Payload Schemas

/config PWMCommand

{ "enable":true, "duty":0.5, "frequency":1000 }

/response PWMCommandResponse

{ "enable":true, "duty":0.5, "frequency":1000, "error":null }

qmc5883l

QMC5883L magnetometer heading / vector data and configuration

Topic SuffixDirKindExample JSON
/configincmd{ "field_range":2, "data_rate":50, "oversample":512, "declination": -13.2 }
``outtelemetry{ "x": 120.0, "y": -30.5, "z": 5.2, "heading": 182.4 }
/responseouttelemetry{ "success": { "field_range":2, "data_rate":50, "oversample":512, "declination": -13.2 }, "error": null }
Payload Schemas

/config Qmc5883lConfig

{ "field_range":2, "data_rate":50, "oversample":512, "declination": -13.2 }

`` Qmc5883lData

{ "x": 120.0, "y": -30.5, "z": 5.2, "heading": 182.4 }

/response Qmc5883lConfigResponse

{ "success": { "field_range":2, "data_rate":50, "oversample":512, "declination": -13.2 }, "error": null }

stateful_actuator

Stateful actuator sequences, moves and status topics (schema-defined config)

Topic SuffixDirKindExample JSON
/commandincmd{ "command": "TRANSITION"}
/faultincmd{ "error": "Invalid State", "inputs": [true,false], "outputs": [true,false], "current_state": "IDLE" }
/sequenceouttelemetry{ "name": "seq1", "success": true }
/stateouttelemetry{ "success": true, "inputs": [true,false], "outputs": [true,false], "current_state": "IDLE" }
Payload Schemas

/command StatefulActuatorCommand

{ "command": "TRANSITION"}

/fault StatefulActuatorFault

{ "error": "Invalid State", "inputs": [true,false], "outputs": [true,false], "current_state": "IDLE" }

/sequence StatefulActuatorSequenceStatus

{ "name": "seq1", "success": true }

/state StatefulActuatorState

{ "success": true, "inputs": [true,false], "outputs": [true,false], "current_state": "IDLE" }

stepper

Stepper driver motion command, response and status progress

Topic SuffixDirKindExample JSON
/configincmd{ "target_accel":0.1, "max_velocity":0.5, "num_steps":2000, "direction":true, "enable":true }
/responseouttelemetry{ "target_accel":0.1, "max_velocity":0.5, "num_steps":2000, "direction":true, "enable":true }
/statusouttelemetry{ "percent": 42, "steps": 840, "position": 1234 }
Payload Schemas

/config StepperConfig

{ "target_accel":0.1, "max_velocity":0.5, "num_steps":2000, "direction":true, "enable":true }

/response StepperConfig

{ "target_accel":0.1, "max_velocity":0.5, "num_steps":2000, "direction":true, "enable":true }

/status StepperStatus

{ "percent": 42, "steps": 840, "position": 1234 }

thermocouple

Thermocouple temperature readings

Topic SuffixDirKindExample JSON
/temperatureouttelemetry{ "temperature": 23.5, "ambient": 22.1, "unit": "C", "error": null }
Payload Schemas

/temperature ThermocoupleData

{ "temperature": 23.5, "ambient": 22.1, "unit": "C", "error": null }