OPC UA Open62541

From UpWiki
Jump to: navigation, search

Introduction

This is a simplified tutorial to evaluate OPC UA (OPC Unified Architecture) based on the open-source implementation open62541 to take advantage of the TSN functionality available on our UP series with Intel i210 network interfaces:

It can be used as a starting point to learn/evaluate OPC UA including TSN technology and it is based on the tutorial created by Kalycito, with additionally pre-patched and configured kernel source and configuration files for our platforms.

System Setup (2 systems)

You would need to setup 2 systems and configure one as Master (Node1) and one as Slave (Node2).

On both systems install Ubuntu 18.04 from USB stick

Real Time Kernel (2 systems)

On both systems download 4.19 Kernel with RealTime patches and updated .config to address the OPCUA TSN software requirements From a terminal window, extract the kernel and move into the kernel source directory, e.g.:

tar xzf linux-4.19.37_toCompile.tar.gz
cd linux-4.19.37

Add the necessary dependencies to build the kernel:

sudo apt-get install libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf build-essential git

Remove all the other kernels:

sudo apt-get autoremove --purge 'linux-.*generic'


Compile and install the new kernel:

make -j4
sudo make modules_install -j4
sudo make install -j4

Reboot

sudo reboot

Verify to be running the new Kernel:

uname -a

Software dependencies and Setup (2 systems)

On both systems download the setup scripts from Github

git clone https://github.com/AAEONAEU-SW/opc-ua_open62541_setup.git
cd opc-ua_open62541_setup
chmod +x *.sh

Master Setup (Node1)

From the opc-ua_open62541_setup and run the master first setup script

./opcua_setup_01_master.sh

Wait for the system to complete and reboot (it will take a while)

From the opc-ua_open62541_setup and run the master second setup script

./opcua_setup_02_master.sh


Slave Setup (Node2)

From the opc-ua_open62541_setup and run the slave first setup script

./opcua_setup_01_slave.sh

Wait for the system to complete and reboot (it will take a while)

From the opc-ua_open62541_setup and run the slave second setup script

./opcua_setup_02_slave.sh


Run the OPC-UA demo application

Boot both Systems (master and slave) connecting directly the 2 with an ethernet cable (port 2 under the DP port for UP Core Plus with Net Plus)

For the Slave system (Node2) go to the open65421/build folder and execute the following command to run the PubSub loopback application

sudo ./bin/pubsub_TSN_loopback enp2s0

For the Master system (Node1) go to the open65421/build folder and execute the following command to run the PubSub publisher application

sudo ./bin/pubsub_TSN_publisher enp2s0