Building OPC UA IIoT Applications with MQTT for Bandwidth Constrained Applications

Building OPC UA IIoT Applications with MQTT for Bandwidth Constrained Applications
Building OPC UA IIoT Applications with MQTT for Bandwidth Constrained Applications

Low-cost sensors and Industrial Internet of Things (IIoT) technology is making possible monitoring and control of more systems over many transport methods, including bandwidth-constrained wired, wireless and cloud connections over common carriers. OPC UA messaging over MQTT (Message Queuing Telemetry Transport) protocol provides a lightweight solution for those applications where network bandwidth is limited.  This combination delivers both the strengths of OPC UA data models—dramatically reduced application engineering labor and improved reliability—and the benefits of MQTT communications efficiency over constrained networks. 

More importantly, OPC UA and MQTT are both open-source technologies representative of the industrial automation architectural shift toward greater flexibility and interoperability of systems. During OPC Day 2021 – International, a conference held virtually by the OPC Foundation June 8-10, attendees learned how they could apply these technologies and others.


MQTT

MQTT is a lightweight publish/subscribe messaging protocol designed for low-bandwidth, high latency, unreliable networks residing on top of the TCP/IP network stack. MQTT was created in 1999 by two engineers Andy Stanford-Clark (IBM) and Arlen Nipper (Eurotech) who invented the protocol for connecting oil pipelines over unreliable, satellite networks. In 2011, IBM and Eurotech donated MQTT to the proposed Eclipse project called Paho. In 2013, it was submitted to OASIS for standardization. MQTTv5 was released last year.


OPC UA

OPC UA is a framework for industrial interoperability based on data models that provide a syntactical definition of information that can be communicated with virtually any communication methods, including modern industrial protocols, Ethernet, cellular and wireless. Device and machine manufacturers describe the object-oriented information of their system and define the access rights with integrated information technology (IT) security. OPC UA is an open framework IEC62541 standard delivering end-to-end secured, information exchange with open specifications, open source code (GitHub) and open certification labs (without being a paying member). The more than 63 OPC Foundation member organizations have and continue to define standardized use case information models (i.e. pumps, motors, robots, etc.) to dramatically lower application engineering labor and increase quality.


Cloud library

Democratizing engineering data, CESMII– the Smart Manufacturing Institute has standardized on OPC UA Information Models as a component of its Smart Manufacturing Innovation Platform and Profiles (CESMII Information Models) with the Cloud Library initiative. The objective is achieving frictionless flow of data models and the associated information for manufacturing and process users including application engineers, manufacturing and process operations, and business management. 

CESMII will leverage the Cloud Library and extend those information models with greater context, sharing those Profiles, along with a directory of industry applications that support them, on the CESMII Smart Manufacturing (SM) Marketplace. It is worth noting that Germany’s Plattform Industrie 4.0 and CESMII have a partnership to address similar challenges for manufactures to compete. This includes international collaboration to achieve major tasks including semantic interoperability, create data sharing platforms, develop workforce skills, and foster sustainable production.


OPC UA IIoT starter kit

During OPC Day 2021, the OPC UA IIoT Starter Kit was announced. It provides samples and tutorials to develop applications using OPC UA PubSub and MQTT. OPC UA PubSub is an extension to OPC UA that enables communication between OPC UA applications using a Publish-Subscribe message pattern instead of the Request-Response message pattern. The Publish-Subscribe message pattern decouples senders of messages from their receivers, which allows for the development if systems based on middleware such as an MQTT broker. The difference between the two patterns is illustrated in the photo above this article.

UA PubSub is an extension to OPC UA that enables seamless integration of MQTT into OPC UA system. It is NOT a replacement. It is a generic PubSub mechanism designed to work over any message-based middleware. UA PubSub over MQTT is a mapping that incorporates MQTT features in UA PubSub.

OPC UA PubSub provides a complete solution that includes:

  • Support for multiple protocols.

  • Support binary and JSON encodings.

  • End to end security.

  • Standard configuration information model and file format.

  • Integration with OPC UA information models.

The OPC UA IIoT Starter Kit and documentation is available on GitHub The StarterKit contains software designed to run on a Raspberry Pi or other Linux device with GPIO ports. It will also run on a Linux or Windows machine without GPIO ports in simulation mode.

This version of StarterKit uses .NET 5.0. An MQTT broker is required. Eclipse Mosquitto is used in the StarterKit documentation. The recommended development tool to build for the Raspberry Pi is Visual Studio Code. The recommended development tool to build for Windows platforms is Visual Studio 2019. A MQTT monitoring application, such as MQTT Spy, is also helpful.

The OPC UA IIoT Starter Kit available on GitHub includes software to run on a Raspberry Pi or other Linux device with GPIO ports.

About The Author


Bill Lydon brings more than 10 years of writing and editing expertise to Automation.com, plus more than 25 years of experience designing and applying technology in the automation and controls industry. Lydon started his career as a designer of computer-based machine tool controls; in other positions, he applied programmable logic controllers (PLCs) and process control technology. Working at a large company, Lydon served a two-year stint as part of a five-person task group, that designed a new generation building automation system including controllers, networking, and supervisory & control software. He also designed software for chiller and boiler plant optimization. Bill was product manager for a multimillion-dollar controls and automation product line and later cofounder and president of an industrial control software company.


Did you enjoy this great article?

Check out our free e-newsletters to read more great articles..

Subscribe