Logger MQTT Implementation
The LOGGER has multiple uplink interfaces. The interface
parameters shown in the screenshot below are for the MQTT
interface. Key attributes are:
The URL of the server that the MQTT interface
should publish and/or subscribe to. Changing the server
requires a reboot.
The signature is passed to the server so that messages
can be checked to see if they are from a vaild source.
MQTT servers do not do this type of checking. It is
effectively a password.
The device name is passed to the server so that the server
can identify what device the message is coming from.
MQTT servers do not use this identification at this time.
A possible future enhancement is to include this name as
part of the Topic prefix.
The number of seconds between LOGGER attempts to publish
sensor data as topics. When this value is zero all
The table below the parameters shows the sensors that can be sent to
MQTT. The sensor name is in the StreamID column and the sensor
value is in the next column. Each sensor can be enabled or disabled
for MQTT publishing.
MQTT publications are made to the topic:
where E8:68:E7:64:45:06 is the MAC address of the LOGGER.
Each enabled sensor gets an individual message published.
The text is tab separated it looks like this:
$SAMPLE DeskTop1 device-name 1631711498 5748 MS_Temperature 27.65
$SAMPLE DeskTop1 device-name 1631711498 5748 MS_Pressure 1008.53
||this allows the reader to know how to parse the message.|
||whatever is set in the IOT_UPLINK_SIGNATURE field|
||whatever is set in the IOT_UPLINK_DEVICE field|
||the unix time the sample was taken|
||a sequence number, if you have received sequence # x and x+1 you have all the samples that exist|
||the name of the sensor|
||the value of the sensor|
The LOGGER also publishes each latest value to the topic
MS_Temperature is changed for each publication to the name
from the StreamID column.
The LOGGER subscribes to the topic
LOGGER-E8:68:E7:64:45:06-Command (the same topic name as
what is published to with -Command appended).
The intent is to allow the listener to observe the sequence number
and decide to request
publication of a particular sequence number (or time) by
publishing a request on the LOGGER-E8:68:E7:64:45:06-Command topic.
Right now the LOGGER just reports the most recent command it
received. The eventual intent is to have the logger publish
historical sensor values based on requests for particular sequence
numbers made to this topic.
The requests will be:
Publications responding to these report requests will not publish to the
'latest' topic, just to LOGGER-E8:68:E7:64:45:06.