💡PLC to Cloud via HiveMQ (Edge + Cloud) — OPC UA → MQTT → Confluent
Read PLC via OPC UA, map to MQTT with HiveMQ Edge, bridge to HiveMQ Cloud, and stream to Confluent (Kafka).
Sending PLC data to Cloud (Kafka) makes machine data available in real-time for dashboards, analytics, and cloud applications. It keeps the PLC focused on control, while Kafka distributes the data to multiple systems simultaneously.

Why send PLC data to Cloud (Kafka)?
PLC data (temperatures, counts, states, and alarms) is valuable, but PLCs are designed for machine control, not for handling large amounts of data or integrating with cloud systems.
By streaming PLC data into Kafka (via HiveMQ), you get:
Scalability – Kafka can handle millions of events per second from many PLCs and machines.
Integration – Kafka acts as a hub, making PLC data accessible to cloud applications, analytics platforms, databases, AI/ML pipelines, and more.
Real-time processing – Process machine data as it happens (predictive maintenance, quality checks, dashboards).
Decoupling – PLCs stay focused on control, while Kafka distributes the data to any number of consumers without overloading the PLC.
👉 In short: Kafka turns raw PLC data into a real-time data stream for enterprise systems and analytics.
Information flow
1. Read PLC data via OPC UA
First, we read raw data from the Siemens S7-1500 PLC via OPC UA. The Siemens PLC acts as an OPC UA server, and the Edge device acts as an OPC UA client. The Revolution Pi acts as an Edge device, running HiveMQ Edge —a software-based Edge MQTT Gateway that features several protocol adaptors. We use an OPC UA adaptor that reads directly from the Siemens S7-1500 PLC.


2. Data mapping
Map OPC UA tags to MQTT topics in HiveMQ Edge, which means now we have the data streaming to the defined MQTT topic of the MQTT broker running locally in the Revolution Pi.

3. MQTT Bridge
HiveMQ Edge bridges the local MQTT broker to the HiveMQ Cloud broker, enabling the sharing of data globally via a secure network.

4. HiveMQ Cloud
HiveMQ Cloud forwards MQTT messages to Kafka topics (Confluent) using the Kafka protocol, with a ready-to-use integration in the platform. HiveMQ Cloud’s Confluent/Kafka integration forwards MQTT messages to Kafka using the Kafka protocol, not MQTT.



How to install HiveMQ Edge in Revolution Pi?
Download the HiveMQ Edge package in Revolution Pi.
#move to opt directory
cd opt
#download the HiveMQ package
sudo curl -O https://www.hivemq.com/releases/edge/hivemq-edge-full-2025.13.zip
Install Java (if not installed)
sudo apt update
sudo apt install -y openjdk-17-jre-headless
Install unzip (if not pre-installed)
sudo apt update
sudo apt install unzip -y
Unzip the package
sudo unzip hivemq-edge-full-2025.13.zip
Create a HiveMQ symbolic link (symlink):
sudo ln -s /opt/hivemq-edge-full-2025.13 /opt/hivemq
Create a HiveMQ user:
sudo useradd -d /opt/hivemq hivemq
Make scripts executable and change the owner to the hivemq user:
sudo chown -R hivemq:hivemq /opt/hivemq-edge-2025.13
sudo chown -R hivemq:hivemq /opt/hivemq
cd /opt/hivemq
sudo chmod +x ./bin/run.sh
Install the init script (optional). For Debian-based Linux distributions such as Debian, Ubuntu, or Raspbian that use init.d scripts:
sudo cp /opt/hivemq/bin/init-script/hivemq-debian /etc/init.d/hivemq
sudo chmod +x /etc/init.d/hivemq
Start HiveMQ on boot (optional)
sudo systemctl enable hivemq
Start HiveMQ
cd /opt/hivemq
sudo ./bin/run.sh
Log in to HiveMQ Edge Web UI
Once you start a HiveMQ Edge instance, you can access the HiveMQ Edge administrative console in your Edge device browser at http://localhost:8080. The default username is "admin", and the default password is "hivemq". If you want to view the Web UI on your computer remotely, you can set up an SSH Tunnel. In your computer, run the following code in the terminal
ssh -L 8080:localhost:8080 [email protected]
Now you can access the HiveMQ Edge Web UI by opening localhost:8080. Log in usingthe default credentials, username: admin and password: hivemq

Abbreviations & Terms
OPC UA (Open Platform Communications – Unified Architecture) A machine-to-machine communication protocol for industrial automation. Used to read/write real-time data from PLCs, sensors, and devices.
MQTT (Message Queuing Telemetry Transport) A lightweight publish/subscribe messaging protocol, ideal for IoT devices and edge communication.
Edge Device A device placed close to machines (e.g., Revolution Pi) that collects and forwards data, often translating from one protocol to another.
HiveMQ HiveMQ is the proven MQTT IoT data streaming platform for secure, real-time data connectivity, enabling more intelligent decisions and digital transformation. Learn more here
HiveMQ Edge / HiveMQ Cloud
HiveMQ Edge: Runs locally (on Raspberry Pi / RevPi) to connect industrial protocols, such as OPC UA, to MQTT.
HiveMQ Cloud: Managed MQTT broker in the cloud, used for scalable IoT data exchange.
Kafka (Apache Kafka) It’s basically a high-performance message bus that can handle millions of messages per second. It’s used to publish, store, process, and subscribe to streams of events (such as sensor data, logs, and transactions).
Confluent A managed cloud service built on Apache Kafka, providing Kafka clusters plus enterprise features like security, monitoring, and connectors. So instead of running Kafka yourself (which can be complex), you can use Confluent’s hosted Kafka clusters.
♥️ Work With Me
I regularly test industrial automation and IIoT devices. If you’d like me to review your product or showcase it in my courses and YouTube channel:
📧 Email: [email protected] or drop me a message on LinkedIn
Last updated
Was this helpful?