ADAM MQTT Manual V1
ADAM MQTT Manual V1
MQTT protocol is the lightweight messaging transport. Clients connect to the broker and the
MQTT message is forwarded by broker. Furthermore, ADAM is designed with features that make it
more flexible in the IoT applications.
DI/O Module
dix: Digital Input status of channel(x-1)
example: {"di2":true} means status of DI channel 1 is true
dox: Digital Output status of channel(x-1)
example: {"do2":true} means status of DO channel 1 is true
DO status true:on, false:off
DI status true:on, false:off
AI Module
aix: Analog Input value of channel (x-1)
Note: If AI channel is disabled, AI value shows “9999.9999”
ai_stx: Condition of analog Input channel (x-1)
do_stx: Condition of digital output channel(x-1), only for ADAM-6017 Digital output
Note :MQTT function must be disabled before configuration and enable the MQTT function after
configuration is done.
Heartbeat (keep-Alive)
The broker will regularly check the connection with the ADAM at interval of heartbeat
(keep-Alive) setting. The minimum interval setting is 5 seconds.
Dead band
Dead band is set to determine the minimum interval between publishing two MQTT messages. It
is set to prevent MQTT message from publishing excessively by noise.
Retain Message
When the retain function is enabled. The broker will store the last message of the topic. If a new
subscription for the topic is made, the message will be sent to the client. Client is able to get the
last message and does not need to wait until the next message is updated.
Will topic
If the client subscribes the topic for the ADAM which is disconnected, the broker will inform the
clients by sending the will message to whom subscribe the will topic
Will Topic of ADAM: Advantech/MACID/Device_Status
Will message:
{ "status":"Device Status", "name":"Device Name","macid":"MACID", "ipaddr":"IP Address"}
Will message example:
{"status":"disconnect","name":"ADAM6051","macid":"00D0C9FEFFF5","ipaddr":"10.0.0.1"}
QoS(Quality of Service)
Users can choose the QoS level of publish/subscribe. Three levels of QoS (Quality of Service)
are defined in MQTT.
Level 0: broker/client deliver the message at most once
Level 1: broker/client deliver the message at least once
Level 2: broker/client deliver the message exactly once
Publish/Subscribe Topic
The MQTT message is forwarded by broker based on the MQTT topic. Each message contains
the data value. When client publishs MQTT message to broker, the clients who subscribe the
topic will receive the MQTT message accordingly.
1.3.1Configuration by ADAM.Net utility
Click “Cloud button” in the function list to configure the MQTT setting
Users could set up the broker URL or IP address at “Host”. Three public broker sources link are
listed in the utility
- iot.eclipse.org
- test.mosquitto.org
- broker.mqttdashboard.com
Step 1 :Click “Tools” and “MQTT”, the page will forward to ADAM MQTT page
Note: 1. Path, Username, Password, TLS, Clean session function is not released
2. The webpage only supports the connection to broker over WebSocket
Step 3: Subscribe/Publish function
Subscribe
Users set up the topic and choose the QoS level, then click the subscribe button. The message of the
topic will be shown in the history field.
Publish
Set up publish topic, QoS and message, then click Publish button. The MQTT message will be
published to the broker. If the retain function is enabled. ADAM will receive the last message when
subscribes the topic.