MQTT uplink
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
| Parameter | Type | Default | Range / options | Required | Description |
|---|---|---|---|---|---|
MQTT Versionversion | map | 3.1.1 | 3.1.1, 5.0 | no | |
Client IDclient-id | string | mii_${random_str} | max 255 chars | yes | |
QoS Levelqos | map | QoS 0 | QoS 0, QoS 1, QoS 2 | no | MQTT QoS level for message delivery |
Upload Formatformat | map | values-format | values-format, tags-format, ECP-format, Custom, protobuf | yes | JSON 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 |
Schemaschema | string | — | max 81960 chars | no | Shown when Upload Format = Custom. |
Upload Tag Error Codeupload_err | bool | true | — | no | When data tag collection reports an error, report the tag error code. |
Enable driver topicenable_topic | bool | true | — | no | Subscription driver related topics, including read/req, write/req and action/req. |
Write Request Topicwrite-req-topic | string | mii/${random_str}/write/req | max 255 chars | yes | MQTT topic to receive write request messages. |
Write Response Topicwrite-resp-topic | string | mii/${random_str}/write/resp | max 255 chars | yes | MQTT topic to send write response messages. |
Driver Topic Prefixdriver-topic-prefix | string | mii/${random_str} | max 128 chars | yes | MQTT topic prefix for driver function. |
Driver Status Reportupload_drv_state | bool | false | — | no | Reports status of all the southbound nodes to the specified topic. |
Status Report Topicupload_drv_state_topic | string | mii/${random_str}/state/update | max 255 chars | yes | Shown when Driver Status Report = true. |
Status Report Interval (Second)upload_drv_state_interval | int | 1 | 1 – 3600 | yes | Shown when Driver Status Report = true. |
Offline Data Cachingoffline-cache | bool | false | — | no | Offline caching switch. Cache MQTT messages when offline, and sync cached messages when back online. |
Cache Memory Size (MB)cache-mem-size | int | — | 1 – 1024 | yes | Max 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 – 10240 | yes | Max 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 | int | 100 | 10 – 120000 | yes | Shown when Offline Data Caching = true. |
Broker Hosthost | string | broker.example.com | max 255 chars | yes | |
Broker Portport | int | 1883 | 1 – 65535 | yes | |
Usernameusername | string | — | max 255 chars | no | |
Passwordpassword | string | — | max 255 chars | no | |
SSLssl | bool | false | — | no | Enable SSL connection |
CAca | file | — | max 81960 chars | yes | CA certificate which signs the server certificate Shown when SSL = true. |
Client Certcert | file | — | max 81960 chars | no | Client x509 certificate when using two way authentication Shown when SSL = true. |
Client Private Keykey | file | — | max 81960 chars | no | Client private key when using two way authentication Shown when SSL = true. |