1
00:00:01,700 --> 00:00:07,180
Another would come this new election, unless you're going to start with our first example.

2
00:00:08,390 --> 00:00:16,730
It will be a basic example in which we are going to create an observer using our board the SPF 30 tool,

3
00:00:17,360 --> 00:00:21,990
and we will use the IP address to access our SPF 30 tool.

4
00:00:22,710 --> 00:00:32,990
Then we will see how we can add the LTA to our code so that we can easily update the software on the

5
00:00:32,990 --> 00:00:37,940
goal without connecting wires wirelessly or over the air.

6
00:00:39,170 --> 00:00:47,090
Now, the first thing is, including the libraries, so let's include our first and most important library,

7
00:00:47,990 --> 00:00:55,250
which is that a thing elegant or a library?

8
00:00:56,330 --> 00:01:01,910
Now the second library will be the acing ECB, the one that we installed manually.

9
00:01:02,870 --> 00:01:04,250
So like a sink.

10
00:01:05,470 --> 00:01:06,250
ECB the.

11
00:01:07,510 --> 00:01:08,830
Now the async.

12
00:01:10,870 --> 00:01:14,770
DCB is the library that we installed manually.

13
00:01:16,670 --> 00:01:18,110
And as you can see, it is here.

14
00:01:18,680 --> 00:01:20,750
So if you click here, it will be added.

15
00:01:21,680 --> 00:01:22,850
But we just thought it.

16
00:01:24,320 --> 00:01:25,370
So you need this.

17
00:01:25,640 --> 00:01:27,560
I'm just showing you that it is installed.

18
00:01:29,650 --> 00:01:35,050
Now we also need to include the ESB Async.

19
00:01:36,880 --> 00:01:38,380
Web server.

20
00:01:39,720 --> 00:01:45,210
Library, which is the first library that we manually installed, and you can also see it here.

21
00:01:46,770 --> 00:01:53,130
She ran down SB Async Web Server Library, and you can also click here.

22
00:01:53,220 --> 00:01:56,620
It will add all of these, but we don't need all of them.

23
00:01:56,640 --> 00:01:58,380
We just need ISP.

24
00:01:59,490 --> 00:02:01,830
A single observer, which is this one.

25
00:02:05,090 --> 00:02:12,170
Now, once you are done, you'll also need the Wi-Fi lobby because we need to enable Wi-Fi in our sport.

26
00:02:14,050 --> 00:02:16,260
So simply right, why I looked.

27
00:02:17,260 --> 00:02:19,570
Edge, this is the head up file of the library.

28
00:02:20,350 --> 00:02:23,800
Now these are the four libraries that we would need.

29
00:02:24,580 --> 00:02:31,560
Let's also create the two main variables for our Wi-Fi connection on a certain character.

30
00:02:32,110 --> 00:02:39,730
So we create a pointer quality business idea, and in here you need to add your Wi-Fi network, this

31
00:02:39,730 --> 00:02:40,120
IP.

32
00:02:40,900 --> 00:02:44,110
And we also need to put another pointer for the password.

33
00:02:46,700 --> 00:02:54,830
And when I say pointer, this Arctic sign means that here we are defining a pointer, the failure of

34
00:02:54,830 --> 00:02:57,890
this point that has character and the name is a suicide.

35
00:02:58,730 --> 00:03:01,670
Our pointers explained in our C programming course.

36
00:03:02,860 --> 00:03:05,850
Now, after doing this, we need to start the observer.

37
00:03:07,400 --> 00:03:16,100
So we hit on async observer object on a specific port, and for this example, we will use Port 18,

38
00:03:16,190 --> 00:03:18,590
which is the default port.

39
00:03:19,100 --> 00:03:21,440
So async server.

40
00:03:23,000 --> 00:03:32,030
And here you thought, eight, you know, I usually like to verify my record before moving forward and

41
00:03:32,030 --> 00:03:35,810
save it so that your work won't be lost.

42
00:03:36,140 --> 00:03:39,380
So let's create a new folder for records.

