Another would come this new election, unless you're going to start with our first example.
It will be a basic example in which we are going to create an observer using our board the SPF 30 tool,
and we will use the IP address to access our SPF 30 tool.
Then we will see how we can add the LTA to our code so that we can easily update the software on the
goal without connecting wires wirelessly or over the air.
Now, the first thing is, including the libraries, so let's include our first and most important library,
which is that a thing elegant or a library?
Now the second library will be the acing ECB, the one that we installed manually.
So like a sink.
ECB the.
Now the async.
DCB is the library that we installed manually.
And as you can see, it is here.
So if you click here, it will be added.
But we just thought it.
So you need this.
I'm just showing you that it is installed.
Now we also need to include the ESB Async.
Web server.
Library, which is the first library that we manually installed, and you can also see it here.
She ran down SB Async Web Server Library, and you can also click here.
It will add all of these, but we don't need all of them.
We just need ISP.
A single observer, which is this one.
Now, once you are done, you'll also need the Wi-Fi lobby because we need to enable Wi-Fi in our sport.
So simply right, why I looked.
Edge, this is the head up file of the library.
Now these are the four libraries that we would need.
Let's also create the two main variables for our Wi-Fi connection on a certain character.
So we create a pointer quality business idea, and in here you need to add your Wi-Fi network, this
IP.
And we also need to put another pointer for the password.
And when I say pointer, this Arctic sign means that here we are defining a pointer, the failure of
this point that has character and the name is a suicide.
Our pointers explained in our C programming course.
Now, after doing this, we need to start the observer.
So we hit on async observer object on a specific port, and for this example, we will use Port 18,
which is the default port.
So async server.
And here you thought, eight, you know, I usually like to verify my record before moving forward and
save it so that your work won't be lost.
So let's create a new folder for records.
And let's call it simple fraud.
Yes, 30 floor.
Now, verifying the code will help, you know that errors, as they are now, we have fewer lines of
code.
And if you have an error, we can easily fix it.
Now go to the tools here.
We have a little because we have the wrong board selected Arduino Mega.
So we need to go back, change the ball to.
SB 32.
And the one that we will use is do it.
ESB first two, this veteran.
So again, verifying.
OK, now I'm compiling without any rules.
Let's initialize the serial monitor for serial began.
And one hundred fifteen thousand two hundred, which is the moderate for this Syrian.
After that, we need to initialize the Wi-Fi, and the Wi-Fi code is pretty straightforward.
We usually light it or copy it from anywhere.
We will start by enabling the Wi-Fi nodes.
And who will use Wi-Fi?
SCA.
After that, we will begin the Wi-Fi connection with the given this is I.D. and password, so that's
a solid password, then we will start the serial monitor by printing an empty string.
Or you can say fi.
Selection.
Felt.
Then we will ride the famous while loop that will keep printing darts.
If you are not connecting to the I find it work.
So here we have our why look.
So if not connected, we need to wait for like 400 milliseconds, and then we will then see a real front.
And in here, we tried that, not inside, though I know that well, make sure if Wi-Fi is connected,
if a family is not connected to will keep planting dots and trying to connect now via Wi-Fi.
Status, which is a function that will attend the state's far right party network and vote in the.
And by the way, this is called R. C. Michael, so this is usually a no button in the life library.
So see or easy to read.
So if not connected, keep printing dots.
Wait, you're printing dots and so on.
Now, if it is connected, we need to print a few lines.
So Syrian.
The friends.
Alan?
We will start with an empty line and I will print few things.
Connected.
So why?
If the war were.
Name.
And then we will parenthesis it because it has the Wi-Fi network name.
Using.
The plan without them being a new line because we need it to be printed on the same line.
Now you can even give the IP address, which is something we want because this IP address will be used
to access our ISP board.
So we will write print.
IP address.
For life on, well, ESB, it's soothing.
The.
Then we will use the local IP function.
Front line.
Qualify.
The local IP.
Dysfunctional return the local IP for our yes, people.
Now, after doing all of this, we all connected to the internet, which is the first step in our program.
The step after this is to handle the clients requests, so we are going to write two or three lines
of calls to send any text like, Hi, hello, this is Ashraf or this is education engineering team.
And yes, P32 Board is online now.
This text will be printed whenever you access the root IP address, and to do this, we can't simply
send this line of code by its server.
And when you say server will mean the server that we initiated here.
So here we are calling the object watchers server on.
Then you need to fantasies and the cynical.
Now between the two parentheses, you have to add to that reputation, all the records then add a semicolon.
Now we added backslash after the semicolon.
We need to send the request, which is at CTP gets.
Then add another semicolon through brackets and add to parentheses.
Now between the two parentheses, we need to fight acing.
A sink web.
Server.
But worse.
Gastric bequest.
So this is basically our point.
Now also that we need to send the request itself went to clearly places.
So I request.
Then fight sends.
After that, you need to add two practices and.
The number, then the.
Type of thing you want to display, it will be text land.
And we need to add the semicolon.
Then the things that you wanted to display is say hello.
This is Ashraf nucleation on.
Engineering.
That's it.
Now, let's do this on two lines.
Scored.
Now we have.
OK, we can split it here.
That's it.
This will be our code.
Now, this is the server that also that we added two quotations and backslash semicolon.
That, of course, Typekit Stibbe get on the same column, two brackets and two parentheses in them.
We created a pointer called the request from the async web server request time, which is a type from
our library.
Then we added to curly braces.
We sent the request and the type of data that will be displayed is text, and this is the text that
we will display on our web page.
Now, once done, we have that request ready.
The last step inside the setup is starting the elegant alternative.
So make sure you are here, but acing.
Elegance, LTA, don't begin.
And we will pass the third floor.
I just saw an armed server.
This will pass that as far server memory tours that begin function of that async elegant or to which
is the over the air update library, then we will save the server itself by server begin.
And we will print on the CO2 monitor.
Anything to indicate that a server started.
Elegant.
LTA initiated.
We need another line.
Here we need to like to be said about.
As I've said.
Subsys Solar.
Now, once you're done, this is the end of our code.
As you can see, we have our elegant server started.
We have our web server started and we have the text to be displayed on the broad IP address and this
code is ready to be shipped to our board or ESB 32 ball.
Now let's verify the code again to see if we have any errors to fix them before uploading the code.
Now, in the next lesson, you'll upload the code and we will test this practically and see how we can
send our bin file.
Now, as you can see, we have an error here.
It's saying that it expected us to write a semicolon before the can embrace here.
So let's see.
OK.
And that's right here we have missed our semicolon at the end of this request.
So make sure that you have the closing parentheses, semicolon Galbraith's closing parentheses and other
semicolon.
Liquefy again, this structure is something you can't copy.
You don't have to memorize.
And we will provide the quote of you to check out, but we usually like our students to write their
own codes so that they will learn along the way.
As you can see done compiling now, what is left is uploading the code to our SB 32 ball.
This will be done on the next lesson.
So now let's do a quick overview of this code.
First, we reported that I think TCB that will observe our library and the elegant Otere Library, which
is the main library for our course.
We also imported the life.I library because we need to enable Wi-Fi connection.
We created two pointers aside beyond password for our Wi-Fi network name password.
We started the or we create an object from the async web server while the server and the port will be
waiting inside the Voice tab.
We started the serial communication, which although I find more to be Wi-Fi SDK, we began the Wi-Fi
connection with the Wi-Fi network name and password.
Then we printed Wi-Fi connection attempt.
We use the I loop to check if Wi-Fi is connected using the life-I status function and if it is not connected,
it will keep printing dots and waiting for 400 milliseconds.
Then, once connected, will print connected to a Wi-Fi network with the name printed.
Our Wi-Fi network, then it will print the IP address for our ISP third toolbar.
After that, we have sent our request, I get to request our observer to display this text.
On the road with Page.
Then we started the Otay.
With this server address, and we started the server itself, then we printed these two lines elegant,
initialized as 2TB server has started successfully.
Now we can also print another line.
Two axes.
Okay.
Update.
I.
And after that, we will use the local IP address.
When he is on will attend.
This sign.
But the backslash sign.
And the last step will be.
Renting the word updates.
So this will show the user what he needs to enter to access the OTA update page.
Once done, simply click Verify again.
And again, and the next lesson, I'll show you how to blow this cord to your sport and how you can
easily update the cord using auto feature without any cables.
Thanks for sharing this lesson.
This is Usha from educational engineering team.