Running OPCUA 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 as an OPC server and client nodes

What hardware do I need?
  • 1 Raspberry Pi3 board
What software do I need?
  • Kindly install Raspbian Buster OS as the python version required for free-opcua-client is 3.6.0 or higher
  • Follow the instruction from the link to install Raspbian OS in Raspberry Pi and get started to run open62541
Install the dependency packages:
  • General packages:
    • sudo apt-get install git
    • sudo apt-get dist-upgrade(Shall be used when there are any missing packages)
  • Cmake packages:
    • sudo apt-get install cmake cmake-curses-gui
  • opcua-client packages:
    • sudo apt-get install build-essential gcc python3-pip qttools5-dev python3-pyqt5
    • sudo pip3 install opcua-client
  • Additional Packages:
    • 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 https://github.com/open62541/open62541.git
  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:
  • After installing all the dependency package, open the terminal and execute the following command
    • opcua-client
  • Click on connect in the opcua-client application
  • Now you can see the sever details listed in the client application as provided in the screen shot
  • Cycle time measurement
  • The highlighted server information listed on the client application ensures that the OPCUA client and server are communicating with each other
  • Note:Information about the server will not be displayed if the client/server communication is not established