iot:aws:config:iot-core
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
iot:aws:config:iot-core [2020/06/11 13:52] – created atolstov | iot:aws:config:iot-core [2020/06/12 12:16] (current) – ↷ Links adapted because of a move operation atolstov | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Configure AWS IoT Core ===== | ===== Configure AWS IoT Core ===== | ||
- | {{ :wiki:iot: | + | {{ iot: |
The AWS Management Console is a browser-based GUI for Amazon Web Services through which a customer can manage their cloud computing, cloud storage and other resources running on the Amazon Web Services infrastructure. | The AWS Management Console is a browser-based GUI for Amazon Web Services through which a customer can manage their cloud computing, cloud storage and other resources running on the Amazon Web Services infrastructure. | ||
==== Log in to your AWS Console ==== | ==== Log in to your AWS Console ==== | ||
To get started, sign up for an account on AWS or log in to your existing account at [[https:// | To get started, sign up for an account on AWS or log in to your existing account at [[https:// | ||
- | {{ :wiki:iot: | + | {{ iot: |
Then go to AWS IoT Core. | Then go to AWS IoT Core. | ||
- | {{ :wiki:iot: | + | {{ iot: |
==== Create a new ' | ==== Create a new ' | ||
AWS IoT Core refers to devices that connect to the platform as Things (as a unit of Internet of Things). | AWS IoT Core refers to devices that connect to the platform as Things (as a unit of Internet of Things). | ||
Line 13: | Line 13: | ||
\\ | \\ | ||
Go to Manage, Things submenu and let's create a new Thing. | Go to Manage, Things submenu and let's create a new Thing. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Pick the single Thing to be created. | Pick the single Thing to be created. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Fill in the required fields, such as Thing' | Fill in the required fields, such as Thing' | ||
- | {{ :wiki:iot: | + | {{ iot: |
At the moment it would be convenient to create a [[aws-integration# | At the moment it would be convenient to create a [[aws-integration# | ||
\\ | \\ | ||
Select the " | Select the " | ||
- | {{ :wiki:iot: | + | {{ iot: |
As a result you should see notifications in the top-right corner about successfully created certificates. | As a result you should see notifications in the top-right corner about successfully created certificates. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Download and secure the following files. | Download and secure the following files. | ||
- | Root CA selection and downloading will be shown [[: | + | Root CA selection and downloading will be shown [[iot: |
==== Create a new Thing Type ==== | ==== Create a new Thing Type ==== | ||
To effectively create a bunch of ' | To effectively create a bunch of ' | ||
Line 34: | Line 34: | ||
\\ | \\ | ||
- | {{ :wiki:iot: | + | {{ iot: |
The last step is to activate Thing' | The last step is to activate Thing' | ||
- | {{ :wiki:iot: | + | {{ iot: |
The certificate status in the top left corner must change to " | The certificate status in the top left corner must change to " | ||
- | {{ :wiki:iot: | + | {{ iot: |
==== Create a Policies ==== | ==== Create a Policies ==== | ||
To establish connection it is policies should be configured. | To establish connection it is policies should be configured. | ||
If there is no policies during Thing creation generated, let's do this manually. | If there is no policies during Thing creation generated, let's do this manually. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Go to IoT Core Manage, select your Thing, then Secure, Policies. Let's create a new one. | Go to IoT Core Manage, select your Thing, then Secure, Policies. Let's create a new one. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Use the following setting to test connection. Wildcard symbol **//*//** represents all of availiable ARNs and subaction such as " | Use the following setting to test connection. Wildcard symbol **//*//** represents all of availiable ARNs and subaction such as " | ||
- | {{ :wiki:iot: | + | {{ iot: |
So now it is created. | So now it is created. | ||
- | {{ :wiki:iot: | + | {{ iot: |
So going back to Thing, Certificate, | So going back to Thing, Certificate, | ||
- | {{ :wiki:iot: | + | {{ iot: |
That's how it is should looks like at the final. | That's how it is should looks like at the final. | ||
- | {{ :wiki:iot: | + | {{ iot: |
==== Interact with AWS IoT Device Shadow ==== | ==== Interact with AWS IoT Device Shadow ==== | ||
Line 62: | Line 62: | ||
This is the current state of AWS Thing' | This is the current state of AWS Thing' | ||
- | {{ :wiki:iot: | + | {{ iot: |
The " | The " | ||
- | {{ :wiki:iot: | + | {{ iot: |
==== Test connection via PC client ==== | ==== Test connection via PC client ==== | ||
Line 75: | Line 75: | ||
In the end, this leads us to these settings in MQTT.fx to test the connection. | In the end, this leads us to these settings in MQTT.fx to test the connection. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Click the Apply and try to connect to AWS MQTT Broker. If settings are correct the connection will be established and indicator will be green. | Click the Apply and try to connect to AWS MQTT Broker. If settings are correct the connection will be established and indicator will be green. | ||
Line 81: | Line 81: | ||
Let's test shadow change: | Let's test shadow change: | ||
Copy the " | Copy the " | ||
- | {{ :wiki:iot: | + | {{ iot: |
And construct the JSON formatted message to update the shadow. | And construct the JSON formatted message to update the shadow. | ||
<code - MQTT Publish shadow update.json> | <code - MQTT Publish shadow update.json> | ||
Line 94: | Line 94: | ||
} | } | ||
</ | </ | ||
- | {{ :wiki:iot: | + | {{ iot: |
In case of mistake in the JSON format it will be received to " | In case of mistake in the JSON format it will be received to " | ||
- | {{ :wiki:iot: | + | {{ iot: |
When everything is configured well, the publish to " | When everything is configured well, the publish to " | ||
- | {{ :wiki:iot: | + | {{ iot: |
So that, you can notice that Shadow is holds last manual reported state. | So that, you can notice that Shadow is holds last manual reported state. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Line 110: | Line 110: | ||
Go to AWS IoT Core, Act, Rules. By default, there is no any rules pre-created. | Go to AWS IoT Core, Act, Rules. By default, there is no any rules pre-created. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Click at " | Click at " | ||
- | {{ :wiki:iot: | + | {{ iot: |
Just fill in the wildcard in the **SELECT** clause and topic in the **FROM**. In our case it is: | Just fill in the wildcard in the **SELECT** clause and topic in the **FROM**. In our case it is: | ||
Line 119: | Line 119: | ||
By using wildcard symbol we skip the SQL processing, but we will consider it later. For now, click at "Add action" | By using wildcard symbol we skip the SQL processing, but we will consider it later. For now, click at "Add action" | ||
- | {{ :wiki:iot: | + | {{ iot: |
To test action is working let's just republish the whole JSON payload in the another MQTT topic. Using SQL query it will be possible to filter and even reformat it. So that rule has potential power. | To test action is working let's just republish the whole JSON payload in the another MQTT topic. Using SQL query it will be possible to filter and even reformat it. So that rule has potential power. | ||
Fill in a new for testing purposes MQTT topic just to republish the whole message. "''// | Fill in a new for testing purposes MQTT topic just to republish the whole message. "''// | ||
- | {{ :wiki:iot: | + | {{ iot: |
To be able to __publish__ messages it is a role should be applied with a policy that allows it attached. Click at " | To be able to __publish__ messages it is a role should be applied with a policy that allows it attached. Click at " | ||
- | {{ :wiki:iot: | + | {{ iot: |
After the role created and appropriate policy attached, you will see the " | After the role created and appropriate policy attached, you will see the " | ||
- | {{ :wiki:iot: | + | {{ iot: |
Also, to indicate that something went wrong, but the IAM configured well, let's create an //error action//, same republish but in an "// | Also, to indicate that something went wrong, but the IAM configured well, let's create an //error action//, same republish but in an "// | ||
- | {{ :wiki:iot: | + | {{ iot: |
When those configurations are done, let's test it and pursue that it is working fine. | When those configurations are done, let's test it and pursue that it is working fine. | ||
This time, we will use AWS MQTT Client, which can be found in IoT Core, Test. | This time, we will use AWS MQTT Client, which can be found in IoT Core, Test. | ||
To start testing you need to subscribe to all of three topics that you use in your rule. It shound be '' | To start testing you need to subscribe to all of three topics that you use in your rule. It shound be '' | ||
- | {{ :wiki:iot: | + | {{ iot: |
Test algorithm is to post JSON formatted message to '' | Test algorithm is to post JSON formatted message to '' | ||
- | {{ :wiki:iot: | + | {{ iot: |
When to whole message is republished, | When to whole message is republished, | ||
<code sql> | <code sql> | ||
Line 141: | Line 141: | ||
FROM ' | FROM ' | ||
- | {{ :wiki:iot: | + | {{ iot: |
As it is tested, let's get use of the data by guiding them to IoT Analytics. Click one more time at "Add action" | As it is tested, let's get use of the data by guiding them to IoT Analytics. Click one more time at "Add action" | ||
- | {{ :wiki:iot: | + | {{ iot: |
Select "Quick create IoT Analytics recouses" | Select "Quick create IoT Analytics recouses" | ||
- | {{ :wiki:iot: | + | {{ iot: |
By clicking at "Quick create" | By clicking at "Quick create" | ||
- | {{ :wiki:iot: | + | {{ iot: |
Line 162: | Line 162: | ||
When it is done, open the IoT Analytics service and interact with data. | When it is done, open the IoT Analytics service and interact with data. | ||
Click "New Analysis button" | Click "New Analysis button" | ||
- | {{ :wiki:iot: | + | {{ iot: |
Then click "New data set". | Then click "New data set". | ||
- | {{ :wiki:iot: | + | {{ iot: |
Pick the "AWS IoT Analytics" | Pick the "AWS IoT Analytics" | ||
- | {{ :wiki:iot: | + | {{ iot: |
If it is the same with IoT Core region, such as USA, N.Virginia. (US-East-1) which is are free region at the time of writing, you will see that there is one source ready to import. Put the radio button and click " | If it is the same with IoT Core region, such as USA, N.Virginia. (US-East-1) which is are free region at the time of writing, you will see that there is one source ready to import. Put the radio button and click " | ||
- | {{ :wiki:iot: | + | {{ iot: |
The next step will indicate how much storage is available. For the first time it is near 1 GB SPICE (disk quota) available. Click " | The next step will indicate how much storage is available. For the first time it is near 1 GB SPICE (disk quota) available. Click " | ||
- | {{ :wiki:iot: | + | {{ iot: |
It is possible to create a various visualisation of your data. Look at the sample dashboard. | It is possible to create a various visualisation of your data. Look at the sample dashboard. | ||
- | {{ :wiki:iot: | + | {{ iot: |
At that point, you can visualize the data from any reporting Thing. | At that point, you can visualize the data from any reporting Thing. | ||
Line 179: | Line 179: | ||
DDB | DDB | ||
To store the data and be able to query it, you would like to pull in the database. There is AWS DynamoDB integrated for that purpose. Let's create a blank table. | To store the data and be able to query it, you would like to pull in the database. There is AWS DynamoDB integrated for that purpose. Let's create a blank table. | ||
- | {{ :wiki:iot: | + | {{ iot: |
It is primary key notion. It is like the main column in the table. The best practise it is SQL-timestamp-formatted-string with timestamp use as primary key. | It is primary key notion. It is like the main column in the table. The best practise it is SQL-timestamp-formatted-string with timestamp use as primary key. | ||
As we do not have the timestamp in the sample data, the name will be used. | As we do not have the timestamp in the sample data, the name will be used. | ||
- | {{ :wiki:iot: | + | {{ iot: |
This is the blank table. There is no any Items yet. | This is the blank table. There is no any Items yet. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Let's guide some data to DynamoDB. Go back to the Rule and "Add action" | Let's guide some data to DynamoDB. Go back to the Rule and "Add action" | ||
- | {{ :wiki:iot: | + | {{ iot: |
Fill in the name, select Role and click " | Fill in the name, select Role and click " | ||
- | {{ :wiki:iot: | + | {{ iot: |
The Rule should look like this. | The Rule should look like this. | ||
- | {{ :wiki:iot: | + | {{ iot: |
This time, you can practice to post message through MQTT.fx or use AWS MQTT Client as you wish. The MQTT.fx client will be considered below. | This time, you can practice to post message through MQTT.fx or use AWS MQTT Client as you wish. The MQTT.fx client will be considered below. | ||
- | {{ :wiki:iot: | + | {{ iot: |
In the final, you will see that you data appear in the your Table in Items tab, if everything is configured well. | In the final, you will see that you data appear in the your Table in Items tab, if everything is configured well. | ||
- | {{ :wiki:iot: | + | {{ iot: |
Otherwise, you will see the '' | Otherwise, you will see the '' |
iot/aws/config/iot-core.1591883521.txt.gz · Last modified: 2020/06/11 13:52 by atolstov