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 .

 

Architecture

 

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.

 

 

 

  Step by step configuration

Raspberry PI Configuration

    1. Download the OPC UA test server from http://www.openopcua.org/download/download.html
    2. Install OPEN SSL
      • sudo apt-get install openssl
    3. Uncompress the OPC UA Server
    4. 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.

    1. 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 
    2. Configured it in order to access to the OPC UA server and get data from it:
      1. Open the UA Expert client
      2. Click on the "+" button
      3. 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

              

4. Click on the connect server button

5. You should get the following logs if the connection is correct

PI Connector for OPC UA Installation and Configuration

      1. Installation following the manual which can be downloaded from this link  https://techsupport.osisoft.com/Downloads/File/db8fe359-3809-43e2-9f3c-aadb1f750b78
      2. 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"
      3. In order to configure the data source you need to click on Overview and then in "Add or modify data sources".
        1. 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]
        2. Clicked on "Export available Type Definitions"
        3. Open the AvailableTypeDefinition.csv file in order to check the imported data.
        4. In my case I could see some template name showing "***MissingName***". I changed for a miningful name so it could be loaded afterwards.
        5. Upload the AvailableTypeDefinition.csv and then click save.
        6. You might need to restart the PI Connector Service after this changes.
      4. Afterwards you can add the PI Data Archive and the AF Server in order to start creating you AF Databases and PI Points.
      5. The overview should look like this after all the configuration.

Result

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.