AWS IoT SiteWise is currently in preview. While in preview, there are no charges for using AWS IoT SiteWise and the service is subject to change.

About AWS IoT SiteWise

AWS IoT SiteWise is a fully managed AWS IoT service that you can use to collect, organize, and analyze data from industrial equipment at scale. AWS IoT SiteWise enables you to collect data on the plant floor from sensors, equipment, or a local on-premises gateway and upload to AWS cloud using a gateway software (AWS IoT SiteWise Connector). AWS IoT SiteWise Connector runs on common industrial gateway devices running AWS IoT Greengrass, and reads data directly from servers and historians over the OPC-UA protocol. You can then structure and organize data using a rich asset-modeling framework to create virtual representations of equipment and processes. The data ingested and modeled in AWS IoT SiteWise is stored in a scalable and time-optimized internal data store. Once data is stored in AWS IoT SiteWise, you can stream live data in near real-time and query historical data to build downstream IoT applications. With the recently announced SiteWise Monitor capability of AWS IoT SiteWise, you can explore your library of assets, and create and share operational dashboards with plant operators for real-time monitoring and visualization of equipment health and output. To learn more about what’s new with AWS IoT SiteWise, visit to What’s new.

Solution Architecture

The following diagram illustrates the high-level end-to-end solution described in this multi-part post along with the AWS services used in the solution.

Prerequisites

This example uses the US West (Oregon) Region. However, you can choose another AWS Region of your choice where AWS IoT SiteWise (in preview), AWS IoT Analytics, and AWS IoT Events services are available. Visit the AWS Region table for a full list of AWS Regions where AWS services are available.

You have an AWS account in the same AWS Region.

You have the AdministratorAccess policy granted to your AWS account (for production, we recommend restricting access as needed).

You have AWS CLI installed and configured to use with your AWS account.

This example uses simulated Wind Turbine data using KEPServerEX from Kepware (a third-party software) as the OPC-UA server and its simulator driver. If you have any questions regarding KEPServerEX, please contact Kepware for support.

Right click on Project and navigate to Properties, Property Editor. Choose Allow anonymous login option as Yes for OPC UA (if default is No) from the Property Editor as shown below and click on Apply:

After KEPServerEX is set up, log in to the Windows machine to set up the three wind turbines (Wind Turbine 1, Wind Turbine 2, Wind Turbine 3) using the KEPServerEX simulator driver.

As shown in the following screenshot, each wind turbine has two PLC units:

Unit 1 has three tags: Power, Rotor Speed, and Wind Speed

Unit 2 has two tags: Equipment Temperature and Outside Temperature

After the tags are created, monitor the simulated values by launching the OPC Quick Client (shown in the screenshot above) to validate the data simulation. The following screenshot shows the OPC Quick Client display when Wind Turbine 1.Unit 1 PLC is selected.

The /var/sitewise is the default directory which you can customize (for example, replace /var/sitewise with /var/custom/path/). Doing so requires extra steps after the AWS IoT SiteWise gateway is created. For more information, see step 5 in Configure the AWS IoT SiteWise Connector.

After EC2 instance configuration is complete, follow the instructions in Module 2: Installing the AWS IoT Greengrass Core Software to install AWS IoT Greengrass software (version 1.9.4 or later) on the EC2 instance and also create an AWS IoT Greengrass group named sitewise_gg. Only execute the instructions up to Module 2 from the AWS IoT Greengrass Getting Started guide.

AWS IoT SiteWise gateway is a software which is available as an AWS IoT Greengrass Connector. A Unix shell script below deploys the AWS IoT SiteWise Connector (replace the GG_GROUP_ID, GG_GROUP_NAME, REGION, and PROFILE parameters from your environment). If you have the AWS CLI available and configured for your environment, execute the shell script from your laptop or from the EC2 instance.

Edit the Security Group for the Windows EC2 instance for KEPServerEX to allow traffic from the Security Group for the Greengrass EC2 instance for port number 49320, which you plan to use with the OPC-UA end-point.

Modeling your assets in AWS IoT SiteWise

