# MQTT and OPC-UA Bridging

**URL:** <https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904>\
**Category:** Archived Topics\
**Created:** [April 13, 2015, 5:38pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904 "2015-04-13T17:38:46Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [April 13, 2015, 5:38pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/1 "2015-04-13T17:38:46Z")

</div>

Hi.

I began playing around with bridging various protocols. You can get the source code here: [https://bitbucket.org/fixitchris/fournine-iot-platform/wiki/Home](https://bitbucket.org/fixitchris/fournine-iot-platform/wiki/Home)

A demo video explaining the situation has been posted here: [https://youtu.be/SEe1MePg9uc](https://youtu.be/SEe1MePg9uc)

Thanks  
Chris

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 13, 2015, 5:47pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/2 "2015-04-13T17:47:15Z")

</div>

Don’t have access to the wiki for some reason, but I can browse the source.

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [April 13, 2015, 5:56pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/3 "2015-04-13T17:56:21Z")

</div>

Thanks. I changed the wiki to public.

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [April 14, 2015, 12:41pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/4 "2015-04-14T12:41:56Z")

</div>

Kevin, what are your guys’ ideas on the topic?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 14, 2015, 2:13pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/5 "2015-04-14T14:13:25Z")

</div>

I’ve seen a lot of interest in MQTT in the last couple months, from both individuals and companies.

I’ve played around with getting data from MQTT into Ignition via OPC-UA (so basically a server that knows how to subscribe to MQTT topics), and I may eventually bring that work into an Ignition module, but there are some difficulties around configuration and interpreting the opaque payloads you get from MQTT messages that I haven’t figured out how I want to handle.

What might end up being more useful to people is an OPC-UA client that can subscribe to existing OPC-UA data and publish it to MQTT topics. I don’t know who the consumer would be in this scenario though, but I imagine there’s gotta be a use case…

That last scenario (OPC-UA publishing to MQTT) is what you’re doing, right?

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [April 14, 2015, 9:46pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/6 "2015-04-14T21:46:21Z")

</div>

I am actually doing both. The bridge instance, creates both an MQTT and OPC-UA clients. When a new MQTT is received it is dispatched to the other clients (potentially CoAP, XMPP, etc) and the OPC-UA client handles converting the MQTT topic to an OPC-UA tag “path” and writes it. Also, when the OPC-UA client starts up, it subscribes to an OPC server channel and when data changes occur on the OPC side, it dispatches the data to MQTT.

The use case for receiving OPC-UA data over MQTT is the ability to easily create a native mobile application where an Ignition client might not be a fit. Interfacing with any of these might be necessary, something that Ignition cannot do at the moment: barcode/rfid sled, Bluetooth LE, GPS… As a side note, for mobile application development we use Xamarin.

What difficulties have you come across with configuration?

As for the opaque payloads… do you really care? If my OPC tag is of a string type then I would expect the MQTT client to be publishing a string. If it is a numeric tag then if the payload can not be cast to a numeric value then the implementation of the device speaking MQTT is flawed. Is that really any different than my control’s engineer telling me that the counter is on S000 when what he meant was N7:1?

PS. I have recently ordered the only OPC-UA book from Amazon to catch up on what I have missed over the past several decades.

/c

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 14, 2015, 11:08pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/7 "2015-04-14T23:08:57Z")

</div>

