The idea of the project is to create a connectivity solution to combine the advantages of OPC UA and distributed ledger technology like IOTA Streams The opcua-to-tangle project consists of three components.
- The I2TH OPC UA Sensors Server is just an example server that reveals some OPC UA nodes we can connect to. In theory, any OPC UA server can be used.
- The I2TH OPC UA Streams Gateway connects e.g. to the OPC UA Sensors Server, fetch the sensor data and publish them to the tangle. The channel address is also provided via OPC UA.
- The I2TH OPC UA Streams Subscriber connects to the Tangle, obtains the latest data, and makes it available via OPC UA.
Further information can be found in the Wiki.
The project are based on the OPC UA implementation from locka99 and contains samples from the IOT2TANGLE repositories.
The code is licenced under Apache-2.0.
The code is build and tested under Windows with the Windows Subsytem for Linux (WSL2) Environment. The Repository contains a devcontainer which is the simplest way to build the project. It contains all dependecies, you only need the following tools installed and configured.
- Docker
- Visual Studio Code
- ms-vscode-remote.vscode-remote-extensionpack
For simplicity, the instructions are only for running the components on the local PC btw. in the docker environment. Look at the wiki for cross-compiling and execution on a Raspberry PI. Run the servers in the right order to follow the sample.
-
Open the workspace with vscode and than reopen the folder in the devcontainer.
-
Open a terminal and run the OPC UA Sensors Server.
cd opcua-sensors-server && cargo run --release
-
Open an other terminal and run the OPC UA Streams Gateway.
# Add the OPC UA Server url you want to connect e.g. "opc.tcp://localhost:4855" cd opcua-streams-gateway && cargo run -- <url>
-
Open another terminal and run the OPC UA Streams Subscriber.
# Add the channel published by the OPC UA Streams Gateway cd opcua-streams-subscriber && cargo run --release -- <channel>
-
Now you can connect to the servers with an OPC UA Client, trust the certificates and discover the nodes. I usually use the UaExpert, which is free to use but require an registration. The server have the following endpoints:
- I2TH OPC UA Sensors Server: opc.tcp://localhost:4855
- I2TH OPC UA Streams Gateway: opc.tcp://localhost:4860
- I2TH OPC UA Streams Subscriber: opc.tcp://localhost:4870
- Separating the examples and libraries.
- Creating crates from the libraries.
- Creating the docs for the libraries.
- Adding CI / CD workflow.
- Using keepy.
- Implementing the channel exchange between gateway and subscriber via OPC UA.
- Implementing the OPC UA Pub / Sub Model for the opcua-streams-gateway.
- Creating a standardized OPC UA Information Model for IOT2Tangle and all used types.
- Add the Historical Access functionality.