Dec 3, 2026
What is MQTT? How machines, sensors and systems talk to each other
MQTT lets a machine offer its data once to every system that needs it. How it works, what it doesn't take care of, and how to start securely.

"We'll just do that over MQTT"
The integrator says the connection will "just go over MQTT". The machine builder's quote lists an MQTT interface as an option. And your IT manager wants to know which ports have to be opened and who will be able to reach the data. Three people, one abbreviation, and nobody explaining what you are buying.
You know the problem behind it. Every new dashboard, every report and every link to the ERP needs its own line to the PLC. After a few years the same controller is being polled by five systems, each with its own format and its own supplier. MQTT is a widely used way out of that: the machine offers its data once, and every system that needs it picks it up in the same place. This article explains what MQTT is, how it works, what it doesn't take care of for you, and how to start with it securely.
What is MQTT?
MQTT is an open messaging protocol that lets devices and systems exchange data through one central point, the broker. A machine publishes a message to the broker, the temperature of the filling machine for example, and every system that has subscribed to that subject receives it straight away. Sender and receiver don't know each other: they only know the broker. That principle is called publish/subscribe.
The protocol is lightweight. Its maintainers describe it as designed for constrained devices and low-bandwidth, high-latency or unreliable networks. That is why it works as well on a sensor with a SIM card as on a server in the data centre.
MQTT comes from industry, not from the consumer world. Andy Stanford-Clark of IBM and Arlen Nipper of Arcom Control Systems wrote the first version at the start of 1999, to get away from what they called hundreds of proprietary poll/response protocols. Today it is an open standard that no supplier owns: version 3.1.1 is published as ISO/IEC 20922:2016 and version 5.0 has been an OASIS standard since March 2019.
How does MQTT work? Broker, topics and subscriptions
There are three roles:
- The publisher sends messages: a PLC, a sensor, or an edge device that reads an older controller.
- The broker receives all messages and passes them on to whoever asked for them.
- The subscriber subscribes to the subjects it needs: a dashboard, a database, the MES, an AI model.
Every message has a topic: a path with slashes that says where the value comes from, for example plant/packaging/line2/filler/temperature.
A subscriber doesn't have to spell out every path. The standard has two wildcards: + stands for exactly one level, # for everything below. With plant/packaging/+/filler/temperature you follow the fillers on all lines, with plant/packaging/line2/# everything on line 2.
Two things make this different from the classic connection. The machine is no longer polled: it reports what changes by itself, instead of five systems coming to ask every second whether there is news. And the connection runs from the inside out: the device calls the broker, not the other way round. No inbound port has to be opened in the firewall of your machine network for it.
How certain does a message have to arrive?
MQTT has three levels of delivery assurance, called Quality of Service (QoS):
| Level | Promise | Suited to |
| QoS 0 | At most once: the message can get lost | Measurements that come again every second |
| QoS 1 | At least once: it arrives, possibly twice | Status changes and alarms |
| QoS 2 | Exactly once | Messages that must not count double, such as a piece counter or a command |
Higher is not better: every level costs extra messages back and forth. Choose per type of data.
What happens when a device drops out?
Two provisions make sure a subscriber knows where it stands. A retained message is the last message on a topic that the broker keeps: whoever has just subscribed gets the latest state immediately and doesn't have to wait for the next change. And with the last will, a device lays down when it connects which message the broker sends if the connection drops unexpectedly. That is how your dashboard sees the difference between "the machine is stopped" and "we can't hear the machine any more".
Why MQTT in the factory?
- One connection per machine instead of one per system. A new dashboard or a new integration is one more subscriber. Nothing changes on the machine and the PLC gets no extra requests.
- You aren't tied to one supplier. The protocol is an open standard, and brokers and clients are available from many suppliers and as open source.
- It works over poor connections. That is what it was designed for. It also makes it usable for equipment outside the factory: installations at customer sites, mobile units, measuring points in the field. Many IoT solutions work this way.
- It fits a segmented network. Devices set up the connection themselves, outbound. Your IT department manages one point, the broker, and decides there per device what it may publish and read. That is the basis of a manageable IT-OT integration.
What MQTT does not take care of
This is where many MQTT projects get stuck. The protocol transports messages, nothing more.
- It says nothing about the content. A message is a row of bytes. One supplier sends JSON, another its own binary format, a third a bare number without a unit. Without agreements you have hundreds of topics after a year that nobody understands any more. There are additions for that: Sparkplug, since 2023 the international standard ISO/IEC 20237, lays down how topics are named, how a message is built and how a device signs on and off. A Unified Namespace does the same with a naming structure that follows your own plant.
- It keeps no history. The broker passes messages on and remembers at most the latest state per topic. If you want trends, reports or data to train a model on, you connect a database as a subscriber.
- It is not a control network. For the control loop in the machine, motion and safety, the fieldbuses stay where they are. MQTT takes data out of the machine, it doesn't drive a servo.
- Security is not on by default. On the standard port 1883 everything travels unencrypted. Use TLS (port 8883), give every device its own account or certificate, and lay down per topic who may write and read. A broker on the internet without a password is an open door to your production data.
- The broker is a central point. If it fails, nobody sees anything any more. That calls for a broker that is set up redundantly, and edge devices that buffer messages locally until the connection is back.
MQTT or OPC UA?
It is rarely a choice. The two do different work and in practice sit one behind the other.
| MQTT | OPC UA | |
| What it is | A lightweight way to transport messages | A protocol with a built-in information model |
| Strong at | Many sources, many consumers, changing connections | Describing and reading one machine in detail |
| Watch out | You have to agree on meaning yourself | Every consumer sets up its own connection to every machine |
| Usually sits | Between the plant and the systems above it | In and right next to the machine |
The common pattern: an edge device reads the PLC over OPC UA, or on older machines over Modbus or the controller's own protocol, and publishes the values over MQTT to the broker. OPC UA also has a publish/subscribe variant of its own that can use MQTT as transport. So the two are growing towards each other.
How to start with MQTT
- Choose one broker for the plant. Not one per project or per supplier, or you rebuild the islands.
- Agree on the topic structure before the first machine publishes. Follow your company: site, department, line, machine, measurement. Renaming afterwards means changing every subscriber.
- Lay down what goes into a message. Value, unit and timestamp, in one format for all machines. Sparkplug or an agreement of your own: the point is that you pick one.
- Secure it from the first day. TLS, an identity per device, rights per topic. Closing it off afterwards costs more than starting right.
- Connect a database as a subscriber. Then you build up history from day one.
That is how MeshOS connects too: an edge device reads your existing PLCs, read-only, and brings the values with their context to one data layer that dashboards, reports and AI read from. Open standards such as MQTT and OPC UA make sure every next system can join, and you don't have to replace a machine for it.
Frequently asked questions about MQTT
What does MQTT stand for?
Nothing any more. The letters come from MQ Telemetry Transport, from the days when it was an IBM protocol, and the IANA port registry still lists it as Message Queuing Telemetry Transport. During standardisation it was agreed that the name MQTT only stands for itself.
What is an MQTT broker?
A broker is the server that receives all messages and passes them on to the subscribers. It also checks who may connect and who may read or write which topic. There are open source and commercial brokers, and you run one in the cloud or on a server of your own in the plant.
Is MQTT secure?
That depends on how you set it up. The protocol supports encryption with TLS and authentication per device, but enforces neither. With TLS, an identity per device and rights per topic it is fit for production data. Without them it isn't.
What is the difference between MQTT and Sparkplug?
MQTT takes care of transport, Sparkplug takes care of the agreements. Sparkplug is a specification on top of MQTT that lays down how topics are named, how a message is built and how a device signs on and off. The aim: devices and software from different suppliers that understand each other without you having to agree on anything per connection.
Can my PLC do MQTT?
Sometimes. Many recent controllers have an MQTT client on board or as a library. Older PLCs don't: there an edge device reads the data over the protocol the controller does speak, and publishes it over MQTT. Nothing changes in the PLC program.
Conclusion: MQTT is the road, not the destination
MQTT solves one problem well: getting data from many machines to many systems without building a connection for every combination. What that data means, who may reach it and where the history stays, you arrange yourself. Agree on that up front and MQTT gives you a base every next dashboard and every next AI project connects to. Skip it and you mostly have a faster way to send clutter.
Meshnex designs and builds that data layer, from the first PLC connection through to security. Read on about the Unified Namespace, or connect one machine for free and watch your own data come in.



