ESP32 | 2-Way Communication | ESP-NOW | #ElecrowMaker

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello iot magicians uh i hope you are able to see my screen am and i am live on youtube let me quickly first check if i am live on youtube yes i am live on youtube now so i can start the session for the day today so okay magicians again welcome to internet of things and i am edge uh hub where we all are meeting and uh understanding learning beautiful things in iot and trying to become an iodination so as i promised you in my earlier video that i'll be coming with esp32 or esp8266 or simply esp the two-way communication between these two devices so this is just a demo that what we are going to learn today what we are going to see today so here i have two esp boards that you are seeing here this is esp32 along with the button over here and a green led you are seeing in this and i have another esp this this side i have esp esp8266 along with one potentiometer and the red led so today's session will be to demonstrate how can we establish a two-way communication between two different esps they can be either the same esps or they can have different esps as well as i am having in this section right this is esp32 this side uh and this side i have esp8266 so first just let me quickly show you how this will work so whenever you press button on this side i will i will see that a red led will be going on the other side of this of the esp let me try to do that so when i click this you are seeing as soon as i press the button i am seeing led glowing on the other side of the esp means this esp is able to communicate with the other side of the esp now let me try to rotate the potentiometer at the other end and let's see if i am able to see the brightness changing on the green led on the other side so i will try to rotate the pot let me do that so i am trying to rotate the pot slowly so you are seeing that brightness is slowly getting increased and now when i make it to the max and you can see the green led here it is blinking with the maximum brightness so let me make it again slow lower brightness so slowly i am rotating part on the other direction and i see that green led is slowly now growing with the less brightness now and finally i can make it to the zero brightness so okay so here also i'm seeing that this esp is able to talk to the other esp okay so we'll see how we can establish this two-way communication between two different esps okay so let me quickly switch on the lights of my room and let me share my screen with you so that you can see my document what i have for you for the session today okay so here i have uh a nine pages document for you esp two-way communication esp now so hope uh this session will be useful for all of you and you will you will be in this session till the end and enjoy coffee with me okay i am having a very nice black coffee and i want you also to have a black cup cup of coffee and let's start with me okay so today's aim will be on pressing the push button on esp32 at this site like you are seeing i am having a usb 32 and i have a button on pressing the button on esp32 it should glow the red led on the other side on esp8266 similarly on rotating the potentiometer as you are seeing here on esp8266 it changes the brightness of the green led on esp32 so this way we can see that they all are they both are having a two-way communication okay if you need this document as i already always mention if you need the document and all the quotes that i have mentioned in this document if you need all these just ask me ask me in the comments window or you can directly ask me in my facebook group or in my whatsapp my number is already there in the description of this video please do contact me i will provide you this complete document along with the code and i also help you developing this project if you are unable to do that also magicians one good news for you that i want to share that i already i already have started taking online sessions on iot also so for those who are really new and want to learn iot or if you are if you already have some knowledge of iot and you want to enhance your knowledge or if you are already a professional but you want to go to other level then also i can provide you the live sessions so where you will directly get my personal uh coaching from me every day for an hour over the june call so if you are interested joining me and want to get iron knowledge from me then definitely uh go ahead and try to contact me on my whatsapp so that we can start okay magician so enough for the talking so let's get started so uh the technique that we are going to use for two-way communication between two sps is called esp now so what is esp now and how this esp now can be implemented in esp this is what we are going to see today and we are going to develop this project so what is esp now i'll be just walk you through with my document where i have given all the steps and with all the screenshots which will be helpful for you to understand each and every step and take the necessary action and it will be very easy for you to implement as well okay so espn now enables us to exchange data between esp boards programs with arduino ide wow cool esp now is a connectionless communication protocol developed by espressif that features short packet transmission so espresso if has already come up with some solution where we can establish a two-way communication between two esps so thanks to espressif for this beautiful message transfer technique this protocol enables multiple devices to talk to each other in an easy way so as you are seeing here i have shown you so one esp is talking to another esp so here you are seeing this is a one-way communication happening and for uh if you talk if you see these two esps here i am having two-way communication here again i am having one-way communication so it's possible whatever way communication that you want to establish between several esps and then you you can make a mesh also a network also where all the esps can talk to each other and you can fully control this whole mesh network okay so from the expressive website which i saw there so i found it like esp now is yet another protocol developed by espressif which enables multiple devices to communicate with one another without using wi-fi the protocol is similar to the low power 2.4 gigahertz wireless connectivity that is often deployed in the wireless mouses so as we had seen in our earlier sessions where we had developed a communication between 2.4 gigahertz wireless devices using our ir devices or using our rf modules so the pairing between devices is needed prior to their communication in this case after the pairing is done the communication is secure and peer-to-peer peer-to-peer with no handshake being required so before making any connection between these esps first we need to pair uh these two esps in between so once the pairing is done then they can easily share information this means that after pairing a device with each other the connection is persistent in other words if suddenly one of the boards loses power or resets but when it restarts it will again automatically connect to its sphere so wow this is another a very interesting feature uh that they if both these esps have been already connected and they are already they already know each other then if one of the esps loses power or if it resets but when it will come again to the network it will automatically join the network and again it will start the communication usb now is a fast connection less communication technology featuring short packet trans transmission so using this technology we can send some short packages like your sensor data or or any kind of information i have shown in details like how long uh the package size can be when we want to send data esp now is ideal for smart lights remote control devices sensors and other applications esp now it already applies it standards and along with the wpr so this is just for your information what are the features of esp now let's let's quickly see what are the features that if they provide esp now supports the following features encrypted and unencrypted unicast communication you can have encrypted communication as well as unencrypted communication mixed and encrypted and encrypted peer devices you can have a mix of all the devices you can have up to 250 byte payload can be carried so uh so this is the data packet limit that you can send 250 up to 250 bytes of payload that you can transfer using this communication and the sending callback function that can be said to inform the application layer of trust instruction successful failure so whenever you are developing a code behind this so that at the time you can set up different callbacks where you can send information back to your application layer for success or failure uh no failure statuses that is also quite easy to set up the callbacks so we will see these callbacks when we develop the code how will we provide these callbacks to the application layer now espn now technology also has the following limitations so these are the benefits or these are the things that it supports it has some limitation let's see this limitation broadcast is not supported so this is the very first limitation that broadcasting is not uh supported they have limited encrypted peers and payload is limited to 250 bytes as i told you you cannot send more than 250 bytes of data when you are doing uh communication esp communication in simple words esp now is fast communication protocol that can be used to exchange a small messages between esp boots but 250 bytes are in the force to send some secure message if you want to send some messages or some sensor data or or any communication that you want to establish between different esps so this esp now protocol really works [Music] nicely esp now is very versatile you can have one way or you can have two-way communication in different setups it is quite possible that you can establish only one-way communication where only one esp can send to other esp but this esp cannot send back something some information to this esp so in this case we will be having only one way communication but you can establish two-way communication also so let's quickly see what are these one-way and two-way communication and then once we understand that understand uh the scenarios and understand how esp now providing us this beautiful features for one way and two-way communication then we can directly jump to our two-way communication uh project and we can develop that okay let's see let's quickly see what is esp now one-way communication and how does this work in this case one esp board is sending data to another esp board so this is our first esp board which is sending data to another esp board so this is the simplest scenario for one way communication this configuration is very easy to implement and now it is great to send data from one board to another like your sensor reading on off commands to control gpio so such kind of information such kind of data if you want to send from one esp to another in that case you can use this configuration this can be further expanded as a master esp sending data to multiple esp slaves so in this case the sender device i can call i'm just calling this sender as a master and the receiver as a slave so you can extend this one-way communication to uh single master to multiple slaves as you can see here in this diagram which i've shown here so this is the single master we sending uh data to its multiple slaves so this is one of the esp this is another esp this is another esp this is another so i have four different slaves and one master sending data so in this case i am just having a one-way communication so this is very good with a very good uh like uh design or architecture where you want to send uh a single data to your multiple receivers in the above case you are seeing one esp board is sending the same it can send the same data or it can send different commands to different esp board so it's not necessary that uh this master suit should send the same data to all the four slaves it can send same data or as well as it can send different data this configuration is ideal to build something like a remote control you can have several esp boards around the house that can be controlled by one esp main board so this is the use case where you can use this this kind of configuration so now another kind of configuration could be you can have one master you can have multiple masters so you are seeing in this case the so simply master means the one who i am referring master means the one who is sending the data and receiver or the slave i am referring slaves as other receivers so in this case you are seeing i have four masters now so this one this is the one esp this is another esp so like that i have four esps here those who are sending data to one single slave so i have four masters here and one slave here but again in this case i am having only one way communication so here this kind of configuration is also possible where i have one esp slave which is receiving data from multiple masters so where this scenario can be used what could be the uh use case for that let's see the above configuration is ideal if you want to collect data from several sensor nodes into one esp32 suppose you have four esp nodes those are having different sensor data and you want to collect all those sensor data from all the esps at a single place so in that kind of scenario you can configure this kind of uh esp mesh this can be configured as a web server to display data from other ports okay so now let's talk about esp two-way communication so now i think one-way communication is pretty much straightforward and there is no confusion there is no doubt but how do we implement it through code that's a separate thing we'll cover it later on but now just focus on how do we do two-way communication and let's understand the two-way communication how it is done vdsp now each port can be sender and a receiver at the same time of course if i am having a two-way communication each board so this is one of the esp this could be a this will be a sender as well as the receiver similarly the other board also it will be a sender and the receiver so at the same time esp board will be a master as well as a slave so we have to configure it in the same way so that it can act both like a master and a slave you can establish two-way communication between two boards you like this you are seeing in this so you can add more boards to this configuration so let let me make it little bit more uh meshy where i can have more esps and i can have two-way communication and i can make a mess something like this wow so you can understand with this uh configuration easily that i have uh four different esps they are talking to each other you are and you are seeing all the communication is a two-way communication like this you have a communication between these two esp's similarly you have a communication between these two esp's you have cross communication between the first and the third esp's diagonally like this so this if you configure your esps in this way then you can have a two-way communication between all the esp's connected to the same network in summary esp now is ideal to build a network in which you can have several esp32 boards exchanging data with each other great for us thank you esp now so you can have different esp so here it's not necessary that all the board should be esp of the same kind like esp all the all the modules should not be esp8266 or esp32 you can have a combination of that you can have esp32 along with esp8266 no no such kind of restrictions okay cool so so far we have understood what is one way communication what is two-way communication and how esp now enables us to talk to uh talk between to establish a talk between two different esp's now let's try to understand how actually this is done in our coding but before that esp getting bored mac addresses so to communicate via esp now you need to know the mac addresses of esp receiver so if you are going to establish communication between two esps then definitely you should know what is the mac address of the other esp in advance so for so before writing your code before writing the project you must know the mac address of both the esps if you are going to make a two-way communication but if you are going to make just only one-way communication if you want to if you are going for that project in that case you just need to know the uh mac address of the receiver but in this project we have uh the esp itself is a sender as well as receiver right so we need to know the mac address of both the esp's in this case so how do we get the mac address of esp32 and how do we get the mac address of esp8266 let's see each esp has a unique mac address and that's how we identify each board to send data to right so if this esp want to send data to some other esp then it already it it should know to which esp i need to send the data so in order to identify the correct esp the csp must know the mac address of the receiver correct yes so you can use the below code to get the mac address of esp8266 and esp32 so this is the simple code to uh to get the mac address of esp32 and this is the code to get the mac address of esp8266 okay so let's let's see something in action let me open my arduino ide and let's try to first let me open a blank sketch okay so this is the blank sketch and i will just copy this code in order to get the mac address of my esp32 i will copy this code and i will paste it so remember that this is the code to get mac address of esp32 so from here you will connect your board so i will go here so i have already connected to the board my board is already connected and so yeah remember when when you have multiple esps with you and you have connected both of these esp to your laptop then you should need to know the com port of both the esps right so if you will go to device manager i'll just go here to the device manager to identify to to know the board of my esp32 so here you are seeing under port you have two com ports here com port 10 and com port 4 but i already have connected these two that's why but i cannot distinguish which one is for what which which com port is for what right so i don't know whether com port 4 com 4 is for this esp or this is esp right so what i will do i will simply unplug one of the esps and then i can see which one remains here and report so whatever is remaining here that will be my com port for that esp so let me take out esp8266 so this is esp8266 i'm taking this out so i have taken out esp82 double six usb from my laptop and i am here with esp32 connected to the laptop and i am seeing my com port is 4 so for esp32 the compute is 4 and for esp8266 i will connect back so i am just connecting it back so i have connected back to esp8266 and i have got the com port s10 okay so esp8266 is com 10 and esp32 is com4 okay that's okay so uh i will execute i will transfer this code inside esp32 to get the mac address of that so from here i will select the com port as four and board has esp32 already i am having sp 32 selected here so i can simply upload it but as you know before uploading i need to save it let me say this by the name of test one so i will save as test1 and now the sketch is being compiled and soon it will try to upload this sketch to my esp32 board and as you know i need to press the boot button when it will try to upload the code in my esp board otherwise it will get stuck and it will ask for me to press the boot button so it is again compiling the sketch to get the mac address this is the mac address sketch so still it's compiling it will just take a couple of seconds to compile let's just wait uh for this so yes it compilation is done i'll just press the boot button now so that it has connected and it's trying to writing data to the esp32 board and once then uh yes done uploading my code has been uploaded to esp32 now so i can run this code you will go to the serial monitor here i just open the serial monitor and i'll press the reset button here so when i press the reset button here i am seeing the mac address of my esp32 so this is how you get the mac address of your esp32 so i will just copy this and i will keep it with me because i will be required this mac address of esp32 so i'll just write it here esp32 so i got the mac address of esp32 i can close this and and now similarly if you want to get the mac address of your esp8266 so you have to use this code i will copy this code so i will copy this code and i will simply paste the code here but this time i have to select my esp8266 board so from here i will go and i will select my board esp8266 so this is my board and i will select the port also so the port is com10 remember to select the correct port for your board otherwise your data transfer or data upload will not happen properly so i have selected esp8266 board properly here you are seeing and i am already connected to the com10 port which was the port for my esp8266 okay so now i will just save this script and i will upload this script to my esp8266 board so now again the sketch is getting compiled so once compilation is done again i have to press the boot button of my esp8266 when it will try to connect and try to upload it to my esp3826 board and it's taking time let's let's see couple of more seconds it will take to compile the sketch and then it will ask me to hold the boot button okay so it's compiling so this is this sketch will give me the mac address of our esp8 esp8266 port that we will also note it down because that will be requiring in our main project main code where we will establish a two-way communication between esp32 and esp8266 so now almost done so i need to press the boot button so yes writing is started i release the boot button so now it has already written 53 percent so it's almost done yes 92 percent over 100 percent over so now uh the code to this to get the mac address of esp8266 is already now uploaded in the board so let me open the serial monitor and i will press the reset button so here is the reset button i will just press the reset button so when you get press the reset button so here you will get the mac address of your esp32 i will esp8266 sorry i will note it down and i will just keep it here esp8266 so this is the mac address of esp8266 okay so once you have noted down you can close this and you can simply close your arduino also so this is how we get the mac addresses so for esp32 and esp8266 respectively so now enough of the theories i hope you have enough information about esp now let's go for our project yes i think you are excited now to go for the main project where we establish at the two-way communication between our esps awesome so for this project we have two different esps yes we know one is esp32 and that is esp8266 yes this is esp32 this is esp8266 but this can be achieved using the same esps as well as i already informed we would set up both the esps to perform below task so this is our aim esp32 means this board it will be connected to a push button yes you are seeing a push button and the green led yes and the green led so this esp32 is having a one push button and one green led the esp8266 the second esp will be connected with the potentiometer yes this is the second esp which is connected to a potentiometer and the red led and the red led on pressing push button on esp32 when you push this button red led should glow in esp8266 so when you push this button this red led should glow on the esp82 82 double six yes and on rotating potentiometer in esp8266 so when you will rotate the potentiometer at this side the green led should be brightening or dimming at the other side so this green id should be changing or should be dimming or writing as we rotate our potentiometer so this is what we are going to establish here so for that we will use the below connection scheme so this these are the connection schemes left left portion is for esp32 and the right portion is for esp8266 the connection scheme is pretty straightforward there is nothing much there is no uh nothing much difficulty uh to connect this hope you all should be able to make this connections and i have given you uh the fridging diagram also for that so let's quickly just see what we have to do now for esp32 let's talk about esp32 site so i will just give an explanation on the fridging directly so that you can make the physical connection on your own okay so the green led will be connected to gpio23 so here you are seeing this is our green led correct so this green led will be connected to our gpio20 so this is the gpio23 the the yellow wire so this green led is connected through the register this is the 220 ohm register so this green led is uh connected through this register to our gpio23 using this yellow wire that's okay correct and then the second leg of led is directly connected to the ground you are seeing the negative of this green led is connected to the ground ah the first leg of button will be connected to 3.3 volt you are seeing this is our button right so here this is the first first leg the first leg will be connected to the 3.3 volt and the second leg will be connected to gpio4 so you are seeing this green this green wire the second leg is connected to the gpio 4 so this is gpio4 pin so this green uh wire is connected to the gpio four okay again the second leg of button so again the same second leg it is connected to first leg of register so we have another register here 220 ohm register so the second leg of button is again connected to the first leg of the register and the second leg of register will be connected to the ground and you are seeing the second leg of register is connected to the ground so this is the simple uh connection between esp 32 our button and the green led similarly we have very uh simple connection for esp8266 also so here the red led is connected to gpio 14. so this is our red led the positive of red led is connected to gpio 14 so this is the gpio 14 in esp8266 so you are seeing this yellow wire which is connected to the positive of our led through this register and the negative leg is connected to the ground the potentiometer middle pin is connected to a0 so if you are seeing the middle pin of this potentiometer it is connected to the a0 pin of our esp8266 so this spin is a zero pin that's this a0 pin this blue color you are seeing wire is connected to the middle of our potentiometer right and one of the one of the lag of our potentiometer will be connected to the ground and the other leg will be connected to the 3.3 volt of esp a206 so this is the simple basic diagram basic connection scheme that we are going to use in our this project okay cool and this is our physical diagram so this is how our uh esp's both the esps and the button and the green led this side and potentiometer and the red led on esp8266 on this side so this is how our connection looks like so once all your connections are done let's follow the below steps to execute this project same magician so i think now you are you may be excited once you have done the connection so now it's the time to execute this project yes magicians let's go ahead so let's do connect esp32 with your laptop and identify its com port as i have already shown you like once you connect you are both the esps you need to identify the com port for each board so for me for esp32 is com you saw it was com4 and for esp8266 it was com 10 for me so at the time of writing this notes i was having com 8 but this time now i am getting com10 so okay so this esp8266 is having com 10 let me show you again so if you go here to the device manager so under device manager you will go inside port so here you can see these two ports this and this so you are seeing this com4 is esp32 for esp32 and com10 is for esp8266 you can close this okay so what do we have to do now open arduino ide so you have to just follow all this step one by one so whatever is mentioned in the steps just follow those steps in order to execute this project successfully so first open arduino ide okay let me open arduino ide from there you have to select board as esp32 dev and port as com4 okay so i'll go and i will open arduino ide once you open arduino ide from there you will select the board as esp32 as i mentioned in the document esp32 dev module this is my board and my port is com4 okay so i have done that the first step is done the third step means this step is done i have selected the board as esp32 and port as com4 is done next i have to open another arduino ide so one idea is already open i have to open another id don't try and don't go here file and don't try to open a new one from here okay i am asking you to open a new instance of our arduino ide so you just minimize it you need to go here and again open another instance means like you have to click again here and then you have to open another instance of your arduino ide so i have opened it so what do we do now so open another ide i have done then here you will select the board as esp8266 and your esp8266 port okay so i will go here and i will select the board as esp8266 so this is the generic board for me esp8266 and the port the port is com10 so i from here i will select the com 10 as the port okay cool so if you are seeing here i i have now two arduinos open one is this this is for esp32 and another one this this is for esp8266 so why we are opening two different instances because we have to write two different programs to two different esps if you will open only one ide so in that case you cannot you will not be able to write a program simultaneously at the same time to different esp so to enable it to enable this feature i have to open two different ides i will write one program on one ide i will transfer the program to esp32 and in another window i will write a program for esp8266 and i will upload it to the esp8266 okay so now you have these two ideas with you fine now what you have to you have to copy this code so i have the this code esp32 tx rx using espnow.ino so this is the i know sketch that you have to copy you from where you will get this code yes you got it you are right magicians so i will provide you this code okay so do ask me about this code i will give you this code so my number my phone number my whatsapp number is already there mentioned in the description of this video or you can ask me from my facebook group or you can ask me you can whatsapp me you can directly ask in the comments of this video so wherever comfortable just ask me about the ino code for this i will provide you the iono code so in this you will be having two i know ports one for esp32 and one for esp8266 so these are the two ios that you may be requiring okay so once you get this codes from me then you have to copy this code and you have to paste it on the esp32 ide so remember the first arduino ide this one it is for our esp32 so here you will copy our code for esp32 and the code which i have given you this is the code you will simply copy so i will give you this code you can copy and you can use this code okay so this is the code so you will just copy and paste the code fine so this step is done and then you have to copy for the another window let me close this okay so uh in another window you will copy esp8266 tx rx using espno.ino on esp8266 ide so in another id your esp 32 id esp8266 ide so this is my esp8266 ide so here you will copy the code esp826 tx rx using esp now dot ion so here i have the file let me open it i am just opening it file this file so this is the file yes so you will just paste the file here okay so now you will see you will be having two different uh arduino ides in one of the ide you have already pasted the esp32 code and in another ide you have pasted the code for esp8266 okay and remember you have selected the correct board you have selected the corresponding com port for that board okay so once you have done that once you have copied the copied the code let's see the first esp32 code so here you have to replace the address of your uh here you have to give the address of the receiver okay so this is the esp32 so for this esp32 who is the receiver yes esp8266 so here you will have to give the mac address of esp8266 so if you will go here which you had copied earlier remember so this was the mac address of the esp8266 you will simply copy this here similarly in another code so if you will open the code of esp8266 so what who is the receiver for a2 6 yes esp32 so in this case here and the mac address in the in place of mac address you will be providing the mac address of your esp32 so you are seeing this is the mac address of esp32 so i have provided this esp32 mac address in this program okay so i think so far so good there should not be any confusion there should not be any issues so if you still you have any confusion any issues implementing this just to let me know i will definitely help you and um i actually i have given all the comments and i have given all the hints also in the program so that it will be easier for you to follow those hints and uh the comments so okay once you have done that now now we are ready with the code right so this is the esp32 code which i will upload into my esp32 board right and the other one esp8266 code this code i will transfer to esp8266 board so this is what i have to do now so okay let's do it one by one that you are seeing here in our document now i will hold an uh hold the boot button of esp32 and click upload button once upload started i will release the button so this is the process how will i upload the code in esp32 and the same i will do for esp8266 okay let's do that first let me open esp32 code remember that this should be connected to my esp32 board and the com port should be the com port of esp32 so in my case it is com4 so once you have identified all those things are correct i will simply upload it so i will click on the upload button here so now my com my sketch is getting compiled so compilation is in progress so when it will try to connect to my esp board and try to upload it that time i will press the boot button so that it will start uploading the code in esp32 board so still is in the compiling status it's compiling and soon it will try to correct so now it is asking me to press the boot button because it is trying to connect to the esp32 yes it has already started now i can release the wood button this is how we uh use the boot button when if you are not able to flash the code inside your esp32 so this is the way you should do it so once it is done you are seeing done uploading so the code has been uploaded in esp32 okay now i will go to the another esp8266 ide so you are seeing this is my esp8266 and uh make sure that you have connected to the correct board and the port is also correct so for me the board is a26 and the port is com10 i am already connected and now i can easily upload it so i am just clicking the upload button so now the sketch is getting compiled and soon when it will ask us to upload or ask us to connect the boot button i will press the boot button when it will try to connect uh to my board still it is compiling so when it will try to connect to the board that time i will push the boot button so okay it is connecting so i have released the boot button now so i are seeing that now it is the ide is writing the code in esp8266 so i think uh written code is done uploading so the code of esp8266 is also written into this so now we are ready to implement it we have already uh [Music] already uploaded the code in esp32 also we have uploaded the code in esp8266 now it's the time to test it let's go back to the document and let's see what else is there in the document okay that's all we are ready to see the magic happening here open the serial monitor from both the ids and press reset enable pins on esp 8 32 and 8 2 6 okay so let's what we'll do now so first of all uh you need to open the serial monitor so that we can see how the serial monitors are showing the data okay so this is the esp32 uh screen so i when you will go serial monitor here so you will see com4 ceiling monitor is here so this is for com4 similarly if you will open the serial monitor of your other esp you will get com10 so okay let me minimize everything for you so this is com4 and this is com10 so i will keep both of these two side by side okay so remember com4 is esp32 remember and com10 is esp8266 so now i can test it and i can see how does this behave so first of all let me quickly switch off lights of my room okay so i have switched off the lights of my room and i will start pressing the button so first let me start press this button on esp32 side and let's see what results i get on the serial monitor and what i see in the red led okay so i'll press this button so as you see as soon as i press this button uh content content is esp8266 right so content has received one and as soon as i receive as soon as i move or remove the button press it received zero and a com4 com4 is esp32 who was sending data right so as soon as you press the button it sends one and as soon as you release the button it sends zero so let's do it one more time so when i press this it sends one when i release it sends 0 when i when i press it is sending 1 and when i release it sends 0 i am pressing sending 1 releasing sending zero so we are seeing uh conf at the com 4 window you are seeing i am sending one and on the content which is esp8266 there i am seeing i have received one so when i am releasing the push button con4 is showing it is sending zero and com10 is showing receiving zero so this way i can see that communication is happening between both the esps right so let's do it one more time pressing it is sending one releasing sending zero and this is receiving zero okay so this was about the push button so what about the potentiometer let's see what happens when i rotate the potentiometer so it will in this case i this will be the sender esp8266 will be the sender so it will send the potentiometer value to esp32 at the time esp32 should report that i have received this value of potentiometer and according to that value it will glow the led okay so let's see how it works first so i am just quickly rotating the potentiometer slowly so i have just slowly rotated the potentiometer so in content means esp8266 that you are seeing it sent a value 12 and the same value you are seeing is received by com4 com4 means esp32 and you are seeing that the value 12 is received at uh the esp32 side and you can see very low glowing of our green led you can't even see that because it's very low brightness very less brightness like let me now try to send it little bit more brightness value so as you are seeing here as soon as i am rotating the pot uh the in the com10 under content you are seeing that it is sending different values and at the same time on the com 4 means esp32 side you are seeing the same value has been received at the same time and the green led is also glowing with the same brightness value which is coming from esp8266 let me try to rotate it more time so i am rotating it you are seeing i am rotating it more so you are seeing that value is increasing at the both side the sending and the receiving so this is the maximum value which i am sending from esp8266 and you can see that easily com4 and com10 are easily sinking and easily talking to each other whatever value i am sending from content the same has been received at the com4 let me try to reduce the values now so i will reduce the values you are seeing now the packet that is sent from content same has been received at the site com4 and the brightness of the led also is slowing down as you are seeing now ultimately i am making it very less is the value seven and you are seeing my led is almost not glowing at the side right so let's do it one one more time i will press the push button and you are seeing that it has been received by com10 which is eight two double six i will release it and you are seeing that the value 0 which was sent from esp32 received successfully at the esp8266 end so okay magicians so hope you understood this concept and you got this session useful for you again if you need the document if you need the code behind it what i have i have done to implement it ask me about these ino quotes i will provide you both of the codes join my facebook group and please subscribe the youtube channel where i will provide you all the help for free i i provide so many things and also as i have mentioned i have started my uh own iot online classes just for you where i will give you my personal time my personal mentorship so that you can develop your project under my mentorship directly every hour every one hour uh every day one hour for one hour and yeah over the june call you will be getting my full support so if you want to join my iot session or my iot guide guidelines guidance so that just contact me at the same whatsapp number is given in the description of this video and you can get that get in touch with me and ask me for this document ask me for the i know quotes and try to develop this and understand this uh project okay magician so here after that what else is there in this document let me just quickly show you yeah so here i'm just showing you the results and the outcomes that we are that we have received from and we have seen directly live here okay magicians thank you thank you so much thank you for joining this session and i hope it was useful for me and useful for you also definitely it was helpful for me and uh have a nice time take care of yourself let me just stop sharing and let me close the meeting thank you magicians bye bye take care yourself
Info
Channel: IMH Videos
Views: 14,610
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
Id: NVeHdD4oh58
Channel Id: undefined
Length: 53min 33sec (3213 seconds)
Published: Tue Jul 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.