OPC UA PubSub to Cloud via MQTT

In the demo, we use the Raspberry Pi 4 platform, where we have created an OPC UA PubSub solution that publishes JSON packaged data over MQTT protocol.

As hardware we chose the base Raspberry Pi 4 with the touchscreen addon. Using Prosys OPC UA SDK for Java, our team created a lightweight sample publisher that would serve as the basis for our demo. The demo is divided into two parts: a built-in event visualiser and the actual MQTT PubSub cloud connection.

Cloud Demo Image
Figure 1. The basic structure of the demo.

The event visualiser was configured into the demo to mimic a subscriber and show the JSON formatted data. Data contains sample values and simulated alarms and events generated by the publisher. This visualiser is additionally connected to a custom Web application that displays the sample data using MQTT-compatible JSON package form.

Raspberry Pi Screen
Figure 2. Screenshot of the Web APP showing sample data.

With the visualized PubSub connection ready, we configured an MQTT forwarder to publish the JSON sample data into the cloud. Using the MQTT protocol, we connect the PubSub demo to the SPS 2022 Marketing Broker. We also have a sample publisher running on a separate machine that sends data to the cloud connectivity wall of the OPC Foundation.

For the final version of the demo, everything is configured to run automatically on the Raspberry Pi 4 upon startup. The process begins by starting the sample publisher and opening the chromium-browser in the kiosk to autorun the visualiser application. Lastly, we connect the Mosquitto MQTT broker to the publisher and start sending the data to the cloud.

In addition to the PubSub MQTT cloud connection created with Prosys OPC UA SDK for Java, our free software Prosys OPC UA Simulation Server and Prosys OPC UA Browser are compatible with the 64-bit Raspberry Pi OS for future solutions. Both applications have built-in PubSub capabilities. You can read about them on our blog.

If you’re interested in the demo, our PubSub capabilities, or would like to ask any other questions, send an email to sales@prosysopc.com.

Abbreviations

  • JSON = Java Script Object Notation
  • MQTT = Message Queuing Telemetry Transport
  • OPC UA = OPC Unified Architecture
  • PubSub = Publisher/Subscriber model
  • SDK = Software Development Kit

Tools Used

  • Prosys OPC UA SDK for Java: Development kit for OPC UA
  • Mosquitto: Open-source MQTT broker
  • Spring: Open-source backend for the Web Application
  • Vaadin: Open-source frontend for the Web Application
Headshot of Henri Toivola

Henri Toivola

Sales Engineer, Prosys OPC

Email: henri.toivola@prosysopc.com

Related Posts

Develop OPC UA Applications on Android with Prosys SDK

Develop OPC UA applications on Android with the Prosys OPC UA SDK for Java. This updated guide shows how to get started with Android SDK API 35, including a simple client example. Please note that testing on Android is limited, so full interoperability with all OPC UA systems cannot be guaranteed.

Read More »

Valio – Connecting Dairy Plant Automation with IT Using Prosys OPC UA Forge

At Valio, product quality and traceability requirements are at a very high level, highlighting the importance of smooth and reliable communication between different production systems. To meet these requirements, Prosys OPC developed the OPC UA standard based software Valio uses for integrating all their automation and manufacturing execution systems.

Read More »

Master’s Thesis Recap: OPC UA Role-Based Access Control in Industrial Automation

This master’s thesis recap examines how OPC UA Role-Based Access Control (RBAC) can be implemented in industrial automation. It compares directory integration with local role mappings, outlines their benefits and challenges, and presents findings from a simulated case study. The results highlight practical considerations for strengthening OT network security with OPC UA.

Read More »

Interested in this topic?

Get updated about new posts through our newsletter!