Getting Started – AWS IoT Gateway
Tags can be defined to interface with AWS IoT Gateway with the built in AWSIoTGateway Driver Interface
The following steps can be used to setup a AWS IoT “Thing”
Step 1 – From your AWS Iot Portal select Manage / Things. Then select Create
Step 2 – Select Create a single Thing
Step 3 – Register your Thing
Give your thing a name and select Next.
Step 4 – Create a Certificate
Download the Certificate and the Private Key (Remember the location where you save them). Activate the certificate and select Attach Policy.
Note: You do not need to install a Root Certificate.
Step 5 – Attach a Policy to the Certificate
Select Create New Policy. See AWS Policy Documentation
Example Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:*",
"Resource": "arn:aws:iot:us-west-2:077684378327655491:topic/replaceWithATopic"
}
]
}
Step 6 – Copy the IoT Endpoint
In the AWS IoT portal select Settings and copy the Endpoint. You will need this in the OAS driver configuration.
The following steps can be used to setup direct driver communications with AWS.
Step 1
Start Configure OAS application from the program group Open Automation Software.
Step 2
Select Configure-License and verify that AWS IoT is enabled under Products. If you do not see the AWSIoTGateway driver available contact support@openautomationsoftware.com to update your license.
Note: You will need to be running Open Automation Software Version 10.0.0.22 or greater to support AWS communications. You can download the latest version at www.openautomationsoftware.com/downloads/open-automation-software/
Step 3
Select Configure-Drivers.
Step 4
Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.
Note: Optionally select the Live Data Cloud node if you are hosting AWS data over the Internet with a standard Internet connection.
Step 5
Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with AWS Source.
Define the properties for the desired physical connection.
Note: You may need to Set Default Network Adapter for Driver Interfaces of the operating system.
Set the driver to AWSIoTGateway. Enter the IoT End Point and browse for the Certificate File Path and Private Key File Path for the interface. The default port is 8883.
Optionally define a secondary AWS end point if the primary server fails with the property Enable Failover.
If both the primary and secondary servers are offline the Return to Online settings determines the retry frequency.
View Driver Interface Failover for more information and and video demonstrating communications failover.
Step 6
Select the Add button in the lower part of the form to add the Driver Interface as an available selection when defining Tags in the next step.
Note: If you need to define several Driver Interfaces you can use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.
Step 7
Select Configure-Tags.
Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.
Note: Optionally select the Live Data Cloud node if you are hosting AWS data over the Internet with a standard Internet connection.
Step 8
Select to Add a Tag.
Note: You can also add organizational Groups as many levels deep as you prefer and add tags to groups. To do this first add a Group to the Tags Group at the root level, then right click on the Group in the right window to add additional Groups or Tags.
Step 9
Set the appropriate Data Type.
Note: if you will be receiving data from your Thing set the Data Type to String otherwise set the Data Type to the desired data type.
Step 10
Change the Data Source Tag property to AWSIoTGateway.
Step 11
Select the correct Driver Interface from the Driver Interface pull down list.
Step 12
Enter the Topic.
Step 13
Set the Topic Timeout – 0 = Topic will never timeout. Any number greater than 0 will cause the data to be Bad Data Quality if the broker does not publish within the time frame specified.
Step 14
Select to include Timestamp and or Data Quality to the topic.
This will publish to the specified topic above OAS/Items Sent/Timestamp and or OAS/ItemsSent/Quality.
Step 15
To define multiple tags use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.
Note: You can also programmatically define Tags using the free to use OPC Systems component as demonstrated in the Form FormConfigureCSV in the WinForm Example Code application that installs with Open Automation Software in the Program Group Open Automation Software. This component can be used in any .NET application includes Web Services, Windows Services, WPF Applications, and ASP.NET or .NET MVC Web Applications.
Step 16
Select the Save button on the toolbar at the top.
Step 17
Create a directory on the local C: drive with the name OASDemo.
Save the file DemoTags.tags in the directory C:\OASDemo\.
Step 18
Under Configure – Options set the Default Tag Configuration File so when the computer restarts the tag file will automatically be loaded.