> [@cmisztur2](#):
>
> What difficulties have you come across with configuration?
> 
> As for the opaque payloads... do you really care? If my OPC tag is of a string type then I would expect the MQTT client to be publishing a string. If it is a numeric tag then if the payload can not be cast to a numeric value then the implementation of the device speaking MQTT is flawed. Is that really any different than my control's engineer telling me that the counter is on S000 when what he meant was N7:1?

It's not so much a technical issue as it is how to present this to the user in an intuitive way. Building a web UI with import and export. And the documentation that goes along with it. And breaking the expectation that their tags will just show up when they browse without having to configure it first. Etc...

You'd be surprised how much of support is just helping people configure things.

> [@cmisztur2](#):
>
> PS. I have recently ordered the only OPC-UA book from Amazon to catch up on what I have missed over the past several decades.

Good luck! OPC-UA is pretty dang complicated compared to OPC-DA. I don't know how much the book covers, but if you can become a member of the foundation and get the specifications it will make your life a bit easier.

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [April 15, 2015, 12:32am UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/8 "2015-04-15T00:32:16Z")

</div>

I understand.

Heh, dropping 2000$ on a spec is just crazy.

---

<div class="post-metadata">

**Author:** ![agsense](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@agsense](https://forum.inductiveautomation.com/u/agsense)\
**Post date:** [July 8, 2015, 11:34pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/9 "2015-07-08T23:34:07Z")

</div>

Please see:

[https://www.kickstarter.com/projects/1109584274/develop-an-mqtt-driver-for-the-ignition-gateway](https://www.kickstarter.com/projects/1109584274/develop-an-mqtt-driver-for-the-ignition-gateway)

Thank you

---

<div class="post-metadata">

**Author:** ![agsense](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@agsense](https://forum.inductiveautomation.com/u/agsense)\
**Post date:** [July 22, 2015, 9:09am UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/10 "2015-07-22T09:09:48Z")

</div>

For your review:

I rolled this recently and upload for review. It is new code and lacks Authentication. But it is simple and lightweight and easily extended. Supports bidirectional MQTT to OPCUA

[github.com/nzfarmer1/mqtt2opcua](https://github.com/nzfarmer1/mqtt2opcua)

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [November 15, 2015, 7:56pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/11 "2015-11-15T19:56:12Z")

</div>

Thanks for the work on this.

/c

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [March 6, 2016, 6:18am UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/12 "2016-03-06T06:18:40Z")

</div>

[quote=“cmisztur2”]Hi.

I began playing around with bridging various protocols. You can get the source code here: [https://bitbucket.org/fixitchris/fournine-iot-platform/wiki/Home](https://bitbucket.org/fixitchris/fournine-iot-platform/wiki/Home)

A demo video explaining the situation has been posted here: [https://youtu.be/SEe1MePg9uc](https://youtu.be/SEe1MePg9uc)

Thanks  
Chris[/quote]

I am working on a smart city project. Average nr of tags per RTU is around 100. I am proposing to deploy Ignition on cloud and VPN access for remote RTUs. I wonder, is it possible to collect data, control and manage 1000’s of remote “OPC UA server RTUs” with as many OPC UA clients or MQTT clients on Ignition?.

I have to demonstrate the proof of concept to the client. In other words, i must deploy atleast 1000 OPC UA simulation servers, connect them from Ignition and demonstrate the “Smart City Command Control Centre” concept to the client.

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [March 8, 2016, 4:43pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/13 "2016-03-08T16:43:42Z")

</div>

[quote=“R.Alamsha”][quote=“cmisztur2”]Hi.

I began playing around with bridging various protocols. You can get the source code here: [https://bitbucket.org/fixitchris/fournine-iot-platform/wiki/Home](https://bitbucket.org/fixitchris/fournine-iot-platform/wiki/Home)

A demo video explaining the situation has been posted here: [https://youtu.be/SEe1MePg9uc](https://youtu.be/SEe1MePg9uc)

Thanks  
Chris[/quote]

I am working on a smart city project. Average nr of tags per RTU is around 100. I am proposing to deploy Ignition on cloud and VPN access for remote RTUs. I wonder, is it possible to collect data, control and manage 1000’s of remote “OPC UA server RTUs” with as many OPC UA clients or MQTT clients on Ignition?.

## I have to demonstrate the proof of concept to the client. In other words, i must deploy atleast 1000 OPC UA simulation servers, connect them from Ignition and demonstrate the “Smart City Command Control Centre” concept to the client.[/quote]

Which is the best protocol for Ignition to communicate and manage 5000+ RTUs?. The RTUs are having Modbus TCP, OPC UA server and VPN connection. Please share your ideas. Thanks.

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [November 22, 2016, 9:23pm UTC](https://forum.inductiveautomation.com/t/mqtt-and-opc-ua-bridging/9904/14 "2016-11-22T21:23:48Z")

</div>

MQTT would be my choice for deployment in the field.
