HomeKnowledgeMQTT & OPC UA

Guide · Communication

MQTT & OPC UA — how machines exchange data.

Two protocols define industrial IoT: the lightweight MQTT and the data-rich OPC UA. They complement each other more than they compete.

MQTT — lightweight and scalable

MQTT is a lightweight publish/subscribe protocol: devices (publishers) send to a central broker (e.g. Mosquitto, HiveMQ); recipients (subscribers) subscribe only to the topics that interest them. Publishers and subscribers never communicate directly — which makes the model highly scalable.

Three delivery guarantees (QoS)

  • QoS 0 — at most once (fire and forget)
  • QoS 1 — at least once (with acknowledgement, retransmitted if needed)
  • QoS 2 — exactly once

OPC UA — data-rich and secure

OPC UA (OPC Foundation) is an industrial client/server protocol with a rich information model and built-in security — strong wherever interoperability and semantically described data matter.

Often the best solution: both

A proven combination uses OPC UA for the semantically rich, secure environment within the plant and MQTT as an efficient, scalable transport to the cloud — analysis, storage, visualization. For how this fits into the overall chain, see the IoT architecture.

Frequently Asked Questions

Which QoS should I choose?
QoS 0 for non-critical, frequent readings (where loss is acceptable), QoS 1 for important events (duplication possible), QoS 2 for cases where every message must arrive exactly once. Higher QoS costs latency and overhead.
MQTT or OPC UA?
It depends on the task — and often the answer is both. OPC UA for rich, secure machine data on site, MQTT for lightweight transport to the cloud. We choose the stack to suit the system.