ML-x17 DATA LOGGER MANUAL
Manufacturers of low power instruments
page 84
4.25.12
COM-Tunnel
With MQTT its possible to send/receive data to/from serial devices connected to the data logger. In example
you could send commands to change some device specific settings. Commands can be send to the serial
sensor or accessory port on the main PCB as well as on option boards. The (binary) data contained in the
MQTT payload will be passed transparently 1 to 1 to the concerned serial device and the response will be
replied as (binary) payload 1 to 1 as well, it
’s up to the MQTT-client to format and interpret the data to/from
the serial device (which could be MODBUS/RTU, SDI-12, NMEA-0183 or any other protocol).
When a COM-tunnel message is received for a device connected at a serial sensor port and the device
requires power from the 12V sensor power switch, the data logger will switch on the 12V power and wait a
certain warm-up time before sending the command to the device (See chapter: Serial port).The warm-up
time will not be applied in case of sequential commands in the same MQTT-session.
When a COM-tunnel message is received for a device connected at an accessory port and the device
requires power from the 5V accessory power switch, the data logger will switch on the 5V power and wait
a certain warm-up time before sending the command to the device (See chapter: Accessory port).The
warm-up time will not be applied in case of sequential commands in the same MQTT-session.
After sending data to the serial device, the data logger will wait max 3 seconds for reply from the connected
device. In case of no response, the data logger will publish an MQTT message with empty payload. If the
serial device replies, the reply is considered complete after a character silence time of 0.25s. The data
logger will publish an MQTT message with the full 1 to 1 (binary) reply as the payload.
4.25.12.1
Topics
An MQTT-client should format a command publishing topic as follows:
“
YDOC
/<device serial number>/
comtx
/<port>[/<client defined sup-topics
]” (QoS=1)
Where <port> can be (if installed and configured in the data logger):
“sp1”, the serial sensor port on the main PCB
“ap1”, the accessory port on the main PCB
“sp2”, the serial sensor port on an option board
“ap2”, the accessory port on an option board.
The MQTT-client can specify optional sub-topics for its own internal management, the used sub-topics
are also included in the MQTT reply messages. Such sub-topics could be used for grouping or matching
commands with replies (e.g. by using some sequence# as sub-topic).
Example
: “YDOC/99091660/
comtx
/sp1” or “YDOC/99091660/
comtx
/sp1/S123/METEO/
”
The data logger will publish the reply with the same topic as the command, but will replace the text
“com
t
x” with “com
r
x
” (Example: “YDOC/99091660/
comrx
/sp1/S
123/METEO/”)
An MQTT-client can use wildcards to subscribe to any COM-tunnel message from any data logger, by
subscribing to:
“
YDOC
/+/
comrx
/#” (QoS=1)
4.25.12.2
Limits
Topic size:
128 characters.
Payload size: 256 bytes for commands, 512 bytes for replies.
Device reply timeout: 3s (The device should answer within 3 sec).
Silence time: 0.25s (A reply is considered complete after a communication silence time of 0.25s).