Getting Started with Amazon AWS IoT Core using ESP32 || Creating Thing, Policy & Certificates

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
apriti here from how to electronics this tutorial is about amazon web service so basically we will learn about the aws iot core the aws iot core is a managed cloud service that connect device easily and securely interact with cloud applications and other device in this tutorial we will learn how you can connect the sp32 with aws iot core for a demo we will use dht11 humidity and temperature sensor and read the humidity temperature data the esp32 will connect to the local wi-fi network and will post the dht11 sensor data to aws iot cloud not fully posting data we can also receive the data from aws dashboard this tutorial comprises multiple sections signing up and setting the amazon web service installing necessary libraries to arduino ide and writing an ordinary sketch for the project creating a thing in aws creating policy and attaching to thing generating certificates modifying arduino sketch according to think data and credentials subscription and publish data to and from aws dashboard this tutorial is a tutorial for beginners who want to learn about the amazon aws iot core for iot applications so without getting any delayed let's get started the pcv board used in this project is sponsored by next pacific next visibility offers totally free pcv prototypes which means you can get 10 pcvs of one to four years without any cost there is no pcb cost or shipping fee you can upload the gerber file directly and fill in the pcv details like quantity color and thickness then select your country first statement and place an order it's totally for free and there is an exciting offer for new registers as you can get hundred dollar coupon if you sign up using the link in the description welcome back again the hardware required for this project is an esp32 wi-fi module i'm using a room esp32 board you can use any other version of esp32 board and for the sensor part we will use dht11 humidity and temperature sensor connect the dht11 sensor to esp32 board as per circuit diagram here and you can use a braid for for connection or simply use a male to female connector wire now go to your web browser and search for aws iot core so basically we need to set up the aws account now so create an account using the email id and password the account also requires a bank credit card information there will be no charges but aws just needs a verification using your bank account it will also ask for phone number verification hence the account will be successfully created now let's say the code for this project we will use a dht library and retrieve the humidity and temperature data from dht11 sensor we will also need wi-fi client secure library publish subscribe client library and the arduino json library the link for all these libraries is on our website article then we have a separate header file here called as a credit start edge this contains all the credentials and informations related to aws we will modify this file after setting up the aws thing now go to the aws console window go to service and search for iot core after clicking on iot core aws id dashboard will appear now on the left side of the dashboard there were so many options but we need to work with two options here one is the menus option and other is the secure option under menu's option click on things now we need to create a thing here so click on create things here you can select whether create a single thing or create many things but in my case i will select create a single thing then click on next here we need to specify the thing properties first give a thing name you can name it anything for example i will name it esp32 underscore dht11 under additional configurations there is no need to make any changes under the device add option select the first option as no shadow then click on next now you need to configure device certificate so here you can auto generate new certificate or use your own certificate or upload csr or skip this but aws recommendation is to select the auto generate new certificate then click on next now we need to attach a policy to the things we created but no policies are here right now so we need to create a policy first so click on create policy here give any name to the policy for example i will give it a name as esp32 underscore policy now that statement part is very important under the action type iot so multiple options will pop up from here we will only need publish subscribe connect and receive first select iot connect option in the resource arn replace the last section with the client id give any name to the client id for example esp32 underscore dht11 under effect select hello again at another statement this time select iot publish in the resource arn replace the last section with the topic that you assigned in the code here it is assigned as esp32 slash publish so i will replace it with the same under effect again select allow now add third statement this time select iot subscribe in the resource arn replace the last section with a topic that you assigned in the code here it is assigned as asp32 subscribe so i will replace it with the same under effect again select allow add fourth statement now this time select iot receive in the resource arn replace the last section with the topic similar to the subscription so i will replace with the same subscription topic under effect again select allo now click on create to create the policy so all the policies have been created successfully now go back to creating option so you can see a policy option appeared here as well we need to attach the policies to the certificate so select the policy and click on create thing now we need to download all the certificates from here first download the device certificate and then rename it as a device certificate for identification also download the public key and rename it as a public key then download the private key and rename it as a private key in the root says certificates we have two certificates here but we just need root ca one certificate so download it as well so we have downloaded all certificates that we need for our project now click on done so we have successfully created a thing as well as a certificate here is the thing named as esp32 dsd101 to view your certificate go to the certificate section and to see the policy go to the policies section now it's time to modify the code go to secrets.tab and let's begin the modification here we need to include a thing name you can go to the things section and copy the thing link from here and paste the thing name over here under the wi-fi ssid and password enter the wi-fi ssid and password now we need to insert the aws iot endpoint here to get the endpoint go to the settings part of aws dashboard so here is the device data endpoint click here to copy the endpoint and then go back to the arduino ide and paste it here you need to insert the amazon route ca1 here so for this we need to go to back to the certificate that we downloaded earlier open this file with node plus plus and copy all the text then go back to arduino ide and insert the copied text between begin certificate and the in certificate under these lines we need to paste the device certificate text so open the device certificate file that we downloaded earlier and again copy the text and paste it between the begin certificate and in certificate section under this part we need to insert the device private key so go to the downloaded folder again and open the device private key file using node plus plus again copy the text and paste it here so modification of the arduino sketch is done now go to the tools now select the sp32 board that you are using for this project select the com port then click on the upload option to upload the code to usb32 board once the code uploading is done open the serial monitor the sv32 will try connecting to the wi-fi network once it get connected to the wi-fi network it will try connecting to the aws iot server you can see now the humidity and temperature value is displayed on the serial monitor the same thing slowly posted to the aws server to check that go to the test section of aws dashboard under the test section we have an option for subscribe and publish now to see the data first copy the publish topic from the code and paste it here in the additional configuration you can make changes if you want then click on subscribe when you hit the subscribe button immediately the data from esp32 can be seen here the data is updated here after an interval of every one second this is really amazing as we are able to receive the data published from esp32 through mqtt protocol you can check the data with the data printed on serial monitor both of them are the same this is how we read the subscribe data now let's see if we are able to publish the data from aws iot core to esp32 or not for this you need to again change the topic and replace it with the same topic that you kept in the code under additional configuration do nothing then click on publish immediately you can see the message has been sent to the serial monitor this is amazing isn't it now let's try by sending something else so this is my message and i hit the publish button it's saint again this is how you can send or receive data from aws iot core using esp32 this is a basic beginner's tutorial for the users who want to get started with amazon web service for their iot device i will be making more videos on aws and will publish them soon stay tuned and subscribe to our channel
Info
Channel: How To Electronics
Views: 54,937
Rating: undefined out of 5
Keywords: Creating Thing AWS, aws iot core getting started, DHT11 ESP32 AWS IoT, AWS IoT Core ESP32, Creating Certificates AWS, Publish AWS IoT Core, Creating Policy AWS, Subscribe AWS IoT Core, aws iot core device provisioning, aws iot core demo, sensor aws iot, Amazon Web Services, aWS IoTCore, aws cloud, internet of things
Id: idf-gGXvIu4
Channel Id: undefined
Length: 11min 30sec (690 seconds)
Published: Wed Dec 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.