Skip to main content

Uplinks

An Uplink is a runtime exit. It runs on a Site Runtime, subscribes to poll groups of the Devices, and publishes every value it receives to an outside system: an MQTT broker, Kafka, an IoT hub, a webhook. An uplink never polls a device itself.

Uplinks page with one MQTT uplink connected and its counters
Uplinks page with one MQTT uplink connected and its counters

The page is Connectivity → Uplinks.

Uplinks are not a database export

The product has no database uplink. Process history goes to the plant historian (mi-tsdb, or the embedded PostgreSQL in Lite). To read it from outside use the read-only SQL access described in Read with SQL. InfluxDB and PostgreSQL appear only as old types that connect but send no values ("In this version device data does not reach this type").

How it works​

  • You tick the device groups the uplink should send. Every poll result of those groups goes out.
  • One message is sent per group and cycle (or one per tag, with One topic per tag).
  • If the target is down, messages wait in a bounded queue and, with offline caching, on disk.
  • An uplink can also receive: MQTT uplinks listen for write and read requests. See Writes.
TypeUseStatus
MQTTAny MQTT 3.1.1 or 5 brokerProduction. Settings
AWS IoTAWS IoT CoreProduction. Settings
Azure IoT HubAzure IoT HubProduction. Settings
Sparkplug BSparkplug B hostsProduction. Settings
WebSocketA WebSocket serverProduction. Settings
KafkaKafka clustersProduction. Settings
HTTP webhookYour HTTPS endpointProduction. Runs in the Site Runtime service.
OPC UA ServerLet an OPC UA client read the runtimeLAB. Read only unless client_writes is enabled. No certificates, security policies or users yet. Settings
  1. Open Connectivity → Uplinks and click Add uplink.
  2. On "Choose plugin" click the type.
  3. Fill Name and the connection fields. The form is drawn from the plugin schema, like the Devices form.
  4. For TLS pick the certificates from the Certificates store.
  5. Under Subscribe to device groups tick the groups to send. The text says "Checked device groups are subscribed to this uplink." If there is no device yet: "Create a device with groups under Devices first."
  6. For MQTT and AWS IoT decide on topics (see Topics).
  7. Click Test connection. It checks that the target answers.
  8. Keep Enabled on and click Save.
Add uplink: the first step of the uplink form
Add uplink: the first step of the uplink form

The list shows Name, Kind, Target, Status and Subs (subscriptions). Status values include Connected, Connecting, Retrying, Error, "Needs enabling", Waiting, Down and "Site Runtime needs an update". Counters under a row: "N sent", "N dropped", "N not accepted", "N queued", and "N kept in the plant" (withheld by the egress policy).

Settings reference: MQTT​

FieldMeaningDefault
MQTT Version3.1.1 or 5.03.1.1
Client IDMust be unique on the broker.mii_ plus a random string
QoS Level0, 1 or 20
Upload Formatvalues-format, tags-format, ECP-format, Custom (needs a Schema), protobufvalues-format
Upload Tag Error CodeInclude the error code of failed tags.on
Enable driver topicListen for read and write requests.on
Write Request Topic, Write Response TopicWhere write requests arrive and answers go.mii/<random>/write/req, .../write/resp
Driver Topic PrefixPrefix of the driver topics.mii/<random>
Driver Status ReportPublish device status regularly (topic, interval 1 to 3600 s).off
Offline Data CachingCache while the broker is away.off
Cache Memory Size (MB)1 to 1024.none
Cache Disk Size (MB)1 to 10240.none
Cache Sync Interval (MS)10 to 120000.100
Broker Host, Broker PortThe broker.broker.emqx.io, 1883
Username, PasswordCredentials.empty
SSL, CA, Client Cert, Client Private KeyTLS. The CA is required when SSL is on.off
Change the default broker

The default Broker Host is a public test broker. Always replace it with your own broker.

