Since I started using the Raspberry PI and the PI System I was looking to install an OPC Server and an out of the box solution in order to connect it with PI.
Now with the PI Connector for OPC UA it is possible, plus it is a very good way to have a taste of how the PI Connectors work.
Thank you Martin Lehmann for the help .
I am using a PI Connector for OPC UA in order to send data from the Raspberry PI to the PI System. I have installed a OPC UA Server in the Raspberry PI with some test tags. I have installed the PI Connector for OPC UA in a PI Connector node which will sending the data to the PI System that is installed in a unique node.
- Data Source: The data source is an OPC UA Server installed in the Raspberry PI:
- PI Connector node
- PI Connector for OPC UA 18.104.22.168 ( PI Connector for OPC UA - Interface Details )
- PI Data Archive + AF Server node: Virtual machine with PI Data Archive 2016 R2 64 bits and AF Server 2016 R2.
Step by step configuration
Raspberry PI Configuration
- Download the OPC UA test server from http://www.openopcua.org/download/download.html
- Install OPEN SSL
sudo apt-get install openssl
- Uncompress the OPC UA Server
- Execute in terminal "StartOpenOpcUaCoreServer.sh" ( keep in mind that you need the correct permissions to execute it)
4. In terminal you will see the information from your OPC UA Server and how to connect to it. In my case opc.tcp://localhost:16664/RaspBerryUAServer. In order to connect to it remotely you would need to use your IP address. If you do not want to have a new IP in every restart you could use and static IP.
5. Check that the port of your OPC Server is actually open and the software is listening. You could run the following command to double check this fact.
- Sudo netstat -lptn
PI Connector Node configuration
Test Connection with a client.
- Installed a Free OPC UA Client in order to gather data and check the connection with the OPC UA Server. OPC UA Clients - Unified Automation
- Configured it in order to access to the OPC UA server and get data from it:
- Open the UA Expert client
- Click on the "+" button
- Clicked on the "Advanced" tab called the Configuration Name: RaspberryUA and added the Endpoint url: opc.tcp://10.128.1.35:16664/RaspBerryUAServer and left the rest of the boxes by default
5. You should get the following logs if the connection is correct
PI Connector for OPC UA Installation and Configuration
- Installation following the manual which can be downloaded from this link https://techsupport.osisoft.com/Downloads/File/db8fe359-3809-43e2-9f3c-aadb1f750b78
- Once installed go to the configuration URL. During the installation of the PI Connector there would be a direct access created to the Website called "PI Connector for OPC UA Administrator"
- In order to configure the data source you need to click on Overview and then in "Add or modify data sources".
- I added the following URL in the "Discovery or Server Endpoint URL" in order to avoid certificate issues. opc.tcp://10.128.1.35:16664/RaspBerryUAServer [None:None:Binary]
- Clicked on "Export available Type Definitions"
- Open the AvailableTypeDefinition.csv file in order to check the imported data.
- In my case I could see some template name showing "***MissingName***". I changed for a miningful name so it could be loaded afterwards.
- Upload the AvailableTypeDefinition.csv and then click save.
- You might need to restart the PI Connector Service after this changes.
- Afterwards you can add the PI Data Archive and the AF Server in order to start creating you AF Databases and PI Points.
- The overview should look like this after all the configuration.
You will have the data exported from your OPC UA Server. The PI Connector will create an architecture with Elements and Attributes in order to contextualize that data in the AF Server and also the PI Tags to save the data in the PI Data Archive.
I will be trying to find an OPC Server that allows me to insert real time data from the GPIOs of the Rapsberry PI.