Host Examples

For Broker running on localhost

send an S1F3 to the tool for svid 33008

mosquitto_pub -h localhost -t "gemhost/svidrequest/svid" -m "33008"
mosquitto_pub -h localhost -t "gemhost/svidrequest/sendmessage" -m "1"

subscribe to the value list in the S1F4 reply

mosquitto_sub -h localhost -t "gemhost/svidresponse/svidlist"

Remote Broker

To start the MQTT Server using a remote (not localhost) broker do this:

java -DMQTTBroker=ipaddress deploy.XXXXXX.EquipmentController

where ipaddress is the location of the broker (for example, 192.168.5.150)

the -h command on the subscribe and publish will be -h 192.168.5.150

for example:

mosquitto_sub -h 192.168.5.150 -t "gemhost/svidresponse/svidlist" 
{ "values": [] }
mosquitto_pub -h 192.168.5.150 -t "gemhost/svidrequest/svid" -m "33008"
mosquitto_pub -h 192.168.5.150 -t "gemhost/svidrequest/sendmessage" -m "1"

results in a value appearing in the subscription for svidlist:

mosquitto_sub -h 192.168.5.150 -t "gemhost/svidresponse/svidlist" 
{ "values": [] } 
{ "values": [ "2019031221054472" ] , type:"20 }

MQTT Downside

MQTT has no built in way to indicate data quality.

Also could be a problem (needs to be tested) if a subscriber is listening that if the data source publishes (i.e. could be transitional or bad quality data, a zero (0) for example from a plc) that it will be pushed to the broker without any indication of quality.

  • mqtt_server_integration_guide.txt
  • Last modified: 2020/05/12 21:41
  • by wikiadmin