2020/04/07
WCC Lite user manual
Table 38: MQTT parameters for
Signals
tab
Parameter
Type
Description
Mandatory
signal_name
string
Userfriendly signal name
device_alias
string
Device alias from a Devices tab
Yes
signal_alias
string
Unique signal name to be used
Yes
source_device_alias
string
device_alias of a source device
source_signal_alias
string
signal_alias of a source signal
enable
boolean
Enabling/disabling of an individual signal
Yes
topic
string
Topic name to override the value built by default
Table 39: MQTT (
mqttclient
) command line debugging options
Option
Description
h [ –help ]
Display help information
c [ –config ]
Configuration file location (default /etc/elsetamqtt.conf)
V [ –version ]
Show version
d<debug level> [ –debug ]
Set debugging level
r [ –redis ]
Show REDIS output
m [ –mqtt ]
Show MQTT output
it works as an adapter between REDIS and MQTT data) are shown in Table 39. It is necessary to
make sure that no copies of the same process are running in a background because broker can
stop old session because of multiple connections from the same user from the same IP.
19.3 MQTT data format
The format of a MQTT message is a bit different than Redis messages.
Redis messages
are supported as CSV strings:
value,timeStamp,flags
(where
value
can be float, integer or
nan
;
timeStamp
Unix timestamp in milliseconds;
flags
contain additional information about a
measurement). MQTT messages are supported as
value,timestamp,quality
(where
value
can be
float, integer or
nan
;
timeStamp
Unix timestamp in milliseconds;
quality
shows if a value is to
be considered as valid). Quality parts of a string is always equal to 1 except for Redis messages
containing invalid (IV), nontopic (NT) and/or overflow (OV) flags.
As mentioned, MQTT client acts as an adapter between Redis and MQTT, therefore data from topic
in Redis is written to a topic in MQTT. Therefore
mqttclient
has to know the mapping table before
starting. This table is saved at
/etc/elsetamqtt.json
. Every Redis topic name is constructed as
tag/[device_alias]/[signal_alias]/[direction]
. Prefix
tag/
is always used before the rest of argument.
device_alias
and
signal_alias
represent columns in Excel configuration. Direction can have one of
four possible values
rout
,
out
,
in
,
rin
; all of which depend on the direction data is sent or acquired
protocolwise. The same Redis topic structure is preserved in MQTT by default making it easier to
find matching signals, however, as no recalculation is done by MQTT and only PUBLISH messages
are now supported, only Redis signals with
in
direction have their MQTT mappings.
A user can create and select his own topic name in Excel configuration, in
topic
column. As no
recalculation is done by MQTT and only PUBLISH messages are now supported, only Redis signals
with
in
direction have their MQTT mappings.
145
1.4.0 | ELSETA | MQTT