Setting up an AWS IoT Core
This article shows how to setup an AWS IoT Core and creating a IoT Thing
This article expands on how to set up the IoT Core in AWS and adding a Thing in order to prepare it for SIA Connect to transmit PLC and sensor data.
The steps are as below:
-
Logging into AWS
This step shows where to log in or create a new account to the AWS Device Advisor. It also shows how to access the AWS IoT Core -
Creating a Thing object
A Thing is a digital representation of a physical device. Creating the Thing object in the IoT Core will also create your device certificates that are used by SIA Connect to connect to the AWS IoT core. -
How to find the endpoint
The endpoint is used, alongside the device certificates, by SIA Connect to establish the connection
Logging into AWS
To log in, go to this link: https://console.aws.amazon.com/
From here, press the button to sign into the console, as shown below
Once in there, either create a user or log in with an existing user
When you have logged in, you are in the AWS Management Console. From here we need to find the IoT Core.
When you reach this screen, you have logged in and are ready to set up the rest
Create a Thing
A Thing is a digital representation of a physical device such as a sensor, PLC, BMS or similar. In order to publish and subscribe data to AWS IoT Core from SIA Connect a Thing object is needed to be created to as a digital representation.
To create a Thing object, use the menu on the left hand side to navigate to Manage -> Things
In the Things menu, we need to create a Thing object by pressing "Create things"
In this menu, all we need to do is input the desired "Thing name" which can be a describing name of the thing.
When the name has been defined, press "Next"
Here we leave it on "Auto-generate a new certificate". If you have your own certificate you can also select this and upload it. This guide will take base in auto generated certificates.
Click "Next"
For this step we either need to choose an already existing policy or create a new one. If this is your first time setting it up, you will have to create a new one by clicking "Create policy"
The policy can be set to define the allowed actions within the Thing object. For this example we will allow for all communication. You can refer to the AWS Guide (linked in the beginning of this article) for more in depth explanation on how you should set it up, if your requirements are different.
Here we create the Policy. All it needs is the name and the statement.
Be sure to switch from the "Builder mode" to the "JSON mode"
For the code in the Policy document, input the code below
{
"Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "iot:Connect", "iot:Receive", "iot:Publish", "iot:Subscribe" ], "Resource": "*" } ] }
This specific Policy will allow any form of connection and communication. The policy can be changed to fit any security needs you should have.
When the Policy has a name and a statement, click "Create"
Attach the created Policy to your Thing object by checking the box to the left of the name of the Policy, as shown below
Then click "Create thing" to finalize the setup of the Thing.
Click the "Download" button for all the marked areas in the picture below to get the device certificate, Root CA and the private & public keys.
Not all of them are needed to work with SIA Connect, but they will not be available afterwards
What we specifically need for SIA Connect is:
- Device certificate
- Private key
- Amazon Root CA 1
Finding your endpoint
After creating your thing object, you can find its endpoint by navigating to the device manager and using the sidebar, scroll to the bottom and find "Settings". Here you are presented with your endpoint.
The endpoint can be regarded as the address of your AWS IoT Core. Without knowing the endpoint, you will not be able to connect SIA Connect to the AWS IoT Core.
Here is an example of how the endpoint could look like:
a2b2rqf1kr1flp-ats.iot.eu-west-1.amazonaws.com
Your endpoint is used in Connecting PLCs to AWS IoT Core where SIA Connect will need the endpoint to establish a connection
The endpoint will be accessible at any time from this location. If lost or forgotten, navigate back here to find it again