ESP32 | AWS IoT Button | IoT Rule Engine | AWS Lambda | CloudWatch Log | IoT Core #ElecrowMaker

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello hi every magicians so welcome uh let me just quickly check if i am live on youtube and then we can start today's session if i'm live on youtube looks like i am live on youtube thank you so much thank you magicians thank you for joining today's session today we are going to see something uh special and we will learn some new concepts today so for as you are seeing my screen you will be seeing one esp32 board and one capacitive touch sensor so today we are going to develop an aws iot button so instead of using a physical button or instead of using those kind of push button we will be trying to use this touch based button stretch sensors so that they will be used and any activity on these button could be logged in our aws iot so this will act as an aws iot button okay so first let me just quickly share my screen and let me show you what all i have for you okay so uh this is the document that i am going to cover today where we will be seeing uh how esp32 and this capacitive touch sensor can be used as an aws iot button so our aim will be when we touch this touch sensor a message should be published to aws iot core okay and in turn this awa aws iot core it will invoke a lambda function that will record the activity in our cloud watch log okay fine so today's aim is to teach you about different functionality and different features of aws we will be interacting with iot broker we will be interacting with iot rule engines we will be interacting with aws lambda and then we'll see however a message from this capacitive sensor or from this touch sensor however message uh is recorded in our aws cloud watch log so this way we can see uh we we can use these touch sensors to send data over iot cloud okay so before starting this session let me just quickly show you how this will work or how we are going to develop this so as you are seeing my screen uh first of all uh this is our iot core so where i am i will subscribe for a topic and this will be our cloud watch so where we will see the data coming in from our touch sensor and this is our simple touch sensor code so first let me connect to my sensor i have connected to the sensor and i am just pressing the reset button on my esp32 so once i have pressed the reset button and i can open now the serial monitor so here is the serial monitor and as you see in the serial monitor that i am already connected to the aws iot uh core so let me quickly pull the iot code as well let me try to minimize the screen so that you can see both the screens all together so here is our aws iot core and here i am going to test our messages so i will quickly subscribe to the topic which this esp is publishing so our published topic is imh esp32 pub so this will be the topic which uh our esp32 is publishing so i will subscribe to the same topic in my aws iot course so if you'll see here i am subscribing to a topic image esp32 slash pub and i'm going to press the subscribe button so now you are seeing that my aws iot core is actually now waiting for the messages to be coming in it is subscribing on this topic so now as soon as i will touch the sensor you will observe the output in our serial monitor that button has been that this sensor has received some input and as soon as that it will receive the input the same you can observe in our aws iot core amputee decline test right so i will just touch it here so you are seeing as soon as i touch it you see it has published a message saying action pressed as soon as uh the message action pressed is published to iot uh broker you are seeing that in our iot core the same message has been received and at the same time it will call a lambda function also and that lambda function is simply going to uh register this message in our cloud watch log and this is our cloud watch log if you will see here let me try to refresh this so when you will refresh it you will see a log has been created here so when you will click on this log then you can see the activity has been recorded at this time here so this way whenever you press whenever you touch the sensor it publishes a message to our iot core like this here and at the same time ah lambda function is invoked and that lambda function registers this activity uh in aws watch uh cloud watch log so let's do it one more time i will just touch it so you are seeing i have just tested touched it and it published a message called action pressed and here you are seeing this that has been received in my iot core here also and if i will go my cloud watch log so this is our lock and i will refresh the lock because you are seeing only one action pressed has come here so far i am scrolling there is nothing much so i will refresh it so when you will refresh it you will see that another action press event has been registered if you will see the timings here so you will see the time is 1300 so that was the time when it received the message action pressed so this is how this is what we are going to develop today we are trying to understand how as soon as we we touch the sensor how this message is rooted from my iot code to the aws cloud watch log using our lambda function okay so that is it that's the agenda for today's session and this is what we are going to achieve at the end of the day hope uh you will be uh you will be enjoying this session and you will remain till the end of the session where we will learn more um more on this okay so as i already informed this is the document which i am going to cover so let's get started uh so let me first try to take out this pin of my touch sensor so that it will not unnecessarily send data to aws when i touch it so i have disconnected my sensor from the esp32 okay so our aim is uh when we touch the touch sensor a message should be published to aws iot core and in turn iot core should invoke the lambda function and record this activity in cloud watch log so this is our aim and what we have already seen the end result of our aim that it works and now is the time when we are going to implement it okay so there is some assumptions before starting this project if you are live uh with me and you are going to implement this with me then you must uh then i must assume that you already have gone through the earlier session remember in my earlier session excuse me i had explained you how do we create a thing so because we are interacting with our iot core and we for that we have to create a thing we need to get it certificate we need to attach policies such kind of stuff we have to do with our things right so in my earlier session i had already gone through with that so i assume that you have already gone through the earlier session where we had created the thing image esp demo and we are going to reuse that so the thing which we had created in our earlier session we had created image esp demo in our earlier session and now i am going to use the same thing i'm not going to recreate the thing i'm not going to recreate the certificates i'm not going to recreate the policy so i'm not going to create any of those and i assume that you already have it in your aws console if you do not have it let me quickly go through that i will not go into details but i will quickly go through and will try to create a thing policies and certificates and so that you will it will the idea will be there in your mind and it will refresh your memory also okay so how do we create a thing so let me quickly go here iod so this is my this is our iot core so uh let's let's say i'm first i will be going to create a thing then we will get its certificate we will create the policy and we will use the appropriate policy that is required okay so from here from manage things you will go here or better we'll go from on board we'll go to onboard and from there we'll go to get started that's the place to create a thing and from the get started we will use uh on board our device and we'll just click get started so all this activity we have already performed in earlier session here just i am going uh quickly and to show you how do we create a thing how do we get it certificates and how do we use the policy okay so here then you will go get started and you will use uh choose a platform as linux ox and python as your language and then we'll just go next here it asks for the thing and let me try to give image esp demo and suppose today's date i'll give 30th july okay so i have given this as the thing name and i will go next step and here it has said that successfully created the thing our thing has been created and a policy also has been attached to this thing so this is the policy which is attached to our thing and from here you will download its certificate so you are seeing our thing has been created our policy has been now created and our certificate has also been generated so you need to just click on that and you need to download it anywhere in your system so i'm just downloading it here under trash and i'm giving some name called 30th july and i will save it and once you have saved these certificates you will go to the next step and simply you will say done so this is the way that we had created the thing and we had got its certificates here also done fine so you will be coming to this screen here where you see that your thing has been created when you will click on this thing you will see and if you go to the certificate section here you will see that the certificate is already attached to the thing and when you go to a certificate and will go to the policies there you will see that the policy the automatic policy which it has already generated and attached to this certificate so if you will go to this policies you will see like now this is the overview of the policy and from edit policy document you can simply go here and you can edit the policy as per your requirement the way we had explained in our earlier session what should be our policy in this case and we had pasted that policy here so once you have done that your policy is also ready so your thing is ready uh your certificates are downloaded your policy is uh updated so all these things have you have done so far i hope that you have followed all this thing from my previous session if not please go go to there and first try to understand that and another thing that we had uh observed from here how we had uh got our endpoint url so from our settings we had got our endpoint url and we had also tested our device from uh going to mqtt test client by going here we had done publish and subscribe to the uh device shadow so all these things we had already done uh in our last session uh apart from that we also had created a file called secrets dot h let me quickly show you that file so if you will go to your previous example so this is our previous example so where we had already created a file secrets dot h and remember here we had provided our thing name our wi-fi credentials actually now this is a file this is a header file which we are which we will be going to use in our program today uh and this secrets dot h file we had created during our last session uh this was the thing name here and our wi-fi ssid our wi-fi password and this was our aws iot endpoint and uh the certificates which you had already downloaded you had given uh the values of your certificate directly inside this header file so first you need the root ca and then you need you needed your certificate then you needed your private key so all these information you had already provided in the secrets.h file and i hope and i believe that you also have done all these steps so far so if you have done all these things so far you are ready to go with me otherwise first you have to complete those activity then only you can come to this video and then can learn uh further from here okay okay so once all these things are in place we are good to go so below is our logical diagram that we are going to implement today so this will be our aws iot button as you are seeing here i have used a touch sensor with esp32 from here we will send a message to our iot broker and from there a rule engine will work on the iot broker and as per that rule our aws lambda function will be called and then that aws lambda function will register our message in aws cloud watch log okay so before uh going through how we are how we will implement it just try to understand let's see what is the sensor and how does this work sorry so what is capacitive touch sensor the digital sensor ttp double to 2 3 it's a capacitive touch sensor it allows you to remove the worry of conventional push key systems right normally it outputs slow and keeps at very low power state when a touch is sensed on the circular marked region you are seeing that here you have the circular mark region as you can see in my sensor also this is a circular region so this is the touch region where when you will touch it it outputs high and switches to the quick response state and when it is not touched the switch to low state start again so when you will touch it it outputs one and when you release the touch it outputs zero so this is how our touch sensor works and we are going to use this uh phenomena in our project today this sensor contains a touch area similar to a fingerprint icon yes inside the area you can touch the trigger the touch to trigger the button this sensor it operates between two to five point five volts so we are going to use 3.3 volt from esp to to use this sensor okay so how do we interface it with esp32 it is simple interfacing there is nothing much difficulty in this so and the ground pin it has this sensor has three pins as you are seeing here it has three pins and the ground pin the black the black pin is the the black wire is denoting here this is the ground pin the red one the red wire is the vcc pin and the final white color wire is the signal pin okay so these are the three pins that we need to use in our sensor so ground pin will be connected to the ground of esp32 the vcc pin will be connected to 3.3 volt to the esp32 and the signal pin of touch sensor it will be connected to gpio4 of our uh esp32 so as you are seeing this is this white pin this my white pin this is a signal pin which we had which i already have disconnected from the esp so that if i touch it now it will not send anything to our aws otherwise it will start sending information to our esp32 which i don't want right now so that's why i have disconnected the signal pin okay so this signal pin is connected to you are seeing here to the gpio for in our esp32 so this is the simple diagram and there is nothing much difficulty uh to make such kind of connection and this is i have shown you my physical uh this connection same here in this screen so firstly we will write a lambda function okay so now let's let's try to understand the aws thing what we are going to do there and how do we call our lambda function how do we write the lambda function and how it will be executed automatically when a message is published on certain uh topic from our esp32 so let's try to understand all that now so first of first of all we'll have to write a lambda function which will be invoked as soon as the message is published on the topic esp image esp32 slash pub so this is the topic that esp32 is trying to publish later on so as soon as a message is published on this topic our lambda function should be invoked yes uh so let's follow the below steps to create the lambda function so this is the way we will create the lambda function first of all we will go to the lambda console so this is another lambda console let me go here and quickly go to the lambda console here so i will copy this so once you will be here in your lambda console so this is my lambda console as you are seeing and then you have to click on functions under functions you have to create take functions so under functions on the left hand side you are seeing the function you will click on the function and then from the functions you will click on create function so when you will click on create function it will open a screen for us to create a function okay let's go and follow the document as i'm already saying this document is very detailed document where i have given all the steps screenshots so just follow the step by step procedure you will be able to achieve this project and if you need this document if you need the code that i have used in this document please ask me i will provide you ask me in my whatsapp or in my facebook group or just let me know in the comments of this video my number is already there in the description of this video if you need okay so once we have come into this screen we will choose author from scratch and we will give the function name as any function name that you can give i can give i have image esp demo something and you have to choose run time as python 3.8 and then just click create function okay so let me do that first so i'm coming here so first you have to choose author from scratch here you have to give the function name so i'm giving image esp demo 30th july [Music] and i'm giving dash lambda so this is what i have given the name of my lambda function runtime you have to choose python 3.8 because i am going to write this lambda function in python and simply then you have to create click function so once you do that your lambda function should be ready so that that that's how we create a simple lambda function and you see it's very simple and easy to create a function okay cool so you are seeing that my lambda function image esp demo 30th july lambda has been already created and i am into this screen okay so what do we do next just follow the document our lambda function will be created fine now from the code source double click lambda function dot phi to edit it see below like under the code source you are seeing there is a file called lambda function dot pi you have to double click on that as soon as you will double click on that and this file will open on the right and where you can edit it okay so first scroll down so this is the code source where you have to look for the file so this is the lambda function dot pi which we are going to change double click when you will double click so it will open the file which was already open actually now on the right side so this is the code section where we are going to write what this lambda function should perform so our in this case actually we just want to register we just want to uh print the message which is coming from our esp32 and we just want to print that in our cloud watch log we just want to uh register that into our log so for that what do we do let's follow the documents sure so you're seeing magicians this document how easy to implement with all the screen shot detailed out steps so please get this document from me and try to implement this project no more excuses now since our aim is just to record the published message in cloud watch log so what we'll do we'll just add a single this liner function to our lambda code and we'll click deploy to save it since we want to print our message in the cloud watch so how do we print in cloud was so using print function we use it so i will copy this command and you will simply paste your command inside lambda handler function like this so i just pasted the command print json dumps event and you will click this deploy button so as soon as you will deploy you will click on deploy button you will see that your changes have been saved and your lambda function is now ready to dump any input that will be coming from our esp32 okay fine so that's how that's all for the lambda function site let me now just follow the document again so you will see that you have simply written the print statement and now you have done the deployment also you can do anything inside this lambda code yes of course as a programmer as an id magicians i expect something more uh to be done by this lambda function but as per our project aim we are just recording the activity in the cloud watch log so but you can do anything you want the only restriction is your imagination right so you can write you can you can do anything inside this lambda function okay so so far we have created a thing yes we have got its certificates yes we have attached the necessary policies yes so all these you know all these uh things we had done already from our previous session right and now we have created a lambda function to print the incoming even directives to our cloud log watch cloud watch log sorry so so far we have done this many things so we are grateful for that okay now we have to configure the iot rule engine as i already informed you when this esp32 will publish a message to our iot core at the time there should be a rule engine should be running and that engine should identify what type of information is coming from uh esp32 and based on that this rule engine should invoke our lambda function and then rest of the things will be done by lambda function cool this sounds really very interesting let's see how do we do that so how do we create a rule engine how do we how do we automate things in our iot code this is what we are trying to learn today next we will make use of aws iot rule engine and set up the rule in such a way that whenever there is a public publish action on the topic imh32 pub is happening and the message has a payload saying action as a key and pressed as in value like you had already seen whenever we are publishing and the data to iot core we are publishing in this json format right the action is the key and pressed is the json value so our iot core engine will be working on this kind of information it will see if a message is published on the topic image esp32 slash pub if that being the topic and if the message message format is something like this and where action is the key and first is the value if this kind of information is coming then what it should do then it will invoke our lambda function simply so this is how we are configuring our rule engine we are giving information to religion saying rule engine saying if you get a published message on this topic i am a csv 32 slash pub and if the message type if the payload message has a key called action and the value as pressed then you call the i our lambda function correct and then rest of the things will be done by lambda function as soon as it will be called fine cool i hope so far so good and you are not having any confusion any doubt if you still you need any help or if you it's it's bit confusing or any issues you are facing just let me know in the comments i will try to solve that and if you need any help on this just let me know i'll be happy to help you so now let's let's say in our case we are doing a published topic as imhesp32 pub so this is a published topic uh which our esp32 is using and the payload is like this esp32 will be sending a message in this format and then what will happen it will call our lambda function which we had just created and this lambda function in turn will log the event so this is what all uh we are going to achieve so how do we create a iot rule and how do we how do we inform that iot rule that publish it should be published on certain topic or our payload should be in this format so that kind of rule how do we write in our iot rule engine this is what we are going to see now so let's let's get started so to configure iot rule first of all you need to go to your iot core dash dashboard and from there you have to go to act and then you have to go to rules and then click create okay so without wasting time let's go over iot core so this is our iot core dashboard inside iot core dashboard you will be seeing on your left side uh you will be seeing let me first minimize everything yeah okay so from your left side side you will be seeing a menu called act so you will click on it and inside that you you're seeing rules so you'll click on rules as already mentioned all these things in the document also and then you'll just need to create uh you just need to click on create to create a rule so now we are going to create an iot engine rule so let's say it is asking for some name let's save image demo image esp let me call it demo image esp demo 30th july and say rule okay so this is the name of my rule you can give any name to this rule and here you can write some description and just write you can write a proper description that what this rule is for what action it is going to take similarly uh the intention of this rule you should mention here in the description but here just i am writing as text description so and then uh let's follow the document okay so once you have given the name as this and you have provided the description then you will have to scroll down and provide below query has rule query statement so here is one query this is the query statement and you have to use this query statement in your rule engine so if you will come to your rule engine screen and you will scroll down here under rule query statement you have to provide that query statement over here first let me copy that query here first i will delete whatever was there already and i will copy this query and i will simply paste the query here let me make it little bigger okay so now let me explain you what is this about and how it is fetching uh the intended result so the the query statement which i have written i am saying select star from imh esp32 so this is our topic on which our esp32 is publishing so we are asked we are saying using using this statement we are seeing that you fetch all the records you fetch and all the values which which is which is coming with this topic uh image esp32 but here after that we have mentioned a filter condition saying action equal to pressed so now it will fetch all the values uh all the values from this message from the message which is coming as a part of this published topic where action is equal to pressed so in this case if you will see our uh payload so it will fetch the record which has action as pressed so in this case this record will be selected by our uh iot rule engine so our iot rule engine we select the particular message where action is pressed and the message is coming due to this uh topic published okay so once iot rule engine has received the message now what to do next let's see again you have to scroll down and you have to now click add action and set one or more actions so here under uh set one or more actions you have to click on add actions because and now iot rule engine has extracted the required information using this uh statement right so when rule engine will apply this statement it will receive the message the intended message now what to do with that message right so that you will specify here set one or more actions so our aim is to provide the message to provide that message to our aws function so we have to call the aws function lambda function right so that we will do here so you will click on this add action so when you will go click on the add action you will see that it is asking us to specify one of the action that you want to that this rule will want to perform okay so what do we do now let's follow the document so now choose an action send a message to lambda from lambda function so that should be our action and then we'll click configure action at the bottom of the page of course so among all these options you can choose only one option so my option is this send a message to lambda function i will select this so out of all these options i have selected an action saying send a message to lambda function and will scroll down and you will just say configure action so as soon as you will click configure action so now which lambda function you have to specify the lambda function also so let's go back to the document let's see so as soon as you will click on create configure action from the function name now you have to select the lambda function which you want to be executed and then click add action okay so from this screen when you will come to this screen it will ask you what lambda function that you want to be executed so from the hair from the select you will go here and it will show you all the lambda functions that you have in your console right so you will choose the lambda function that you need so that you are seeing i had just created this lambda function image esp demo 30th july lambda you will select it and then you will just say add action so as soon as you will click add action and you will scroll down you will see that your action has been set so now your rule engine is ready with the man data as well as the action so it has collected the information it has collected the data which we want from here from this query statement and then it will pass this data to our lambda function which we have set here from add action so now you will just click create rule awesome so you have enabled you have just created the rule in your aws iot code so that's that's the way how do we create a role in our iot core okay so what uh our rule i am much esp demo role this rule has been successfully created and that's all for the iot course site in essence so now this is these are the things that we needed to perform and we have done uh all the things which are required from the iot core site and that's all for the iot core side in essence so far we have completed below activity so now make sure before writing the ino code to esp now you have finished and you already have all these things available with you then only you need to proceed otherwise you need to first finish those activities so let us see what all is required at this stage in essence so far we have completed below activities do not proceed if any of these are pending so created a thing image esp demo yes we have created a thing downloaded its certificates and keys yes all these things we had done from my our previous session we had already done it okay what is the next assumption next thing attached the needed policy yes we had attached the policy also to the think certificate yes this also we had done from the previous session we had created and configured the file secrets dot h as per our settings yes we already have the secrets dot ash file with us where we had provided the thing name the wi-fi credentials the different certificates root ca certificates our private key our certificate details all such things we had already given in our secrets dot h file this is also we have with us we have created a lambda function yes we just now we created in this session our lambda function and we have created a rule which will invoke the lambda function each time when there is a publishing on the topic imh esp 32 pub with payload action pressed so yes this road also we have just created now so all such things we have already done and all these bullet points excuse me and we satisfy all these bullet points so we are good to go ahead but remember if you have not completed any of these step and if you are any of the step are pending please complete those first then go ahead okay magician so we are good to go ahead and write uh the code in our esp32 so now let's execute the project please follow the below steps open arduino ide connect esp let me first close everything i will close all the arduinos i have closed the arduinos okay so now open arduino ide connect esp32 to our laptop identify the com port okay so let's let's do that first so i will open and i will open my arduino ide let me open with the blank one so this is my arduino ide and i have already connected my esp32 uh to our laptop and my com port is four already my composite is 4 so from ide i will select uh the board which is esp32 board already selected devmodule and the com port is also already selected as com4 okay so we have connected all this yes and now copy our code esp32 aws iot button touch sensor dot i io in your id e and save it okay so now you will have to copy this code in i arduino id so from where you will get this code yes magicians now you are you now you know better than anyone else right so yes i will provide you this code uh so do ask me about this code uh in my facebook group or ask me in personal window my whatsapp window or you can ask in the comments of this i have given my whatsapp number in the description of this video i will provide you this code so that you can easily execute this project on your own so you will copy this code and in arduino and we'll save it okay so let me pull out the code for you so i have opened the code this is the code that we need and we have saved the code in our arduino sketch directory i have saved it so okay this step is also done now click on sketch and so sketch folder so okay then it will take you inside the current sketch folder so you will go here to the sketch and click on sketch show sketch folder i will click on this so as soon as you will click this it will take you inside the folder where your current sketch this sketch is residing so inside this ui it will take you then what do we do here once you are inside your current sketch folder put the file secrets dot h there so you have to paste secrets secrets.h file remember the file which we had created from our previous session and i already have it so you can put a file inside uh sorry inside let me just close the necessary one so this is our uh this is our current uh code which we are working so you have to paste your secrets dot h file over here let me quickly show you what the secrets dot h has again this secrets dot h will have a thing name your wi-fi sids your aws iot end points your certificate the root certificate root ca certificate sorry your device certificate and your private key certificate your private key so all these things will be there in your secrets dot edge so now make sure that you have now secrets dot h inside the same folder where your current sketch is okay so make sure and once you have done this now make sure that you have our below library inside your sketch folders libraries since our this bro if you will look at this program our i know code you are seeing that it uses these two header files mqtt client.h and arduino json.h right so all these two libraries you need to install you need to have with you and we had already done this in our early last session and so i believe you already have these libraries along with you if you do not have it get it from me i'll give you these libraries and you have to put these libraries inside your current uh inside your sketch library folder so this is my libraries folder of sketch my sketch folders so here you should have these two arduino json and mqtt so these two folders you should have with you and because this mqtt client.h library is inside this mqtt so you are seeing this mqtt source so here you will see empty decline dot h similarly your arduino json.h will be inside your arduino json uh source folder so this is our library is also there so our library is also in place uh you need to make sure that you have pillow library inside your sketch folders yes we do have okay so now um we are good to go to execute this project so what do we do i will simply first connect to my touch sensor and i will give the connection i am just trying to put the signal pin to the d4 to the gpio pin four i have connected now my that sensor to the esp32 so now we will uh upload this code to our esp32 so for that you will go here and you will simply upload it so it will start uploading it is compiling the sketch so once it will start uploading i need to press this boot button as we have as i have mentioned in this document also you have to hold this boot button and when the uploading starts you can release the boot button okay so still it is compiling this code make sure that you do not change any other parameters which i have used here for publishing topic and subscribing topic all these things the only changes you have to done you have to do in this case is only in secrets.h secrets.h5 okay because this sequence.h has every uh every variable user defined variable which you can which you have to modify and there is no need to modify any variable you don't need to declare any other thing over here make sure that you have used gpio touch pin for for touch sensor still it is compiling it is taking a longer longer time to compile this sketch here you are seeing the progress yes it has started now i can easily press the hold button the boot button yes it started uploading i can release now so once it started uploading the sketch i can release the button and now i can see it has successfully uploaded so now you can open the serial monitor so as you will open the serial monitor in your serial monitor you will just press the enable button to restart the execution so i will just press one more time here okay so it is trying to connect to aws iot it has already connected and uh it is it has subscribed to this topic also and now status is okay for that aws iot connected so it has connected to my aws iot so now we are ready to touch our sensor and see how does it behave in our aws iot so okay i will go here and i will try to test uh the publish message so when we will click on this and this is the place where we do the testing mqtt test so here it you have to subscribe on the topic where on the same topic on which our esp is publishing so remember our ehp our esp is publishing on the topic this so i will subscribe on this topic here and subscribing and you are seeing that now it is subscribing uh subscribing over here and this is our com port so now let me try to simply and let's let's open our console cloud watch also so you will go here and you can you can see your cloud watch so you can see your logs when you will go to your cloud watch dashboard under logs you can see log group so here you will see that the log group corresponding to your lambda function so you can click on this or whatever log group you have currently i have this lock group so you will go here and first let's try to delete all the log groups we select everything and delete it so that we can see the fresh log groups here okay so our log group is also empty now so you are seeing there is no logs here in our cloud watch and there is nothing message coming in our uh iot core mqtt test okay so now what we'll do i will simply try to touch this uh sensor and see what happens so if as soon as you will touch it you will see it has identified the touch and it has published a message with payload action pressed so as soon as this action is performed you are seeing the same has been received in our iot core here now this message has been received at this uh iot core and if you will go to your logs so this is our cloud log still you are not seeing any data here you just need to refresh it because it will not automatically refresh it so you just need to click the refresh button here so i am clicking the refresh button you are seeing that log new log stream has been generated so you will click this new log stream to see the details of the logs so here you you are seeing that the action pressed has been locked and you can see the time also here if you will click on this to expand this you can see the time is 143 and it has logged message as action pressed so this is the event which was coming this was a message which was coming from our esp32 and our iot rule engine diverted at the same time iot rule engine uh called our aws lambda function because we have written such condition on the rule so that it will call our lambda function and that lambda function is simply printing the incoming message in the log so this is how this whole iot services are working all together so let's try to do one more time this is our iot core you are seeing and this is our com port so let me try to do one more time touch so i am just touching it so you are seeing as soon as i touch here it publishes a message so if you will see the time now here so now you have received at 144 so the earlier message you had received on 142 now this message i have received at 144 here i have received the message called action pressed and you will see you will go to the cloud watch so let me go to the stream you can just directly refresh it because you are not seeing the refresh data here you are just seeing 143 latest data here after that you are not seeing any of the data so let me refresh it so when you will refresh it you will see that one more data has been logged here at 144 saying action pressed okay so this means our the entire integration is working properly and our iot button is successfully integrated to our aws iot services so that's all magicians so this is how we integrate our things or our integrate our sensors integrate our buttons to our iot aws iot clouds so in this session we covered the the sensor we covered our iot thing we covered iot rule engine we covered the lambda function and we covered cloud watch log as well so these are the things that we covered and hope uh you enjoyed the session and you got something new in this session please try to implement it and if you face any issues if you need any help just do let me know i will be there for for your help all the times my number is already there in the description of this video and uh call me uh or whatsapp me for for any help or need okay magician so do subscribe my channel and do share it with your friends and family so that they also get benefited from this so far i have this much uh for you in this session okay we'll meet in another session with something new i'll definitely come up with some new uh topics and some new concepts for you till then take care of yourself bye bye magicians let me stop sharing now and i will close the meetings goodbye magicians have a nice time arigat
Info
Channel: IMH Videos
Views: 350
Rating: undefined out of 5
Keywords: IOT, Raspberry Pi, IOT Course, Online IOT projects, Online IOT session, Amazon AWS IOT, MQTT IOT, Wireless IOT, XBEE, Home Automation, Learn IOT Online, firebase, Realtime database, ESP, ESP8266, ESP32, Micropython, IoT Core, Webserver, ESP Webserver, Telegram, BOT, Telegram Bot, Amazon Voice Service, Smart Home Skill, Amazon Alexa, SPIFFS, ESP Filesystem, ESP FileSystem Uploader, ESP32FS, Interrupts, PIR Sensor Motion, PIR, ESP NOW, ESP 2 Way communication, CloudWatch, IoT Rule Engine
Id: bO0UfImnjwE
Channel Id: undefined
Length: 52min 52sec (3172 seconds)
Published: Fri Jul 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.