You now have your KEPServerEX simulating OPC-UA data and have configured AWS IoT Greengrass with the AWS IoT SiteWise gateway software running on your edge gateway.

Earlier, you set up three wind turbines in KEPServerEX. Assume that one of the three wind turbines is in the East location and the remaining two are in the West location in the state of Illinois. You want to create the below asset hierarchy for the Wind Farm. Assume that Unit 1 PLC and Unit 2 PLCs are same model type across all the three Wind Turbines. You need to create four models for the asset hierarchy below – one for Unit 1 PLC, one for Unit 2 PLC, one for Wind Turbine, and finally, one for Wind Farm.

Follow the steps below to create the models:

Execute the following AWS CLI command to create the model for Unit 1 PLC:

Under Metric, update Notification Status with ENABLED (default is DISABLED) for both Max Generated Power and Average Wind Speed.

Click on Save asset to save the changes. In this step, you mapped the Measurements to their appropriate OPC-UA tags. Also, by enabling Notification Status, modeled data from AWS IoT SiteWise will now be published to the topic names as shown in the screenshot above. You can subscribe to those topics from AWS IoT Core rules engine to build your own IoT applications downstream (outside AWS IoT SiteWise).

Repeat step 7-1, 7-2, and 7-3 above for the remaining five assets below to update with their corresponding OPC-UA tags for the Measurements from KEPServerEX and enable the Notification Status for both Measurements and Metrics:

Wind Turbine 1 – PLC Unit 2

Wind Turbine 2 – PLC Unit 1

Wind Turbine 2 – PLC Unit 2

Wind Turbine 3 – PLC Unit 1

Wind Turbine 3 – PLC Unit 2

Execute the following AWS CLI commands to create the assets below (remember to replace the asset-model-id from your own environment):

Navigate to AWS IoT SiteWise, Assets, Wind Turbine 1 asset and click on Edit. Under Assets associated to this asset, add the following two hierarchy nodes as shown in below screenshot and also update Location to East and Name to Wind Turbine 1, and click on Save asset.

Navigate to AWS IoT SiteWise, Assets to verify that the asset hierarchy looks the one you wanted to build.

Ingesting data using AWS IoT SiteWise gateway

Now that you have the asset model created, set up your AWS IoT SiteWise gateway in the cloud to start the data ingestion into AWS IoT SiteWise.

Navigate to AWS IoT SiteWise, Ingest, Gateways and click on Add gateway to create a new SiteWise Gateway named Wind Turbine SiteWise Gateway with Greengrass group ID as sitewise_gg. Click on Add gateway once done.

Once the SiteWise Gateway is created successfully, you will see below:

You are now ready to add a source (KEPServerEX for this post) for the AWS IoT SiteWise Gateway you just created. Click on Manage, View Details, New source to add your source OPC-UA server details. Click on Save to save the details. Note that you can add multiple sources to the same gateway.Note that the message security policy is set to Basic128Rsa15 – Sign and encrypt (this is the same message security policy you chose earlier for KEPServerEX). The message security policy determines the algorithm used for the encryption and signing of OPC-UA messages exchanged with the gateway device. Also, authentication is set to none and anonymous to match with the Allow anonymous login option you have chosen earlier from KEPServerEX under Property Editor, General, OPC UA.

After creating the gateway and associating with the source (OPC-UA server), log in to the KEPServerEX Windows machine. To trust the certificate from OPC UA Configuration Manager (which allows the data to flow from KEPServerEX to AWS), choose Trust as shown in the screenshot below.

To verify that the OPC-UA data is streaming from KEPServerEX to AWS IoT SiteWise, execute the below AWS CLI command a couple of times for any of the asset properties to see that the value is changing from time to time. For this post, you choose asset as Wind Turbine 1 – PLC Unit 1 and Generated Power as the property. Remember to replace with the corresponding asset-id and property-id from list-assets and describe-assetoutput in your environment.

Summary

In Part 1 of this multi-part post, you learned how to model your industrial assets and ingest data from industrial sites in a secure, cost-effective, and reliable manner using AWS IoT SiteWise. You used KEPServerEX from Kepware as the OPC-UA server for AWS IoT SiteWise to subscribe to the data.