Solar Panel Monitoring: OPC UA Ingestion

Chait Diwadkar
Chait Diwadkar
/
Share on LinkedIn

MQTT is a data protocol commonly used for communication in modern IIoT environments, including many renewable energy sites. Devices can send the data they collect to an MQTT broker, potentially via an IoT gateway, so that it can be used in higher-level applications and algorithms. TDengine, being a time-series database designed for the IIoT, includes a built-in MQTT connector that can be configured without writing a single line of code, making it easier than ever to transfer your operations data into persistent storage and share it with your business and analytics apps and teams.

In this blog we will connect to an OPC-UA data source using the TDengine Cloud built-in OPC-UA connector and set up monitoring for solar panels. We will set up the configuration of the OPC-UA data source using a CSV file and we will also create a supertable and configure it in the CSV file.

Video Tutorial

OPC UA Package

We will use an OPC-UA simulator from Prosys to simulate data from solar panels. The simulator is free and can be downloaded by requesting a download on the Prosys website.

The simulator has been set up as follows:

This data is written for each panel and, as one can see, it also contains the attributes for the “site” and the “string” as well as an identifier called “panelid”.

The simulator writes data for 1 solar farm but you can set it up to write data from multiple solar farms.

You can follow along in the video below if you haven’t used this simulator before. Note that, in the video below, which is only for illustration, I do not set it up exactly as it is set up for the demo as shown in Fig 1 above.

Note that because of the limitations of the simulator, this simulator will keep writing data even after sunset.

Create an OPC-UA Datasource

To follow along, it is easiest to use a Starter account on TDengine Cloud. If you do not already have an account, you can create one easily. No credit card is required and the instance is active for a month.

Once you have logged into your account, navigate to the Data In link.

Then click on “Add Data Source”

Name and Type

Enter a name for the data source and also choose OPC-UA for the type of data source.

TDengine Agent

Note that if the data source that you are about to configure is behind a firewall, then an agent needs to be created first. An agent is a very lightweight piece of software that runs on a machine that has access to the data source. The agent then establishes a connection to the data source and also establishes an SSL connection to the TDengine Cloud instance.

The process of installing the agent is extremely simple. When you click on “Create New Agent”, a wizard will guide you through the process of downloading the agent software and configuring the agent.

You can see a video that shows you how to do this below:

Database Creation

Now we will need to create a target database where the data will be stored. If a database already exists, you can choose an existing database.

Click on “Create Database”. For more information about database configuration parameters see “Create a Database.”

Enter a name for the database and then change the “CACHEMODEL” to “both”.

OPC-UA Broker Configuration

Enter the URL for the OPC-UA broker. In our case it is the following, as you can see in Fig 6 below.

In this example we will not be setting up security or authentication, but in a production environment one must definitely set up both.

After setting it up, click on Check Connection to make sure the agent is able to connect to the broker and there is a seamless connection between TDengine, the agent and the OPC-UA broker.

Data Sets

To set up the data sets, please see the video below.

A key thing to note about the way that TDengine handles OPC-UA is that it uses a “single-column model”. That is, it sets up a supertable depending on data type and there is a sub-table for each device and measurement combination.

In our example, all of the measurements happen to be floating point measurements and so we set up only one supertable. If you look at the sub-tables, then you will notice that there is a subtable for panel 0 in string 0 for current, and another one for panel 0 in string 0 for voltage and so on.

See Data in Explorer

We can now click on the “Explorer” icon to see the database and whether it is ingesting data from the OPC-UA data source.

Take a look at the individual tables to see what is meant by the “single column model” that we described above.

Click on the icon to “View Table Config” as shown in Fig 8.

In the figures below we show you the individual sub-tables that store data for the ambient temperature and the wind speed for panel 0 in string 0.

TDengine makes it very convenient to configure an OPC-UA data source and start ingesting data from it. Once data is ingested, you can start analyzing the data using various tools or just SQL. You can also visualize the data in real-time using visualization tools like Grafana.

  • Chait Diwadkar
    Chait Diwadkar

    Chait Diwadkar is Director of Solution Engineering at TDengine. Prior to joining TDengine he was in the biotechnology industry in technical marketing, professional services, and product management roles and supported customers in pharma, medical devices and diagnostics on analytical chemistry, and genetic platforms.