NOVUS AUTOMATION
23/85
8.
MQTT PROTOCOL
LogBox Wi-Fi
is compatible with the Message Queue Telemetry Transport (MQTT) protocol, a protocol designer for low data bandwidth
consumption and which uses the Publish/Subscribe paradigm for message exchange.
Acting as a Publisher/Subscriber MQTT,
LogBox Wi-Fi
requires a middleware named Broker, responsible for sending messages from Publishers
to Subscribers, to operate.
LogBox Wi-Fi
is, simultaneously, a Publisher, with 7 publication topics, to provide information about sensors and
several device statuses and a Subscriber, with 1 inscription topic, to receive possible parameters alterations and to remotely offer a certain control
level to the user.
If configured, this protocol also allows the
LogBox Wi-Fi
to communicate with Amazon Web Services (AWS). To perform this procedure, check the
AWS via MQTT Configuration Manual
, available on our website.
The MQTT protocol and
NOVUS Cloud
functionality do not work simultaneously.
8.1
PUBLICATION TOPICS
When connected to a Broker, the
LogBox Wi-Fi
can register up to seven topics, which will be presented below. Check the
section of this chapter for more information about the frames that molded the responses to each publication topic.
The message sent in each topic corresponds to a JSON frame, which encapsulates several parameters. In the frame, these parameters correspond
to strings. Values of each parameter, however, must be processed differently.
8.1.1
STATUS TOPICS
•
novus/<sn>
*
/status/channels:
Topic for the publication of the
last
log of the analog channels and digital channel in "Pulse Count" mode.
Example:
{"n_channels":4,"n_alarms":10,"timestamp":43277.69538194,"battery":5.69,"value_channels":[0.000,24.200,0.000,24.200],
"alarms":[1,1,0,0,1,0,0,0,0,0],"buzzer_state":0}
•
novus/<sn>
*
/status/event:
Topic for the publication of the
last
log of the digital channel in "Event Log" mode.
Example:
{"timestamp":43277.82236111, "event_type":"down", "millisecond":630}
•
novus/* /status/event/accumulator:
Topic intended for the publication of the
last
log of the accumulator channel (Volume/Count since the last
Reset) before the counter is reset. In case of overflow, it will be published with the following value: 4294967296.
Example:
{"timestamp":44092.78295139, "ch_dig_acc":4294967296}
8.1.2
LOGS TOPICS
•
novus/<sn>
*
/log/channels:
Topic for the publication of
all
logs of the analog channels and digital channel in "Pulse Count" mode. Used
mainly when there is loss of communication link with the Broker or lack of external power, as it will receive all historical logs.
Example:
{"n_channels":4, "n_alarms":10, "timestamp":43277.69538194, "battery":5.69, "value_channels":[0.000,24.200,0.000,24.200],
"alarms":[1,1,0,0,1,0,0,0,0,0], "buzzer_state":0}
•
novus/<sn>
*
/log/event:
Topic for the publication of
all
logs of the analog channels and digital channel in "Event Log" mode. Used mainly
when there is loss of communication link with the Broker or lack of external power, as it will receive all historical logs.
Example:
{"timestamp":43277.82236111,"event_type":"down","millisecond":630}
•
novus/* /log/event/accumulator:
Topic for the publication of
all
logs from the accumulator channel (Volume/Count since the last Reset)
before the counter is reset. In case of overflow, it will be published with the following value: 4294967296. Used mainly when there is a link
break or external power failure, as it will receive all the historical logs.
Example:
{"timestamp":44092.78295139, "ch_dig_acc":4294967296}
8.1.3
CONFIGURATION TOPIC
•
novus/<sn>
*
/config:
Topic for the publication of the device configuration. It shall be published at the latest every five minutes.
Example:
{"n_channels":4,"n_alarms":10, "timestamp":43277.56898148, "frame_format":"array_static", "channels_enabled":[0,1,0,1],
"hash":"C071DA88ABA151A607AAB1527000E0017335FF08", "gmt":-180, "tag_channels":["","Analog1","","Analog3"],
"tag_units":["","Celsius","","Celsius"], "sp_alarms":[0.000,0.000,0.000,20.000,25.200,0.000,0.000,0.000,0.000,0.000]}
8.1.4
RESPONSE TOPIC
•
novus/<sn>
*
/response:
Topic for the publication of the command’s response received by the device.
Table 06
lists the permissible error
responses for this topic.
Example:
{"config_receive":"ok","error_type":"none","parameter":"none"}
8.1.5
IDENTIFICATION TOPIC
•
novus/neighbor:
Topic for the publication of the identify from the device(s) connected to the Broker. It shall be published at the latest every
five minutes.
Example:
{"model":"LogBox Wi-Fi", "serial":12345678, "ip":"192.168.88.10", "mac":"B0:38:29:5D:FE:B1" ,"lqi":-40,"firmware_version":1.00}
*
The
<sn>
is the device serial number. That way, there will be no clash of topics in the Broker.