Opcua - OPC-UA protocol stack in pure Erlang

OPC-UA stack in pure Erlang: GitHub - stritzinger/opcua: Native Erlang implementation of OPCUA (Hex opcua | Hex ), Apache 2.0 License

After developing on and off for several years on it now I’m happy to announce our pure Erlang OPC-UA stack. OPC-UA is the interoperability standard for the secure and reliable exchange of data in the industrial automation space and in other industries. It combines a efficient transport neutral binary protocol with a rich system of data types and meta data description giving meaning to the raw bits. It has a nice security architecture with message end to end encryption not relying on data link security.

This is the first release which could have some use for others also its still a bit rough around the edges. It includes client and server. We are working on the newer pub-sub addition but thats still on a separate branch. Transports are TCP binary protocol for client-server, UDP and MQTT for pub-sub.

We continue to develop this offering and would be interested in feedback on how we should improve the stack.

17 Likes

Would be interesting to hear a few words as to when and why one would choose OPCUA over gRPC or Cap’n Proto, for example. Genuine question, not trying to be smart.

1 Like

The primary reason to use this stack is that you have some equipment that talks OPC-UA.

The longer answer:

OPC-UA is a ISO standardized protocol with wide and still growing support in industry. The type graph of the exposed data is browsable in the server and it can tell you what values are available and that this integer you get in the payload is a temperature in Celsius and its range is -20 … 100 etc. etc, so you have physical values described as such and enough meta-data to immediately visualize it. There are OPC-UA browser apps that let you browse any server and look at the data.

Based on that the OPC Foundation is creating a lot of also standardized profiles where e.g. a printing machine is described. So one can write generic code dealing with printing machines.

Then there is the end to end message encryption and key handling which doesn’t rely on transport level security (which would be problematic since usually the data is forwarded over multiple hops often practice).

OPC-UA Pub-Sub works via UDP on a LAN which then can be used with Ethernet TSN (Time Sensitive Network) to provide Hard Realtime communication over Ethernet. OPC-UA + Ethernet TSN is thought to be the field-bus to rule them all (there has been a Zoo of protocols in this space so far).

While its past has been a bit weird (OPC used to mean OLE for Process Control, which was a very Microsoft centric protocol with transport tied to COM/DCOM) when it was opened up as UPC-UA (UA = Universal Access) a lot was learnt by the initial mistakes and the good bits were kept. Resulting in a altogether good and robust protocol, its quite complex however. This comes from the real-world being a complex place mainly.

Here are a few links for further reading:

5 Likes

Congratulations on releasing this, @peerst, really cool to see.
Looking forward to the PubSub addition, let me know when there’s anything to help regarding MQTT.

1 Like