Skip to content
Michiel TJampens edited this page Mar 28, 2021 · 1 revision

For now, the only option to add MQTT is by manually filling in the settings.xml.

<mqtt>
  <broker id="mqtt_broker">
      <address>tcp://127.0.0.1:1234</address>	<!-- The MQTT broker address, instead of ip, a hostname is also valid  -->
      <defaulttopic>sensor/data/</defaulttopic> <!-- The default topic -->
      <subscribe label="sbe38">output/temperature</subscribe> <!-- Topic to subscribe and BaseWorker label -->      
  </broker>
</mqtt>	

The broker id is how it will be referenced in the code.

Subscriptions

The label has the same usage as for a stream. Meaning for the BaseWorker to know what to do with the received data.

Subscriptions can also be added/removed through commands (telnet,dasbot).

mqtt:subscribe,mqtt_broker,sbe38,output/temperature // To subscribe like in the xml example
mqtt:unsubscribe,mqtt_broker,sbe38,output/temperature // To unsubscribe
mqtt:unsubscribe,mqtt_broker,sbe38,all // To unsubscribe from all topics of sbe38
mqtt:store,mqtt_broker                // To store the changes in the xml
Clone this wiki locally