ADAM MQTT Manual
Edition V1.0 ,
Oct. 2017
1. Introduction of MQTT(Message Queue Telemetry Transport)
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.
Feature 1: Actively Publish MQTT Message
Advantech ADAM can be set up to actively publish I/O data in the form of MQTT message at a
user’s defined interval. This feature provides an efficient way to transmit data and lower the system
loading.
Feature 2: Shorten Downtime with Actively Alarm Event Notification
The alarm event is usually referred to the digital input status changes or analog input in out of the
user’s defined range. Advantech ADAM is designed with alarm trigger mechanism with instant notice.
The MQTT message will be published to broker at the moment that alarm conditions is reached.
2. MQTT Format for ADAM module
Digital Input/output module :
ADAM-6050/6051/6052/6060/6066
Description
Get the I/O data
of ADAM digital
input/output
module
Set the value of a
digital output of
ADAM module
Advantech/MAC ID/ctl/dox
Example:
Advantech/0013430C981F/ctl/do1
{"v":DO status},
MQTT Topic
Advantech/MAC ID /data
Example:
Advantech/0013430C981C/data
JSON data
{"s":1,"t":0,"q":192,"c":1, "dix":DI
status,"dox":DO status}
Firmware
D version
: V6.01B11
and higher
version
D version
: V6.01B11
and higher
version
Will Topic
Advantech/MACID/Device_Status
Example:
Advantech/0013430C981F/
Device_Status
{ "status":"Device Status",
"name":"Device
Name","macid":"MACID",
"ipaddr":"IP Address"}
D version
:V6.01B13
And higher
version
ADAM-6250/6251/6256/6260/6266
Description
Get the I/O data
of ADAM digital
input/output
module
Set the value of a
digital output of
ADAM module
Advantech/MAC ID/ctl/dox
Example:
Advantech/0013430C981F/ctl/do1
{"v":DO status},
MQTT Topic
Advantech/MAC ID /data
Example:
Advantech/0013430C981C/data
JSON data
{"s":1,"t":0,"q":192,"c":1, "dix":DI
status,"dox":DO status}
Firmware
AE version
: A1.06B02
and higher
version
AE version
: A1.06B02
and higher
version
Will Topic
Advantech/MACID/Device_Status
Example:
Advantech/0013430C981F/
Device_Status
{ "status":"Device Status",
"name":"Device
Name","macid":"MACID",
"ipaddr":"IP Address"}
AE version
: A1.06B03
And higher
version
Analog Input modules:
ADAM-6017
Description
Get the I/O data
of ADAM
Analog input
module
Get an analog
input range
configuration.
Advantech/MAC ID/cfg/sensor/aix
Example:
Advantech/0013430C981F/cfg/sensor/ai1
{"typ":"Range"}
MQTT Topic
Advantech/MAC ID /data
Example:
Advantech/0013430C981C/data
JSON data
{"s":1,"t":0,"q":192,"c":1, "aix":AI
value,"ai_stx":condition, "dox":DO
status, "do_stx":condition}
Firmware
CE version
:V5.03 B03
and higher
version
CE version
:V5.04 B00
and higher
version
Set the value of a
digital output of
ADAM module
Advantech/MAC ID/ctl/dox
Example:
Advantech/0013430C981F/ctl/do1
{"v":DO status},
CE version
:V5.03 B03
and higher
version
Set an analog
input
configuration
Advantech/MAC ID/set/sensor/aix
Example:
Advantech/00D0C9F94344/set/sensor/ai1
{"typ":"Range"}
CE version
:V5.04 B00
and higher
version
Will Topic
Advantech/MACID/Device_Status
Example:
Advantech/0013430C981F/
Device_Status
{ "status":"Device Status",
"name":"Device
Name","macid":"MACID",
"ipaddr":"IP Address"}
CE version
:V5.04 B00
and higher
version
General
s:
t:
q:
c:
Reserved for further use, default value 1
Reserved for further use, default value 0
Reserved for further use, default value 192
Reserved for further use, default value 1
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,
DI status
true:on,
false:off
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)
ai_stx value
0
1
2
3
4
5
Condition
Channel disable
Streaming, normal
High latch
High momentary
Low latch
Low momentary
do_stx:
Condition of digital output channel(x-1), only for ADAM-6017 Digital output
do_stx value
1
2
Condition
Streaming, normal
DO change
typ:
Range
Input range
Input rage value
Range value
0-20mA
4-20mA
+-20mA
0-5V
1-5V
0-10V
0-1V
0-500mV
0-150mV
+-10V
+-5V
+-2.5V
+-1V
+-500mV
Input range
0~20mA
4~20mA
±20mA
0~5V
1~5V
0~10V
0~1V
0~500mV
0~150mV
±10V
±5V
±2.5V
±1V
±500mV
1.3 MQTT Configuration
The MQTT of ADAM can be configured by ADAM.Net utility (V2.05.11 B05 and higher version)
or ASCII command.
Note
:MQTT function must be disabled before configuration and enable the MQTT function after
configuration is done.
Host (Broker IP)
Users set up the broker URL or IP address . ADAM module connection to broker over standard
MQTT protocol.
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.