43
00:03:41,040 --> 00:03:43,590
And let's call it simple fraud.

44
00:03:44,760 --> 00:03:45,990
Yes, 30 floor.

45
00:03:48,910 --> 00:03:55,660
Now, verifying the code will help, you know that errors, as they are now, we have fewer lines of

46
00:03:55,660 --> 00:03:56,050
code.

47
00:03:56,320 --> 00:04:00,220
And if you have an error, we can easily fix it.

48
00:04:00,910 --> 00:04:02,450
Now go to the tools here.

49
00:04:02,450 --> 00:04:06,540
We have a little because we have the wrong board selected Arduino Mega.

50
00:04:07,270 --> 00:04:10,210
So we need to go back, change the ball to.

51
00:04:11,550 --> 00:04:12,780
SB 32.

52
00:04:14,490 --> 00:04:17,160
And the one that we will use is do it.

53
00:04:18,210 --> 00:04:20,580
ESB first two, this veteran.

54
00:04:21,740 --> 00:04:23,120
So again, verifying.

55
00:04:38,870 --> 00:04:41,420
OK, now I'm compiling without any rules.

56
00:04:41,990 --> 00:04:46,400
Let's initialize the serial monitor for serial began.

57
00:04:48,460 --> 00:04:54,010
And one hundred fifteen thousand two hundred, which is the moderate for this Syrian.

58
00:04:54,970 --> 00:05:00,460
After that, we need to initialize the Wi-Fi, and the Wi-Fi code is pretty straightforward.

59
00:05:00,880 --> 00:05:03,550
We usually light it or copy it from anywhere.

60
00:05:04,240 --> 00:05:07,750
We will start by enabling the Wi-Fi nodes.

61
00:05:11,250 --> 00:05:12,600
And who will use Wi-Fi?

62
00:05:14,130 --> 00:05:14,730
SCA.

63
00:05:15,860 --> 00:05:24,320
After that, we will begin the Wi-Fi connection with the given this is I.D. and password, so that's

64
00:05:24,320 --> 00:05:31,910
a solid password, then we will start the serial monitor by printing an empty string.

65
00:05:35,580 --> 00:05:38,400
Or you can say fi.

66
00:05:41,710 --> 00:05:42,400
Selection.

67
00:05:44,350 --> 00:05:44,850
Felt.

68
00:05:47,750 --> 00:05:53,370
Then we will ride the famous while loop that will keep printing darts.

69
00:05:53,390 --> 00:05:56,870
If you are not connecting to the I find it work.

70
00:05:58,450 --> 00:06:01,720
So here we have our why look.

71
00:06:03,080 --> 00:06:14,420
So if not connected, we need to wait for like 400 milliseconds, and then we will then see a real front.

72
00:06:16,480 --> 00:06:23,840
And in here, we tried that, not inside, though I know that well, make sure if Wi-Fi is connected,

73
00:06:24,400 --> 00:06:31,450
if a family is not connected to will keep planting dots and trying to connect now via Wi-Fi.

74
00:06:33,550 --> 00:06:40,480
Status, which is a function that will attend the state's far right party network and vote in the.

75
00:06:42,270 --> 00:06:51,500
And by the way, this is called R. C. Michael, so this is usually a no button in the life library.

76
00:06:52,110 --> 00:06:55,970
So see or easy to read.

77
00:06:56,580 --> 00:07:00,130
So if not connected, keep printing dots.

78
00:07:00,180 --> 00:07:02,490
Wait, you're printing dots and so on.

79
00:07:03,390 --> 00:07:06,540
Now, if it is connected, we need to print a few lines.

80
00:07:07,760 --> 00:07:08,540
So Syrian.

81
00:07:09,740 --> 00:07:10,490
The friends.

82
00:07:11,830 --> 00:07:12,340
Alan?

83
00:07:13,960 --> 00:07:18,820
We will start with an empty line and I will print few things.

84
00:07:21,090 --> 00:07:21,690
Connected.