Other types: AWS IoT (Client ID, QoS 0 or 1, Upload Format, write topics, offline cache, device data endpoint, Root CA, device certificate and key; port 8883, TLS always on), Azure IoT Hub (Device ID, QoS 0 or 1, IoT Hub Hostname, Authentication Shared Access Signature or X.509 Certificates), Sparkplug B (Client ID, Group ID, Node ID, Enable Alias, Group Path, broker), WebSocket (Upload Format, Server URL, certificates). Kafka has Broker Address (default 127.0.0.1:9092), Default Topic (mii-data), Upload Format, Compression, Batch Max Messages (10000), Linger (5 ms), Security Protocol, SASL, certificates, Message Timeout (5000 ms) and Acknowledgements.

HTTP webhook​

FieldMeaningDefault
URLhttp or https. The Site Runtime's own localhost is blocked. Redirects are not followed.none
HMAC secretOptional. Signs the body in the header X-MI-Signature: sha256=<hex>.none
Samples per post1 to 500100
Longest wait (ms)50 to 10000200
Timeout (ms)500 to 600005000
Retries0 to 83
CA certificate, Skip server certificate checkTLS.none
Deliver samplesThe master switch. Only a person can turn it on. An AI assistant cannot.off

Test connection says "The address can be reached. Nothing was posted." Posts carry the headers X-MI-Batch-Id (the same on every retry), X-MI-Attempt and X-MI-Signature. Delivery is at least once: your endpoint must accept a repeated batch id.

Topics​

Default topic​

With no prefix and ISA-95 topics off, an MQTT uplink publishes each group to

/mii/<uplink name>/<device name>/<group name>

For the demo plant: /mii/plant-mqtt/line1-modbus/fast.

Topic prefix​

In the subscription tree each group has Topic prefix (optional) with the buttons Apply the prefix and Undo. With a prefix the topic is <prefix>/<device name>/<group name>. The prefix applies to MQTT and AWS IoT, and only while ISA-95 topics are off.

ISA-95 topics (UNS)​

Switch on ISA-95 topics (UNS) (MQTT and AWS IoT) to publish on the plant model's names:

ModeTopic
Group (default)[root/]enterprise/site/area/workCenter[/workUnit]/equipment/<group name>. One message per group.
One topic per tag[root/]enterprise/site/area/workCenter[/workUnit]/equipment/<tag>. One message per tag.
  • Topic root (optional) goes in front. The field Topic preview lists up to 20 topics with a copy button.
  • Segments are the ISA-95 codes, not display names. Characters + # / $ %, white space and control characters are percent-encoded (a space becomes %20).
  • Limits: 1024 bytes and 32 levels (AWS IoT: 256 bytes and 8 levels). Nothing is cut off. A topic over the limit is an error.
  • Reserved roots that cannot be derived: spBv1.0, mii/v1/..., mii/write/..., and the uplink's own write and status topics.
  • Uplinks never publish retained messages.
  • A rename of a code moves the topic. The uplink re-subscribes and does not reconnect.
  • All tags of a group must belong to the same equipment. Otherwise the group has no ISA-95 topic and keeps its default topic.

Error texts you may see in the preview: "another uplink on this broker uses this topic", "same topic as another group", "tags in this group belong to different equipment", "topic is too long", "topic has too many levels", "reserved topic", "no complete ISA-95 path".

The public read-only feed mii/uns/... of the embedded broker is a different thing. See Namespace and MQTT topics.

Sparkplug B and Kafka​

Sparkplug B uses spBv1.0/<group id>/NBIRTH|NDEATH/<node id> and spBv1.0/<group id>/DBIRTH|DDATA/<node id>/<device>. Kafka sends to the Default Topic.

Payloads​

values-format (default)​

{
"node": "line1-modbus",
"group": "fast",
"timestamp": 1764670530123,
"values": { "State": 1, "Speed": 118, "Temperature": 4.1, "Pressure": 3.21 },
"errors": { "Level": 3002 }
}

node is the device name, group the group name. timestamp is epoch milliseconds from the Site Runtime. errors has the codes of failed tags and exists only when Upload Tag Error Code is on. See Error codes.

