Skip to main content

MQTT uplink

Uplink Production

Publish tag values to any MQTT 3.1.1 / 5 broker (Mosquitto, EMQX, HiveMQ, …).

An uplink runs on a Site Runtime and subscribes to device groups; every value it receives is sent on. See Uplinks for the flow and the payload format.

Settings​

ParameterTypeDefaultRange / optionsRequiredDescription
MQTT Version
version
map3.1.13.1.1, 5.0no
Client ID
client-id
stringmii_${random_str}max 255 charsyes
QoS Level
qos
mapQoS 0QoS 0, QoS 1, QoS 2noMQTT QoS level for message delivery
Upload Format
format
mapvalues-formatvalues-format, tags-format, ECP-format, Custom, protobufyesJSON format of the data reported. In Values-format mode, data are split into values and errors sub objects. In Tags-format mode, tag data are put in a single array. ECP-format is the format for connecting to ECP data storage. Custom format supports user-defined data format. For variable definition specifications, please refer to 'the uplink payload documentation
Schema
schema
string—max 81960 charsnoShown when Upload Format = Custom.
Upload Tag Error Code
upload_err
booltrue—noWhen data tag collection reports an error, report the tag error code.
Enable driver topic
enable_topic
booltrue—noSubscription driver related topics, including read/req, write/req and action/req.
Write Request Topic
write-req-topic
stringmii/${random_str}/write/reqmax 255 charsyesMQTT topic to receive write request messages.
Write Response Topic
write-resp-topic
stringmii/${random_str}/write/respmax 255 charsyesMQTT topic to send write response messages.
Driver Topic Prefix
driver-topic-prefix
stringmii/${random_str}max 128 charsyesMQTT topic prefix for driver function.
Driver Status Report
upload_drv_state
boolfalse—noReports status of all the southbound nodes to the specified topic.
Status Report Topic
upload_drv_state_topic
stringmii/${random_str}/state/updatemax 255 charsyesShown when Driver Status Report = true.
Status Report Interval (Second)
upload_drv_state_interval
int11 – 3600yesShown when Driver Status Report = true.
Offline Data Caching
offline-cache
boolfalse—noOffline caching switch. Cache MQTT messages when offline, and sync cached messages when back online.
Cache Memory Size (MB)
cache-mem-size
int—1 – 1024yesMax in-memory cache size in megabytes when MQTT connection exception occurs. Should be smaller than cache disk size. Shown when Offline Data Caching = true.
Cache Disk Size (MB)
cache-disk-size
int—1 – 10240yesMax in-disk cache size in megabytes when MQTT connection exception occurs. Should be larger than cache memory size. If nonzero, cache memory size should also be nonzero. Shown when Offline Data Caching = true.
Cache Sync Interval (MS)
cache-sync-interval
int10010 – 120000yesShown when Offline Data Caching = true.
Broker Host
host
stringbroker.example.commax 255 charsyes
Broker Port
port
int18831 – 65535yes
Username
username
string—max 255 charsno
Password
password
string—max 255 charsno
SSL
ssl
boolfalse—noEnable SSL connection
CA
ca
file—max 81960 charsyesCA certificate which signs the server certificate Shown when SSL = true.
Client Cert
cert
file—max 81960 charsnoClient x509 certificate when using two way authentication Shown when SSL = true.
Client Private Key
key
file—max 81960 charsnoClient private key when using two way authentication Shown when SSL = true.