85
00:07:24,030 --> 00:07:25,160
So why?

86
00:07:27,560 --> 00:07:29,310
If the war were.

87
00:07:31,120 --> 00:07:31,570
Name.

88
00:07:33,290 --> 00:07:37,580
And then we will parenthesis it because it has the Wi-Fi network name.

89
00:07:38,660 --> 00:07:39,380
Using.

90
00:07:40,610 --> 00:07:44,990
The plan without them being a new line because we need it to be printed on the same line.

91
00:07:45,860 --> 00:07:51,140
Now you can even give the IP address, which is something we want because this IP address will be used

92
00:07:51,140 --> 00:07:52,610
to access our ISP board.

93
00:07:53,420 --> 00:07:55,280
So we will write print.

94
00:07:56,420 --> 00:07:57,560
IP address.

95
00:08:00,550 --> 00:08:03,460
For life on, well, ESB, it's soothing.

96
00:08:04,960 --> 00:08:05,170
The.

97
00:08:07,270 --> 00:08:11,110
Then we will use the local IP function.

98
00:08:12,710 --> 00:08:14,030
Front line.

99
00:08:16,160 --> 00:08:16,970
Qualify.

100
00:08:18,120 --> 00:08:19,620
The local IP.

101
00:08:20,950 --> 00:08:24,640
Dysfunctional return the local IP for our yes, people.

102
00:08:26,080 --> 00:08:32,380
Now, after doing all of this, we all connected to the internet, which is the first step in our program.

103
00:08:34,880 --> 00:08:43,610
The step after this is to handle the clients requests, so we are going to write two or three lines

104
00:08:43,610 --> 00:08:52,340
of calls to send any text like, Hi, hello, this is Ashraf or this is education engineering team.

105
00:08:52,890 --> 00:08:57,890
And yes, P32 Board is online now.

106
00:08:58,370 --> 00:09:06,140
This text will be printed whenever you access the root IP address, and to do this, we can't simply

107
00:09:06,650 --> 00:09:10,160
send this line of code by its server.

108
00:09:11,310 --> 00:09:16,260
And when you say server will mean the server that we initiated here.

109
00:09:17,920 --> 00:09:22,120
So here we are calling the object watchers server on.

110
00:09:23,440 --> 00:09:28,210
Then you need to fantasies and the cynical.

111
00:09:29,500 --> 00:09:37,450
Now between the two parentheses, you have to add to that reputation, all the records then add a semicolon.

112
00:09:37,780 --> 00:09:40,750
Now we added backslash after the semicolon.

113
00:09:40,750 --> 00:09:45,130
We need to send the request, which is at CTP gets.

114
00:09:46,900 --> 00:09:53,500
Then add another semicolon through brackets and add to parentheses.

115
00:09:55,240 --> 00:09:58,900
Now between the two parentheses, we need to fight acing.

116
00:10:01,800 --> 00:10:03,150
A sink web.

117
00:10:04,780 --> 00:10:05,400
Server.

118
00:10:07,160 --> 00:10:07,730
But worse.

119
00:10:09,700 --> 00:10:11,220
Gastric bequest.

120
00:10:11,720 --> 00:10:13,090
So this is basically our point.

121
00:10:13,980 --> 00:10:19,000
Now also that we need to send the request itself went to clearly places.

122
00:10:21,240 --> 00:10:22,260
So I request.

123
00:10:23,740 --> 00:10:25,930
Then fight sends.

124
00:10:28,870 --> 00:10:33,400
After that, you need to add two practices and.

125
00:10:34,710 --> 00:10:37,080
The number, then the.

126
00:10:38,270 --> 00:10:42,760
Type of thing you want to display, it will be text land.

127
00:10:44,830 --> 00:10:47,650
And we need to add the semicolon.

128
00:10:48,810 --> 00:10:53,550
Then the things that you wanted to display is say hello.

129
00:10:56,830 --> 00:10:59,550
This is Ashraf nucleation on.

130
00:11:00,660 --> 00:11:01,390
Engineering.