tags-format and ECP-format​

{
"node": "line1-modbus",
"group": "fast",
"timestamp": 1764670530123,
"tags": [
{ "name": "Speed", "value": 118, "type": 4 },
{ "name": "Level", "error": 3002 }
]
}

ECP-format carries type (a numeric type code: 3 INT16, 4 UINT16, 9 FLOAT and so on). Custom without a schema falls back to the tags-format without type. In per-tag mode each message has this shape with one tag.

Public UNS payload​

On mii/uns/... the payload is {"value":4.1,"quality":"good","ts":"2026-12-02T10:15:30.123Z","tagId":"tag_…"}.

Store and forward​

UplinkWhat happens when the target is away
MQTT, AWS IoT, Azure IoT Hub, Sparkplug BWith Offline Data Caching messages are cached in memory (up to Cache Memory Size) and on disk (up to Cache Disk Size), then sent when the connection is back, paced by Cache Sync Interval. Without it messages wait in the bounded queue only.
HTTP webhookAt least once. Samples wait on a disk queue. A post can repeat with the same batch id. Retry waits start at 500 ms and grow to 1 minute. A Retry-After up to 5 minutes is honoured. Turning delivery off deletes waiting data.
AllThe runtime's uplink queue is bounded. When it is full the oldest data is dropped ("dropped" counter) so that polling never stalls.

Separately, the Site Runtime's own buffer protects the path to the historian (default 4 hours of retention). See Data path.

Tags that may not leave the plant (governance egress policy) are withheld before any uplink sees them. The list shows "N kept in the plant".

Example: the demo plant to an MQTT broker​

Goal: publish the group fast of line1-modbus as one message per cycle on ISA-95 topics.

  1. Add an MQTT uplink named plant-mqtt.
  2. Broker Host broker.example.local (your broker), Broker Port 1883, QoS Level 1, Upload Format values-format.
  3. Turn on ISA-95 topics (UNS) and set Topic root (optional) to demo.
  4. Under Subscribe to device groups tick line1-modbus › fast.
  5. Click Test connection, then Save.

The topic preview shows

demo/DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/fast

(codes, assuming the codes of the demo model). Check from a shell:

mosquitto_sub -h broker.example.local -t 'demo/#' -v
demo/DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/fast {"node":"line1-modbus","group":"fast","timestamp":1764670530123,"values":{"State":1,"Speed":118,"Temperature":4.1,"Pressure":3.21,"GoodCount":15234,"RejectCount":187}}

With One topic per tag the same cycle gives six messages, for example on demo/DEMOFOODS/IZMIR/BOTTLING/LINE1/FILLER/Speed.

Limits and good practice​

  • Use QoS 1 for production data and QoS 0 for high-rate telemetry. Inbound QoS 2 messages are not delivered to the uplink.
  • Give each uplink its own Client ID. Two clients with the same ID disconnect each other.
  • Prefer ISA-95 topics: they follow the plant model, not device names.
  • Size the offline cache for the longest outage you accept: values per second times message size times outage seconds.
  • Do not subscribe one uplink to hundreds of fast groups. Use several uplinks.
  • Secrets are never shown again after saving. Keep the broker password in a password manager.

Troubleshooting​

SymptomCauseFix
Status Error or RetryingBroker unreachable, wrong credentials or TLS.Test connection. Check host, port, CA.
Status "Needs enabling"Enabled is off.Enable it.
Status "Site Runtime needs an update"The runtime is older than the Console.Update the runtime.
Connected, no messagesNo group subscribed, or the group has no tags.Tick the groups.
"same topic as another group"Two groups map to one topic.Change the equipment or the prefix.
"tags in this group belong to different equipment"A group mixes equipment.Split the group by equipment.
"dropped" growsQueue full, broker too slow.Enable the offline cache, slow the groups, use QoS 0.
Webhook delivers nothingDeliver samples is off.A person must turn it on.