# Multi-Site PLC-to-Cloud Flow using HiveMQ Edge + Cloud

In this guide, we’ll see how **HiveMQ Edge** and **HiveMQ Cloud** can be used together to bridge data from Siemens and Allen-Bradley PLCs — using **OPC UA**, **Modbus TCP**, and **MQTT**.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2F7sqPgX9ygJtGSuymuBBv%2FPost%202.mp4?alt=media&token=caa21492-c932-446a-9466-dfbcca7822c6>" %}

## System Overview

This setup demonstrates a **multi-site architecture**:

* **Site A**: Process running with Siemens S7-1500 PLC&#x20;
* **Site B**: Process running with Allen-Bradley Micro850 PLC
* Both sites send local PLC data to **HiveMQ Edge**
  * **Site A**: Siemens S7-1500 PLC via OPC UA
  * **Site B**: Allen-Bradley Micro850 PLC via Modbus TCP
* A secure **MQTT Bridge on HiveMQ Edge** transfers data from the Edge devices to the **HiveMQ Cloud**

### Step 1 – Connect PLCs to HiveMQ Edge and assign a local MQTT Topic

<div data-full-width="true"><figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2FIuQVl6EpKZgDc16Ppq16%2Fimage.png?alt=media&#x26;token=fc1b2152-9788-4155-95c7-e3c4a70e6e41" alt=""><figcaption><p>LIVE data in the S7-1500 PLC</p></figcaption></figure></div>

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2F2fnzBQ9ZZUuGcTan8XFw%2F9.png?alt=media&#x26;token=3fec986c-11ae-488b-8630-6e5c2640de9b" alt=""><figcaption><p>LIVE data in the Micro850 PLC</p></figcaption></figure>

#### a) Siemens S7-1500 (OPC UA)

Install HiveMQ in the edge device. In this case, we are using Revolution Pi as an edge device where HiveMQ Edge has been installed.

{% hint style="success" %}
To learn more about how to install HiveMQ Edge on the edge device, check out this [page](https://wiki.codeandcompile.com/product-reviews/smart-platforms/hivemq/plc-to-cloud-via-hivemq-edge-+-cloud-opc-ua-mqtt-confluent).
{% endhint %}

**Navigate to the HiveMQ Edge → Protocol Adapters**, add a new **OPC UA Protocol Adapter**.\
Configure the connection details of your S7-1500 using the OPC UA endpoint, and select the OPC UA tag.

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2FobytQm7EwCDrwz6BHnxa%2F2.png?alt=media&#x26;token=18b2e3f7-06c0-4138-b594-154d13006911" alt=""><figcaption></figcaption></figure>

Then create a **northbound mapping** to publish it as:

```
Topic: machine/s71500/rTemp
```

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2Fc0JMufA6zoMyBnV49SLn%2F3.png?alt=media&#x26;token=780eb365-7cc1-40be-94f3-f7238bc2ae60" alt=""><figcaption></figcaption></figure>

This allows HiveMQ Edge to read OPC UA values and push them to the local MQTT broker.

#### b) Allen-Bradley Micro850 (Modbus TCP/IP)

Similarly, install HiveMQ in another edge device. In this case, we are using a reComputer from Seeed Studio as an edge device where HiveMQ Edge has been installed.

{% hint style="success" %}
To learn more about how to install HiveMQ Edge on the edge device, check out this [page](https://wiki.codeandcompile.com/product-reviews/smart-platforms/hivemq/plc-to-cloud-via-hivemq-edge-+-cloud-opc-ua-mqtt-confluent).
{% endhint %}

Add a **Modbus Protocol Adapter** and connect to the Micro850 PLC via MODBUS TCP/IP.

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2FifwVPHBmwSdxHQA6IOzP%2F6.png?alt=media&#x26;token=6ae2aff4-d64c-4629-9812-59c31ec694a0" alt=""><figcaption></figcaption></figure>

Select the tag `Current_Temp` and map it to the following topic:

```
Topic: machine/micro850/rTemp
```

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2FSpMuBuZzmXb2L91xyV5n%2F7.png?alt=media&#x26;token=00182829-e944-4dbc-8348-ecd42cefb6c5" alt=""><figcaption></figcaption></figure>

Each tag update will now be converted to MQTT messages locally.

### Step 2 – Creating the MQTT Bridge

In both **HiveMQ Edge → MQTT Bridges**, create a bridge to your **HiveMQ Cloud Cluster**.\
Once connected, data from both sites is securely forwarded to the cloud broker.

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2FnVC2NUqqQN6rB7V69a8d%2F4.png?alt=media&#x26;token=ede7ff94-f2de-4d91-920a-36aa9b403055" alt=""><figcaption><p>MQTT bridge in Revolution Pi</p></figcaption></figure>

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2FgZ8wpb1fPHoIvwmzEKyl%2F8.png?alt=media&#x26;token=42b990e7-98ef-4b9d-bd58-40e795aee30f" alt=""><figcaption><p>MQTT bridge in reComputer</p></figcaption></figure>

### Step 4 – Visualizing Data on HiveMQ Cloud

Log in to your **HiveMQ Cloud Web Client**, subscribe to your topic (e.g., `#`), and you’ll start receiving live messages as shown below:

<figure><img src="https://1831238825-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLd2M9UNfMTnw9DjDdZJz%2Fuploads%2FbTtuv3BkdbEgik9rUfSG%2F10.png?alt=media&#x26;token=c21ac597-4f15-4035-9339-d7f369d3e1f6" alt=""><figcaption></figcaption></figure>

You can now view, analyze, and integrate these values into dashboards or data platforms.

***

### 🧠 Step 5 – Understanding the Data Flow

From each PLC:

* Data is read using **OPC UA** or **Modbus TCP**
* HiveMQ Edge maps the tags to MQTT topics
* The **MQTT Bridge** sends this data securely to **HiveMQ Cloud**

✅ Supports multiple sites\
✅ Secure TLS connection\
✅ Cloud-ready and scalable

### 🧩 Why HiveMQ Cloud?

* 🔒 Secure MQTT Bridge
* 🌐 Multi-site scalability
* ☁️ Cloud-ready architecture
* 💡 Perfect bridge between OT and IT

## ♥️ 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: <rajvir@codeandcompile.com> or drop me a message on [LinkedIn](https://www.linkedin.com/in/singhrajvir/)
