1 00:00:01,090 --> 00:00:08,260 Hello and welcome to this and your last one, and we are going to program E.S.P 32 using Arduino IDE. 2 00:00:10,340 --> 00:00:17,960 You must have the Arduino idea installed and E.S.P, a 32 AdOne installed, as we explained in the download 3 00:00:17,960 --> 00:00:19,220 and install section. 4 00:00:20,670 --> 00:00:24,960 Now, after installing the necessary Bolt Adams Cobie. 5 00:00:26,080 --> 00:00:33,790 The I don't like to argue, no idea, just as explained then you can't simply open Arduino. 6 00:00:34,870 --> 00:00:36,220 To start coding. 7 00:00:39,020 --> 00:00:42,950 Now, the first step that we are going to do is. 8 00:00:44,240 --> 00:00:47,000 Create a new file on your sketch. 9 00:00:48,660 --> 00:00:54,960 Now we need to include some libraries, so let's include the wi fi library. 10 00:01:00,100 --> 00:01:02,590 And we also need to include. 11 00:01:04,590 --> 00:01:06,360 Their city client library. 12 00:01:16,930 --> 00:01:19,240 And we need to include. 13 00:01:20,380 --> 00:01:25,780 Any other labor that we might need for our project, for now, I will just stick with these two. 14 00:01:27,990 --> 00:01:35,700 Now, if you did verify your code, it would ask you to save the code at a certain location. 15 00:01:35,730 --> 00:01:37,680 So here we will save it. 16 00:01:38,490 --> 00:01:41,700 Let's call it E.S.P. 17 00:01:41,880 --> 00:01:47,870 Gold and silver here. 18 00:02:01,510 --> 00:02:08,800 Done combining now what you need to do is create a few variables, we need to create variables for our 19 00:02:08,950 --> 00:02:17,740 wireless network credential, so create a constant character and call it already. 20 00:02:19,270 --> 00:02:21,430 And here you need to enter your network name. 21 00:02:22,390 --> 00:02:26,070 And my network name is called I think I should have TiVo. 22 00:02:27,130 --> 00:02:30,850 Now add a semicolon, add another line. 23 00:02:31,040 --> 00:02:31,780 Constant 24 00:02:34,270 --> 00:02:37,960 character for the password. 25 00:02:41,890 --> 00:02:44,830 And I think my password is this. 26 00:02:49,500 --> 00:02:50,480 Something like that. 27 00:02:50,700 --> 00:02:53,940 Anyway, I'll change it later. 28 00:02:54,180 --> 00:03:01,470 Now let's move on to the server name, create a consistent character. 29 00:03:03,960 --> 00:03:15,930 For the server name and in the server name are going to place are all the domain name and they are all 30 00:03:15,930 --> 00:03:19,980 path, all of the IP address with the path depending on your hosting. 31 00:03:20,160 --> 00:03:24,420 And in our case, we need to copy this. 32 00:03:24,900 --> 00:03:32,500 We need the post data filing, which is basically this one. 33 00:03:32,520 --> 00:03:34,170 OK, let me check this one. 34 00:03:35,590 --> 00:03:38,730 Our domain name and postdated BHP. 35 00:03:39,420 --> 00:03:43,420 So go back here, listed here depending on your domain name. 36 00:03:43,740 --> 00:03:46,920 This might be different, but this is what you need to do. 37 00:03:49,670 --> 00:03:50,150 Now. 38 00:03:51,240 --> 00:03:59,070 The next step is creating the API key value, and we already mentioned that key on the Fabulous on. 39 00:04:03,590 --> 00:04:11,660 And it must be identical to the one you use when you're happy, and to do so, we will have to open 40 00:04:11,660 --> 00:04:14,090 up or be called. 41 00:04:17,820 --> 00:04:20,760 And look for the. 42 00:04:21,830 --> 00:04:24,060 API key value. 43 00:04:24,110 --> 00:04:26,810 OK, here it is, a bickie value. 44 00:04:26,840 --> 00:04:33,500 It is this one Lobach copy and based Diabolik value. 45 00:04:34,310 --> 00:04:37,160 Now you can create any other variable that you want. 46 00:04:37,610 --> 00:04:42,050 You can create a variable for the Zinser name. 47 00:04:44,620 --> 00:04:46,390 Let's call it touch sensor. 48 00:04:47,960 --> 00:04:49,730 And since of location, 49 00:04:54,620 --> 00:05:03,950 let's call it home office since we are at home now. 50 00:05:06,180 --> 00:05:17,070 What you need to do is go to the void setup method and start the serial module at a specific rate and 51 00:05:17,070 --> 00:05:23,940 let's make it a hundred fifty fifteen thousand two hundred. 52 00:05:25,280 --> 00:05:35,780 Now we need to start the Wi-Fi connection wi fi that began using the ID and the password that we used 53 00:05:36,470 --> 00:05:45,320 after that, we need to print the serial monitor line stating that we are connecting so. 54 00:05:45,320 --> 00:05:45,890 Right. 55 00:05:48,080 --> 00:05:53,280 Connecting to the Wi-Fi network. 56 00:05:55,790 --> 00:06:05,540 OK, now, to make sure that we don't have any error, we need to check and to print the local IP address 57 00:06:06,140 --> 00:06:08,250 that we get from our Wi-Fi network. 58 00:06:08,720 --> 00:06:13,370 So let's add this one statement, by the way. 59 00:06:13,370 --> 00:06:19,910 You can copy the Wi-Fi code from the examples if you want here examples and if you want the ISP. 60 00:06:20,830 --> 00:06:22,330 You can't simply. 61 00:06:24,280 --> 00:06:25,630 Look for the Wi-Fi. 62 00:06:27,410 --> 00:06:32,780 And as you can see here, wi fi, if you check the Wi-Fi scan, you can see. 63 00:06:33,900 --> 00:06:35,160 Code for wi fi. 64 00:06:37,310 --> 00:06:45,350 And as you can see why if I disconnect wi fi mode and you can edit the code or use it. 65 00:06:47,080 --> 00:06:54,410 And now it's checking and printing, that's a Saudi you can use this code or you can copy our code. 66 00:06:55,060 --> 00:07:02,980 They both work the same now regarding Wi-Fi, but you have to edit them or edit the code to allow a 67 00:07:02,980 --> 00:07:06,080 Stoebe post and BHP connection. 68 00:07:06,640 --> 00:07:08,080 Anyway, let's proceed. 69 00:07:08,320 --> 00:07:12,070 Now, the Wi-Fi, we need to check that. 70 00:07:12,070 --> 00:07:15,160 The Wi-Fi, the status. 71 00:07:20,830 --> 00:07:22,300 WI fi connected. 72 00:07:26,890 --> 00:07:33,230 To make sure that we are connected and then we cannot to kill the parentheses. 73 00:07:35,780 --> 00:07:39,290 Now, between these two carbon taxes, let's add some delay 74 00:07:43,280 --> 00:07:50,540 to make sure that we are giving all yes people enough time to connect and let's print adopt to indicate 75 00:07:50,540 --> 00:07:52,040 that we did reach this point. 76 00:08:00,140 --> 00:08:02,060 OK, now. 77 00:08:02,930 --> 00:08:08,870 After the wild statement, we can rent an empty string. 78 00:08:15,290 --> 00:08:22,520 Then we can print other lines stating that we are connected to the Wi-Fi with a certain IP address to 79 00:08:22,520 --> 00:08:25,160 make sure that we have an IP address. 80 00:08:26,260 --> 00:08:38,690 OK, now Wi-Fi is connected and use of this IP address. 81 00:08:43,160 --> 00:08:52,250 And now to print the IP address on Wi-Fi network, we can use Siri on that front line and inside it 82 00:08:52,250 --> 00:08:53,690 we need to call Wi-Fi 83 00:08:56,210 --> 00:08:58,640 DOT local IP. 84 00:09:02,300 --> 00:09:09,510 So it will print the IP that our ISP received from the Wi-Fi after. 85 00:09:10,040 --> 00:09:13,940 Now, after doing all of this, we can. 86 00:09:15,700 --> 00:09:19,550 Start the TB process now to start HCB process. 87 00:09:19,570 --> 00:09:25,810 You need to go to the Void Laub and write a simple if statement inside that if we need to make sure 88 00:09:25,810 --> 00:09:36,610 that our Wi-Fi is connected correctly, so we will use Wi-Fi status, equal wireless connected. 89 00:09:40,790 --> 00:09:43,670 Now, if disconnected, what we need right here. 90 00:09:47,360 --> 00:09:50,180 Is first create an Stoebe. 91 00:09:53,060 --> 00:10:02,630 Client object and name it is GTP now, your domain name, who they are on path or IP address must be 92 00:10:02,630 --> 00:10:13,520 passed to the HTP object, be using this line Huckerby begin and inside it you got a server name, which 93 00:10:13,520 --> 00:10:16,300 is basically the server name that we did type here. 94 00:10:19,590 --> 00:10:21,600 Make sure to write it correctly. 95 00:10:21,630 --> 00:10:22,980 We have in capital. 96 00:10:24,150 --> 00:10:31,710 OK, after that, we need to specify content type here to make sure that we are passing the right values 97 00:10:32,010 --> 00:10:35,810 to our Web page, the sense of values and other reading. 98 00:10:36,130 --> 00:10:39,720 Now, right htp dot ad header. 99 00:10:40,230 --> 00:10:45,750 This method is the one that we are going to use to send data. 100 00:10:47,280 --> 00:10:56,100 Now, inside it, you need to write content type, then add a column. 101 00:10:58,150 --> 00:11:10,120 And right, this line fight application slash x, w w w form and you are all. 102 00:11:13,170 --> 00:11:13,860 Encored. 103 00:11:15,650 --> 00:11:24,170 Now, this line can be found online, it's easy and you have to send it before you start writing that. 104 00:11:25,750 --> 00:11:32,890 Now, the next step is to prepare our FTB request data and the data that we will send in that request 105 00:11:32,890 --> 00:11:42,670 is basically the key to Ikki, the sensor location on the sensor name and the value number one value. 106 00:11:42,700 --> 00:11:44,470 Number three, two and three. 107 00:11:45,430 --> 00:11:49,950 And these all of these that are will be sent in a string. 108 00:11:49,960 --> 00:12:01,510 So we have to prepare that strength, create a new string quartet, a city B, request data and start 109 00:12:01,510 --> 00:12:02,530 passing the values. 110 00:12:03,290 --> 00:12:14,710 The first value will be a B, I underscore key and unique to the plus sign and write API key value. 111 00:12:17,100 --> 00:12:23,670 Which is basically the key value that we did assign at the beginning of our. 112 00:12:24,880 --> 00:12:25,720 Codes here. 113 00:12:28,880 --> 00:12:35,930 Now, you need to try the same variables now, plus sign what we are doing now is we are concatenating 114 00:12:35,960 --> 00:12:38,810 a string with the values that we need to send. 115 00:12:39,200 --> 00:12:43,120 So after that, we need to send the census data. 116 00:12:44,000 --> 00:12:48,890 So we were right and center. 117 00:12:52,440 --> 00:12:52,950 Dr.. 118 00:12:55,150 --> 00:13:02,650 Equal and you are the plus sign and send dozens of. 119 00:13:03,930 --> 00:13:06,300 The variable we've called since her name. 120 00:13:09,220 --> 00:13:18,490 After that, we will send us your location, you can add on and sign and write that location 121 00:13:21,070 --> 00:13:21,670 equal. 122 00:13:23,600 --> 00:13:26,360 And we will add since that location. 123 00:13:29,060 --> 00:13:39,350 Here they add another blast sign and start adding different values and value, one equal. 124 00:13:42,120 --> 00:13:52,350 And we will add a string, let's call it value one, we can add any other variable here, but since 125 00:13:52,350 --> 00:14:00,300 we haven't assigned any variable, we can simply write value one and you can keep doing this for the 126 00:14:00,300 --> 00:14:00,930 other two. 127 00:14:03,810 --> 00:14:04,350 OK. 128 00:14:05,520 --> 00:14:15,330 Now, the value three for this one value two for this one, so it will send value one value to one value. 129 00:14:15,360 --> 00:14:20,760 Three, we can assign variables for this one, but let's leave them to this at this point. 130 00:14:21,730 --> 00:14:24,340 Now, after we prepare this request. 131 00:14:26,260 --> 00:14:28,780 As you can see, we need to add a semicolon here 132 00:14:32,290 --> 00:14:37,660 and we need to add serial dot print 133 00:14:40,270 --> 00:14:40,930 and. 134 00:14:42,360 --> 00:14:47,450 We are going to print is this ECB request data. 135 00:14:53,560 --> 00:14:55,530 So let's try it again. 136 00:15:01,680 --> 00:15:04,230 So it will be requested that now. 137 00:15:05,550 --> 00:15:10,170 That's it for this lesson in the next lesson, we are going to proceed with the. 138 00:15:11,430 --> 00:15:20,370 With writing our code and making sure that it works for the people and that it will send data to our 139 00:15:20,370 --> 00:15:20,910 website. 140 00:15:21,900 --> 00:15:23,000 Thanks for watching this lesson. 141 00:15:23,040 --> 00:15:27,100 If you have any question about any line of code, I'm here to help you. 142 00:15:27,570 --> 00:15:28,350 See you next. 143 00:15:28,500 --> 00:15:30,630 This is Ashley from Educational Engineering Team.