Running OPC UA server on Raspberry Pi


This article explains to run OPC UA client server on Raspberry Pi3 and view the server information model in the client application. Raspberry Pi acts as an OPC server and client nodes

What hardware do I need?
  1. One Raspberry Pi3 board
What software do I need?
  1. Kindly install Raspbian Buster OS as the python version required for free-opcua-client is 3.6.0 or higher
  2. Follow the instruction from the link to install Raspbian OS in Raspberry Pi and get started to run open62541
Install the dependency packages:
  1. General packages:
    1. sudo apt-get install git
    2. sudo apt-get dist-upgrade(Shall be used when there are any missing packages)
  2. Cmake packages:
    1. sudo apt-get install cmake cmake-curses-gui
  3. opcua-client packages:
    1. sudo apt-get install build-essential gcc python3-pip qttools5-dev python3-pyqt5
    2. sudo pip3 install opcua-client
  4. Additional Packages:
    1. sudo apt-get install libmbedtls-dev check libsubunit-dev python-sphinx graphviz python-sphinx-rtd-theme
OPCUA Client/Server:

In this section, we run both server and client application in the same Raspberry Pi board.

OPCUA server application:
<open62541-stack-dir>/examples/tutorial_server_firststeps or any other example server application
OCPUA client application:
Free-OPCUA client
Run open62541 server application:
  1. git clone
  2. cd open62541
  3. mkdir build
  4. cd build
  5. cmake ..
  6. ccmake ..
  7. Enable UA_BUILD_EXAMPLES, configure(c) and then generate (g)
  8. make
  9. cd bin/examples
  10. ./tutorial_server_firststeps ( Note: Any example server application can be used)
  11. Your server is now running and will be listening in the port 4840
Run client application:
  1. After installing all the dependency package, open the terminal and execute the following command
    • opcua-client
  2. Click on connect in the opcua-client application
  3. Now you can see the sever details listed in the client application as provided in the screen shot. Cliet Server Communication
  4. The highlighted server information listed on the client application ensures that the OPCUA client and server are communicating with each other
  5. Note: Information about the server will not be displayed if the client/server communication is not established