131
00:11:03,380 --> 00:11:03,920
That's it.

132
00:11:05,620 --> 00:11:08,860
Now, let's do this on two lines.

133
00:11:12,630 --> 00:11:13,130
Scored.

134
00:11:14,350 --> 00:11:15,650
Now we have.

135
00:11:15,670 --> 00:11:17,740
OK, we can split it here.

136
00:11:20,690 --> 00:11:21,200
That's it.

137
00:11:21,590 --> 00:11:22,820
This will be our code.

138
00:11:25,230 --> 00:11:31,610
Now, this is the server that also that we added two quotations and backslash semicolon.

139
00:11:32,010 --> 00:11:39,120
That, of course, Typekit Stibbe get on the same column, two brackets and two parentheses in them.

140
00:11:39,240 --> 00:11:47,370
We created a pointer called the request from the async web server request time, which is a type from

141
00:11:47,370 --> 00:11:48,090
our library.

142
00:11:48,810 --> 00:11:50,640
Then we added to curly braces.

143
00:11:50,760 --> 00:11:57,810
We sent the request and the type of data that will be displayed is text, and this is the text that

144
00:11:57,810 --> 00:12:01,020
we will display on our web page.

145
00:12:02,160 --> 00:12:05,070
Now, once done, we have that request ready.

146
00:12:06,060 --> 00:12:10,290
The last step inside the setup is starting the elegant alternative.

147
00:12:10,920 --> 00:12:14,670
So make sure you are here, but acing.

148
00:12:16,240 --> 00:12:19,180
Elegance, LTA, don't begin.

149
00:12:21,110 --> 00:12:22,800
And we will pass the third floor.

150
00:12:22,820 --> 00:12:26,180
I just saw an armed server.

151
00:12:28,090 --> 00:12:36,940
This will pass that as far server memory tours that begin function of that async elegant or to which

152
00:12:36,940 --> 00:12:45,580
is the over the air update library, then we will save the server itself by server begin.

153
00:12:47,010 --> 00:12:50,250
And we will print on the CO2 monitor.

154
00:12:51,210 --> 00:12:54,870
Anything to indicate that a server started.

155
00:12:57,240 --> 00:12:57,870
Elegant.

156
00:12:58,930 --> 00:13:00,910
LTA initiated.

157
00:13:04,100 --> 00:13:05,090
We need another line.

158
00:13:09,400 --> 00:13:12,580
Here we need to like to be said about.

159
00:13:13,940 --> 00:13:15,080
As I've said.

160
00:13:16,530 --> 00:13:17,610
Subsys Solar.

161
00:13:22,030 --> 00:13:26,110
Now, once you're done, this is the end of our code.

162
00:13:26,800 --> 00:13:31,180
As you can see, we have our elegant server started.

163
00:13:31,180 --> 00:13:39,940
We have our web server started and we have the text to be displayed on the broad IP address and this

164
00:13:39,940 --> 00:13:45,520
code is ready to be shipped to our board or ESB 32 ball.

165
00:13:46,360 --> 00:13:53,320
Now let's verify the code again to see if we have any errors to fix them before uploading the code.

166
00:13:54,100 --> 00:14:01,480
Now, in the next lesson, you'll upload the code and we will test this practically and see how we can

167
00:14:01,480 --> 00:14:03,520
send our bin file.

168
00:14:04,330 --> 00:14:07,390
Now, as you can see, we have an error here.

169
00:14:07,990 --> 00:14:16,870
It's saying that it expected us to write a semicolon before the can embrace here.

170
00:14:18,460 --> 00:14:19,480
So let's see.

171
00:14:21,220 --> 00:14:21,660
OK.

172
00:14:21,830 --> 00:14:28,020
And that's right here we have missed our semicolon at the end of this request.

173
00:14:30,380 --> 00:14:37,940
So make sure that you have the closing parentheses, semicolon Galbraith's closing parentheses and other

174
00:14:37,940 --> 00:14:38,450
semicolon.

