Using RainMaker with Arduino IDE in ESP32 | More Features than Blynk & Arduino IoT Cloud for FREE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
In this video, we'll be learning  about a new IoT platform that has   some amazing features as compared to Blynk  and Arduino IoT cloud like 1. Self adapting   mobile applications, 2. Free integration of  Alexa and Google voice assistant, 3. Member   sharing option and one of my favourite 4.  Wi-Fi provisioning and app configuration by   just scanning the QR code and you'll be  getting everything for absolutely FREE.  Yes that's the ESP RainMaker for you and this  is the basic getting started video with ESP   RaiMaker using Arduino IDE in which we'll  be making a project of controlling bulb and   monitoring sensors data on ESP RainMaker app in  real-time over internet so before starting this   video if you're new to this channel consider  subscribing this channel as we come up with   this amazing projects in the field of IOT,  Home automation and Electronics every week   and that being said let's start with this video. [Sponsorship] Do you know what most electronic   companies have something in common well it's the  tool that they use for making their products and   the most commonly used tool that almost  all the big electronic companies uses is   the Altium PCB designer software using Altium you  can definitely level up your PCB designing skills   and make something really professional out of it  and now along with the integration of Octopart   searching for any electronic components globally  becomes really very easy Octopart is kind of   google for just electronic components where  you can search for any electronic parts and   get that information all on one single web page  so do check out this amazing search engine made   just for electronic components i'll leave the link  for this down in the description do check it out. Okay so going back to the video so ESP RainMaker  is developed by ESPRESSIF System and it is only   supported for ESPRESSIF chipsets only just like  ESP32 and ESP32 series okay and now the good part   of ESP RainMaker, is we don't need to configure  anything inside the application side as i said   before it has a self-adapting mobile application  that means anything we write inside the code   will be automatically adapted by the mobile  application so no more mobile app configuration   everything need to be done inside the code parts  so now let's jump on to Arduino IDE and let's see   what kind of configurations we need to do to code  for ESP RainMaker so here's my Arduino IDE and   here you first need to install the ESP32 second  version of boards packages of which you can do   by going into the preferences and pasting out  this link. Okay so this is another link or this   is a separate link so earlier we are using the  ESP32 boards packages version 1 well this is the   version 2 and in this version 2 you'll be getting  the ESP RainMaker support. Okay so space this link   inside the on this preferences i'll leave the link  down in the description of this video after that   click on ok click on ok once again go into the  tools into the boards and then into the boards   manager here just type out ESP32 and as you can  see the version 2.0.3 is already installed in my   system okay so it's the second version of ESP32  boards packages i'll just click on cross button   and after that when you select the ESP32 board  inside the uh board uh packages okay this demo i   have selected right now and after that when you go  to the file section you'll be getting the example   codes for ESP RainMakers as of now we have three  example codes well this can be considered as a   negative point of esprit maker which is we are not  getting enough example codes as compared to what   kind of features we are getting okay so we are  not getting example code for all the widgets uh   to be added inside the RainMaker app so ESPRESSIF  team should work on this and provide the example   codes for using at least every widget uh as a demo  purpose okay so uh we won't be using any of this   example code for this video because uh coding for  the ESP RainMaker is a little bit tricky so what   i did i created my own example code and i have  commented it properly and i'll be explaining you   uh this example could which is to control  the relay and to monitor the temperature and   humidity sensor's data using DHT1 sensor but again  before explaining the code let me explain how the   uh ESP RainMaker architecture is actually okay  so how the things are communicating how the   mobile phone is adapting all the widgets and  everything so let me explain you how ESP RainMaker   actually works and then i'll go through the code  it will be much more easier for you to understand   okay so now here I'll explain how the ESP  RainMaker actually works like how ESP32 is able to   communicate with the cloud how mobile application  is self configurable everything i'll explain here   okay so if you understand this uh writing the  code and understanding the code will be a lot   easier for you just stay attentive here so here  is the ESP32 board uh let's assume that we already   programmed this board uh for the ESP RainMaker  so as soon as we program it it will generate a   QR code okay uh and inside the mobile application  we need to open the ESP RainMaker app now this app   is available for both android and iOS that's a  plus point so you just need to scan this QR code   generated by ESP board using the ESP RainMaker  application and it will automatically start   BLE communication or the bluetooth communication  with uh what you can say the ESP32 board okay   so it will be communicating with the help of  bluetooth and after that we need to provide the   wi-fi credentials from our mobile application  to the esp32 device so we'll be providing the   wi-fi credentials okay so this is called as wi-fi  provisioning as well and as soon as this esp32   gets the wi-fi credentials it will communicate  with the router and ultimately it will be able   to talk with the esp rainmaker cloud okay so this  is how we are providing the wifi credentials and   communicating with the cloud in return our app is  already communicating with the cloud because it   already have the internet connectivity so what  happens is or whatever program we have done inside   the esp32 board like how many relays we have  added how many sensors we have added everything   every data will be the provided to the cloud and  ultimately it will be reflected back into the espd   maker and it will automatically adapt the mobile  application like if we have one relay it will   be providing one switch if we have two sensors it  will be providing two uh widgets that will be for   temperature and one will be for humidity so it  will be automatically adapting according to the   code we have written inside the esp application we  don't need to configure anything inside the mobile   application so that's a very cool feature that's  a unique feature as well which is not at all   available in like blink and arduino okay so that's  an amazing feature so now we can directly uh you   know control the relays and you know monitor  census data using the mobile application this   is how this communication is happening now one  thing we tried to explain in this rainmaker is   uh rainmaker has kind of some keywords that  i need to explain which will be uh helpful   for the coding part okay so in esp rainmaker the  device is termed as a node okay so node can be   our what you can say home automation project node  can be a smart light bulb anything okay so to   name the node here i have named the node as esp32  inside the node we have devices now devices can be   uh a light okay so we can attach a light to the  esp32 board we can attach a sensor to the esp   board we can attach a motor to the esp32 board  so all these three devices are considered under   the devices section so for example i have returned  as light so i have a node esp32 which is a device   called as light inside the devices we have another  thing which is called as parameter now parameter   is kind of what we can say inputs that we give  to the devices or outputs that we get from the   devices for example in case of light we can have  the parameters like power whether it is turned   on or off and we can also have the brightness  in case the light is dimmable so if it is 50   bright uh if it is at 50 brightness or 30  brightness or 100 brightness okay so this   two can be termed as a parameter of the devices  so these three terms are very much uh used quite   often inside the rainmaker app so yeah that's the  thing which i need to discuss so this is how the   whole rain maker uh IoT cloud platform and the  mobile to device communication actually works   now let me show you the actual code that you could  write to make this particular project okay so now   let's try to understand the code for controlling  relay and monitoring temperature numeric data   using rainmaker okay so first of all the necessary  library declaration okay pretty common here i have   used the DHT sensor hence I used DHT.h and  a simple timer.h library because i will be   sending the temperature humidity data after an  interval hence i have used this timer after that   the default variable is set pretty common and here  are the BLE credentials now as i explained earlier   ESP32 uh at first will be communicating with a  smartphone mobile application via BLE and for that   the credentials are this you can change  it according to your need doesn't matter   but let us keep it by default as of now then we  have declared a couple of GPIO pins one is for DHT   and another is for the what we can say relay okay  here is one GPIO reset button which is initialized   at pin 0 now i'll let you know the purpose of this  pin it has a super application but i'll explain at   the end of this code okay straight after that  here we are just declaring the DHT pin and DHT   uh type as DHT11 initializing simple timer pretty  common now here is declaring devices as we have uh   seen earlier we have nodes devices and parameters  out of them we are declining devices first of   all here and the devices are temperature sensor  there are two temperature sensor devices and one   switch device now why two temperature sensor  devices well just above it it says that the   framework provides some standard devices types  like switch light bulb fan temperature sensor etc   so these are the standard devices provided by  the rain maker uh library only if you go to the   official rainmaker website here you can see that  under device section we have these many kind of   default devices like switch light bulb light fan  etc and with each device we get a dedicated icon   or we can say widget which will be reflected into  our rainmaker mobile application so it becomes   more user friendly so if we declare switch type  device it will be showing this icon and similarly   if we declare temperature sensor as a device it  will be showing an icon like this okay and in case   the device type is not available here well you  can create your own custom devices uh into the   other section you can say and that icon will  be something like this okay so here i have used   the switch device type for relay which will be  showing something like this and after that i have   used the temperature sensor device type which will  showing the icon like this for temperature sensor   and another for humidity now as i was not having  any particular humidity data type or device type   i use the same temperature sensor uh device type  only but i just renamed it as humidity now what is   this and this so first of all the temperature  written here is the name of the device which   will be using inside this code and into the  bracket this temperature reveals the name of   the widget that will be shown inside the mobile  application these two are the different thing okay   similar humidity is a device type used in the code  and humidity is the name of the widget shown in   the mobile application similarly relay is sorry  my switch is the name of the device used in the   code for relay and this relay is the name which  will be shown into the mobile application here   we need to provide one more parameter which is  the pin of the relay which is attached at GPIO21   great pretty common after that we have a by  default function called as system provisioning   event now this will be responsible for you know  getting the credentials and connecting it to the   router so we'll be leaving it as it is we won't be  changing anything here there is one more function   called as right call back we will be covering  this just after we cover the loop part of the   code okay let's jump on the setup first of all so  inside setup beginning serial monitor input output   declaration pretty common beginning the DHT sensor  pretty common and now it's the time to declare the   node as i said earlier node devices and parameters  so here we are declining the node with the name as   techies so our ESP32 device will be reflected as  sms inside the mobile application so that name   you to define here you can change it according  to your purpose your choice straight after that   we are adding the devices into node as i said  devices will be under the node so we are adding   three devices to the node called as my node so  my node dot at device temperature my.device unity   and similarly for my switch so this three will be  added inside the node straight after that here we   are declaring the callback function for switch  only now the callback function is responsible   for receiving the data from mobile applications so  as soon as we send any data from mobile app uh the   right callback function will be called and here as  we are using only one single relay i have declared   only one single function for callback okay so what  happens as soon as we press the button onto the   mobile application side the callback function will  be called which will be reflected here and here it   will check from which device we are getting the  data and to be precise which parameter of the   device we need to change okay as i said device  has couple of parameters in it okay so it will   check so if the device name is relay and if the  parameter is powered then it will go inside it   and if it will check if the power is one or high  it will turn on the relay if the power is low it   will turn off the relay so that's the devices and  their parameters okay to check what parameters are   available in different different switch types  or device types you can check out here so for   switch device type we have two parameters name and  power similarly for temperature sensor device type   we have again two parameter name and temperature  okay so things will get more comfortable more uh   easy to use while you code once and twice with  the rainmaker it will be super easy at first it   may sound complicated because we are dealing with  this kind of thing for the very first time this   kind of code we are not able to see in any like  Blynk, Arduino stuff like that okay so this is   kind of a new kind of uh you know programming you  can say but you'll get comfortable with it after   making one or two projects great so relay part  is done now remaining is the temperature sensor   in the humidity sensor grid so after that here i'm  you know setting the timer for interval of three   seconds after every three second i want to send  the census data you can change it according to   your choice after that here we are enabling couple  of features like OTA schedule everything yes we   can schedule our appliances in the rainmaker  itself like you can turn on the rail at a   particular time turn off the deal at a particular  time we can definitely do that instead of that we   are just starting the rainmaker services and we  are jumping onto the loop part and the loop has a   two function one is this if condition for sending  the census data and another is the logic to reset   rainmaker so this timer is pretty simple after  three seconds this will be called and if it is   connected it will be sending the census data which  is provided here it will be you know gathering   the data printing on the serial monitor and using  the function called as temperature dot update and   report parameter we are sending the data now again  the parameter word is used it's just because we   are sending the data in a particular parameter in  a particular device for example this temperature   inside the temperature device we are updating the  temperature parameter with the value t which is   nothing but the temperature similarly inside  the humidity uh device we are updating the   parameter temperature don't get confused you don't  need to write temp humidity here you need to write   temperatures just because we are using this device  and this device has temperature parameter in it so   don't get confused okay so we are updating the  temperature parameter inside the humidity device   it may sound confusing but yeah i i hope you are  understanding okay we are we are updating the   humidity in this widget okay and this function  will be called after every three second now we   are left with this particular logic and this is a  super superb logic now as we are providing wi-fi   credentials via bluetooth to this esp32 board  what if we need to change the wifi credentials   after a long time do we need to reprogram it no  you don't need to reprogram it you can use the   GPIO0 or the boot button of the esp32 board to  reset your wifi credentials and enter them once   again i'll show you the practical working of this  reset logic after showing the demo of the code so   that was all about the code but i hope you got to  know a little bit about it now what i'll do i'll   select the board as the esp32 dev module and here  inside the partition section you need to select   rainmaker this is a very important step okay and  after doing that just select the right com port   and hit the upload button so after successfully  uploading the code so open up the serial monitor   as you can see it says starting esp rainmaker and  here it has printed a qr code which is not clearly   visible but we need to scan this QR code  so to make the qr code completely visible   there is one link provided in the serial  monitor you just need to copy this link   okay so i'll copy it and i'll open the web  browser here i'll go to the new page and   paste that link here and as you can see here is  the qr code that we need to scan inside our ESP   RainMaker mobile application so i'll open up my  smartphone and i'll open the application called   as ESP RainMaker which is available for both  android and iOS so just download it and after   that you can make an account in this particular  application i already made my account here by the   uh id dedication studios gmail.com and here i'll  click on add device and it will ask to scan the   QR code so i'll take my smartphone and directly  scan this QR code for scanning the QR code it   will start making connection with ESP32 board  via bluetooth so let us see okay it asking for   the padding i'll click on the power button and in  the serial monitor okay we're not getting anything   okay so it gave us the select wi-fi network  page and sometimes it scans the nearby wi-fi   network sometime it don't so we can definitely  add uh it manually by clicking on this button   write down your wi-fi credentials like the  credential of your wi-fi router to make ESP   to talk to the internet after this click on the  provision button now it will send the credentials   to the ESP32 board as you can see on the serial  monitor we're getting to see the wifi credentials   it got connected to wi-fi and now it is setting  up the mobile application it is adapting all the   widgets from the code straight on to this mobile  application it will take couple of seconds more   okay everything is set up now click on  the done button and as you can see we got   two widgets one for temperature one for humidity  and one is the relay widget all onto this uh uh   mobile application without configuring anything  okay now what i'll do i'll connect this ESP32   board with the DHT11 sensor and the relay  module according to the schematic diagram   so after connecting everything let us test with  the esp rainmaker mobile application as you can   see we are able to control that bulb using the  ESP RainMaker app using that widget and we're also   able to see the temperature and humidity ratings  which are updating after every three second let's   try to increase the temperature a bit and let's  see if we're getting the updated values or not   great we are getting the updated results  in real time onto our esp rainmaker app   it's working perfectly fine so after testing  it out let us test out its different features   like the automation and voice integration  so for automation we can go to the schedules   option and click on add schedule we can name  this schedule let's just name it as sample   okay now here we can notify the time on which  we want to turn on or off the particular   widget in our case the relay okay so let's just  try to turn on the relay so right now it is 5 16   so let's just try to turn it on at 5:17. let's  keep it at 5:18. okay and we want to repeat it   or not we don't want to repeat it and action  will be i want to turn on the relay that will   be the action okay so at 5:18 p.m the relay  will get turned on that's the automation we   have programmed here and then let's just click on  the save button okay so it's turned on right now   so it's 5:17 so after one minute the bulb should  get turned on let's just wait and let's observe   okay so it's 5:18 in the clock and the bulb  is turned on so automation is also working   perfectly fine and we don't need to do anything  inside the core side everything is done from the   mobile application or the rainmaker application  that's a great feature then in the settings we   have the voice services as well that means we can  integrate the Alexa and google voice assistant   for absolutely free well none of that IOT  platform provides this feature for free right   so the integration is quite easy quite simple  quite straightforward you just need to click   on that particular service in my case amazon  Alexa and link that amazon alexa with uh ESP   RainMaker so you want to link the amazon echo  Alexa account with the ESP RainMaker account and   yeah everything will be detected automatically  let me just login into my amazon account so   after logging into amazon account you need  to log in with your ESP RainMaker account so   i'll enter the credentials as well perfect  we have linked amazon alexa successfully   now we can turn on the bulb using alexa  and let me show you alexa turn on relay as you can see it got turned  on alexa turn off relay   perfect without any latency and similarly we  can go with the google assistant voice services   as well so now to integrate rainmaker with  google voice assistant we require the google   home application so i'll show you the demo on my  iphone so i'll open up the google home application   uh click on this plus icon and click on set up  a device click on works with google and here   just search for rainmaker here's espn maker just  click on it and here you need to log into your esp   rainmaker account so i'll quickly log into that  account so with this you have successfully linked   the esp rainmaker with your google assistant  as well and if you scroll below here as you   can see there is one device linked with the  rain maker and i click on this it will turn   on the relay as you can see the bulb got turned  on if i click it on again it will turn off the   relay and i can do that with the help of google  assistant as well let me show you turn on relay using alexa as well alexa turn off relay   it got turned off and everything will be visible  inside your esp rainmaker application that means   everything is connected with each other and  everything you are getting for absolutely   free that's esp rainmaker for you okay so now i'll  show you a unique feature of esp rainmaker which   is the sharing option that means we can create  any phone as a member so that they can control   our home appliances and monitor census data  on their smartphone okay so for that first   of all you need to have the id of the person  or to whom you want to be uh you know create   the member okay so here this is the id which says  arunsuthar98@gmail.com so i'll create this phone   as a member so as of now as you can see it has  only one uh project which is about this Sonoff   dual r3 don't have any other rainmaker uh node  you can see okay so now add that phone as a member   of this techiesms node so i'll click on this i  button and here i'll go to the add member option   now here i just need to enter the user uh email  id so i'll write as arunsuthar98@gmail.com i'll   click on the add button and yeah that's it now  it says it is uh you know pending for acceptance   okay so as you can see a notification popped  up on Arun's phone okay if i scroll down a bit   as you can see here is the notification from ESP  RainMaker i'll click on it and it will ask me to   accept it so i'll accept this particular  uh request from techiesmstories.gmail.com   and yeah that's pretty much it as you can see uh  that project the node is successfully added into   my in ESP RainMaker and as you can see here is  the techie sms node and here is the temperature   and humidity widget along with the relay widget so  i can control the relay i can also control that i   can also monitor the temperature and you do more  data onto this phone so that's a really amazing   and unique feature that is not at all available in  other IOT platform as of now and that too for free   okay so now i'll show you a feature of you know  removing the wi-fi credentials so in case we want   to update those credential or add the new one  okay so what you can do is in your ESP RainMaker   uh project like i have updated the ESP RainMaker  code into this esp32 board what i need to do is i   just need to press and hold this boot button for  at least 10 seconds on the serial monitor as you   can see it is reflected as a reset button pressed  i'll press and hold this button for at least 10   seconds and after that i will release it and let's  see what happens as you can see it says reset to   factory so it is completely erased and it started  the code all over again and here we got that same   QR code once again so i can copy this QR code and  if i paste this QR code inside this uh you know   web browser i'll get the same QR code again which  i can scan from the other smartphone and i can   configure or i can add the new wi-fi credentials  into it amazing right we don't need to change   anything inside the code we don't need to hardcore  it everything is provided like everything is super   convenient just to press and hold one button and  you are good to go to add the new credentials okay   so that was the getting started with ESP RainMaker  video i hope you got the idea about how to use   rainmaker for doing your uh IOT projects with the  help of the ESP32 board using Arduino IDE do click   the like button if you really like this uh IOT  cloud platform and really like this video as well   now if we compare it with the blink and rd novel  it do have some of the plus point and some of the   negative points as well plus point a lot more like  we are getting uh the scheduling voice integration   and uh what you can say unlimited  device integration absolutely for free   along with the unique features like self-adapting  mobile application like like if i do some changes   in the code and re-upload into ESP32 board the  app will automatically update those widgets so   it's totally self adapting and the QR code process  is also superb like you can attach those QR code   onto your project or behind your project give it  to your friend and if your friend scans those qr   code with the rainmaker app it will work uh  in his ESP RainMaker application flowlessly   and he can enter his or her uh wi-fi credentials  like the home wifi credentials you don't need to   hard code anything so those are some unique and  amazing features the low point which i felt is   there is a bit bit more latency not huge latency  but a bit more latency as compared to blink but   it is faster than the Arduino Iot cloud  so yeah it's in between both of them   and coding is a little little tricky you can  say because there are some new parameters   new terms included like the node devices and  parameters so this makes the coding a bit   tricky but once you get used to it it's really  very easy and i'll definitely suggest you to go   with the es variant maker as it has everything  that you need to make your home or office a smart   home or smart office so that's my work verdict on  it and i'll definitely looking forward to making   more projects using ESP RainMaker hey should  i make that all in one home automation project   that controls four appliances and speed of one ac  fan with capacitive doing method using rainmaker   should i should i make it for you do let me  know in the comments of the video also do let   me know what do you want to know more about  rainmaker if i missed something do let me uh   know in the comments you can ask the question  in the comment i'll definitely reply to you if   you have any suggestion of making any particular  project using rainmaker that you can also uh you   know drop the thoughts down in the comments  of the video yeah that being said i am just   ending this video here and now just wait for my  next video explore learn share with me techiesms
Info
Channel: techiesms
Views: 72,310
Rating: undefined out of 5
Keywords: techiesms, electronics, electronics projects, ESP RainMaker, Rainmaker, ESP Rainmaker Arduino, esp rainmaker esp32, esp32 projects, Iot projects, esp rainmaker with alexa, esp rainmaker with google assistant, esp rainmaker scheduling, esp rainmaker member sharing
Id: 651EoGQHWck
Channel Id: undefined
Length: 27min 16sec (1636 seconds)
Published: Sat Jul 09 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.