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?
- One 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
3 steps to setup OPC UA client server demo
- Step 1: Install the dependency packages
- Step 2: Run OPC UA server application
- Step 3: Run OPC UA client application
In this article, we run both server and client application in the same Raspberry Pi board.
- OPCUA server application:
<open62541-stack-dir>/examples/tutorial_server_firststepsor any other example server application
- OCPUA client application:
- Free-OPCUA client
Step 1: Install dependency package:
sudo apt-get install git cmake cmake-curses-gui build-essential gcc python3-pip qttools5-dev python3-pyqt5 libmbedtls-dev check libsubunit-dev python-sphinx graphviz python-sphinx-rtd-theme
sudo pip3 install opcua-client
Step 2: Run OPC UA server application:
git clone https://github.com/open62541/open62541.git
- Enable UA_BUILD_EXAMPLES, configure(c) and then generate (g)
./tutorial_server_firststeps( Note: Any example server application can be used)
- Your server is now running and will be listening in the port 4840
Step 3: Run OPC UA client application:
- After installing all the dependency package, open the terminal and execute the following command
- 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.
- Voila! you have now established OPC UA Client/Server communication in just 3 major steps
- 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