An AWS IoT SiteWise gateway connects to data sources to retrieve your industrial data streams. The gateway runs on AWS IoT Greengrass V2 as Greengrass components. For AWS IoT SiteWise a data collection pack and a data processing pack will be deployed. The data collection pack collects data, and then export the data to the Cloud. The data processing pack enables your gateway to process data at the edge.
Data packs use streams from the AWS IoT Greengrass stream manager.
To transfer data to AWS IoT SiteWise in the AWS Cloud the stream SiteWise_Stream is used. You can also provide a custom stream to transfer your data to other destinations.
In this chapter you will learn how to create and configure an AWS IoT SiteWise gateway.
In the workshop your gateway is represented by your Cloud9 environment. AWS IoT Greengrass V2 must be installed including the SiteWise packs.
The AWS IoT SiteWise console provides a gateway installation wizard which generates an installer based on your information. The installer creates a Greengrass V2 core device installs the Greengrass V2 core software on your industrial gateway, deploys Greengrass V2 components and creates an AWS IoT SiteWise gateway.
You will configure one OPC-UA data source on your gateway:
The naming convention for the installer is Gateway_Name.deploy.sh. As you choose sitewise-workshop-Gateway for your gateway name your installer name is sitewise-workshop-Gateway.deploy.sh.
Upload the installer to your Cloud9 environment.
You run the installer in a Cloud9 terminal. Before you can run the installer you must make it executable.
In a Cloud9 terminal:
cd ~/sitewise chmod +x sitewise-workshop-Gateway.deploy.sh sudo ./sitewise-workshop-Gateway.deploy.sh
When the installer has run successfully you should get a message similar to:
Successfully set up Nucleus as a system service
To verify the installation ensure that the Greengrass core has been created and the components have been deployed.
Verify the Greengrass core software is running on your industrial gateway.
In a Cloud9 terminal:
ps aux |grep green
The result will show processes which are related to the AWS IoT Greengrass core software and should look similar to:
root 19785 0.0 0.0 124064 3004 ? Ss 13:38 0:00 /bin/sh /greengrass/v2/alts/current/distro/bin/loader root 19817 12.3 8.8 3636200 351320 ? Sl 13:38 0:20 java -Dlog.store=FILE -Dlog.store=FILE -Droot=/greengrass/v2 -jar /greengrass/v2/alts/current/distro/lib/Greengrass.jar --setup-system-service false root 19945 0.0 0.1 133436 6828 ? S 13:38 0:00 sudo -n -E -H -u ggc_user -g ggc_group -- sh -c java -cp /greengrass/v2/packages/artifacts/aws.greengrass.StreamManager/2.0.12/aws-iot-device-sdk.jar:/greengrass/v2/packages/artifacts/aws.greengrass.StreamManager/2.0.12/AWSGreengrassGreenlake-1.0-super.jar com.amazonaws.iot.greengrass.streammanager.StreamManagerService ggc_user 19950 3.7 4.2 3640992 167704 ? Sl 13:38 0:04 java -cp /greengrass/v2/packages/artifacts/aws.greengrass.StreamManager/2.0.12/aws-iot-device-sdk.jar:/greengrass/v2/packages/artifacts/aws.greengrass.StreamManager/2.0.12/AWSGreengrassGreenlake-1.0-super.jar com.amazonaws.iot.greengrass.streammanager.StreamManagerService root 19972 0.0 0.1 133436 6768 ? S 13:38 0:00 sudo -n -E -H -u ggc_user -g ggc_group -- sh -c java -cp /greengrass/v2/packages/artifacts/aws.iot.SiteWiseEdgeCollectorOpcua/2.0.1/IotSiteWiseOpcUaCollector-1.0-super.jar com.amazon.iot.sitewise.component.collector.OpcUaCollector root 19973 0.0 0.1 133436 6784 ? S 13:38 0:00 sudo -n -E -H -u ggc_user -g ggc_group -- sh -c java -cp /greengrass/v2/packages/artifacts/aws.iot.SiteWiseEdgePublisher/2.0.1/IotSiteWisePublisher-1.0-super.jar com.amazon.iot.sitewise.component.Publisher ggc_user 19978 3.5 4.4 3596592 177516 ? Sl 13:38 0:04 java -cp /greengrass/v2/packages/artifacts/aws.iot.SiteWiseEdgeCollectorOpcua/2.0.1/IotSiteWiseOpcUaCollector-1.0-super.jar com.amazon.iot.sitewise.component.collector.OpcUaCollector ggc_user 19982 4.0 3.9 3598928 156700 ? Sl 13:38 0:05 java -cp /greengrass/v2/packages/artifacts/aws.iot.SiteWiseEdgePublisher/2.0.1/IotSiteWisePublisher-1.0-super.jar com.amazon.iot.sitewise.component.Publisher ec2-user 20123 0.0 0.0 119420 992 pts/2 S+ 13:41 0:00 grep --color=auto green
Log files for Greengrass and SiteWise components are stored under the directory /greengrass/v2/logs. In case of errors examine log files in these directory. Note: you must switch to the root user to access the log directory:
sudo su - cd /greengrass/v2/logs/
Some important log files are:
Continue to the next section to start your OPC-UA server.