175
00:14:39,500 --> 00:14:44,000
Liquefy again, this structure is something you can't copy.

176
00:14:44,030 --> 00:14:45,290
You don't have to memorize.

177
00:14:47,510 --> 00:14:54,200
And we will provide the quote of you to check out, but we usually like our students to write their

178
00:14:54,200 --> 00:14:57,200
own codes so that they will learn along the way.

179
00:14:57,440 --> 00:15:03,950
As you can see done compiling now, what is left is uploading the code to our SB 32 ball.

180
00:15:04,970 --> 00:15:06,620
This will be done on the next lesson.

181
00:15:06,890 --> 00:15:10,100
So now let's do a quick overview of this code.

182
00:15:10,310 --> 00:15:17,330
First, we reported that I think TCB that will observe our library and the elegant Otere Library, which

183
00:15:17,330 --> 00:15:19,220
is the main library for our course.

184
00:15:19,970 --> 00:15:24,710
We also imported the life.I library because we need to enable Wi-Fi connection.

185
00:15:25,490 --> 00:15:30,680
We created two pointers aside beyond password for our Wi-Fi network name password.

186
00:15:31,460 --> 00:15:39,930
We started the or we create an object from the async web server while the server and the port will be

187
00:15:39,930 --> 00:15:42,260
waiting inside the Voice tab.

188
00:15:42,740 --> 00:15:50,330
We started the serial communication, which although I find more to be Wi-Fi SDK, we began the Wi-Fi

189
00:15:50,330 --> 00:15:53,900
connection with the Wi-Fi network name and password.

190
00:15:55,310 --> 00:15:58,310
Then we printed Wi-Fi connection attempt.

191
00:15:59,210 --> 00:16:05,360
We use the I loop to check if Wi-Fi is connected using the life-I status function and if it is not connected,

192
00:16:05,360 --> 00:16:09,020
it will keep printing dots and waiting for 400 milliseconds.

193
00:16:09,950 --> 00:16:15,200
Then, once connected, will print connected to a Wi-Fi network with the name printed.

194
00:16:15,720 --> 00:16:21,050
Our Wi-Fi network, then it will print the IP address for our ISP third toolbar.

195
00:16:22,490 --> 00:16:29,300
After that, we have sent our request, I get to request our observer to display this text.

196
00:16:30,670 --> 00:16:31,870
On the road with Page.

197
00:16:33,260 --> 00:16:35,360
Then we started the Otay.

198
00:16:37,090 --> 00:16:43,820
With this server address, and we started the server itself, then we printed these two lines elegant,

199
00:16:44,190 --> 00:16:47,500
initialized as 2TB server has started successfully.

200
00:16:48,490 --> 00:16:50,230
Now we can also print another line.

201
00:16:55,830 --> 00:16:56,640
Two axes.

202
00:16:58,180 --> 00:16:58,690
Okay.

203
00:16:58,730 --> 00:16:59,200
Update.

204
00:17:02,000 --> 00:17:02,330
I.

205
00:17:04,210 --> 00:17:08,980
And after that, we will use the local IP address.

206
00:17:11,810 --> 00:17:14,420
When he is on will attend.

207
00:17:15,590 --> 00:17:16,250
This sign.

208
00:17:18,010 --> 00:17:19,120
But the backslash sign.

209
00:17:20,290 --> 00:17:21,970
And the last step will be.

210
00:17:23,420 --> 00:17:25,820
Renting the word updates.

211
00:17:27,390 --> 00:17:33,240
So this will show the user what he needs to enter to access the OTA update page.

212
00:17:34,590 --> 00:17:37,050
Once done, simply click Verify again.

213
00:17:38,490 --> 00:17:45,000
And again, and the next lesson, I'll show you how to blow this cord to your sport and how you can

214
00:17:45,000 --> 00:17:51,300
easily update the cord using auto feature without any cables.

215
00:17:52,170 --> 00:17:53,490
Thanks for sharing this lesson.

216
00:17:54,120 --> 00:17:56,850
This is Usha from educational engineering team.
