0:09
hello everyone welcome to controllers
0:12
tech today in this video I am going to
0:17
show you guys how to start using esp8266
0:20
I am going to use the 80 command sets to
0:25
create a web server I am using real term
0:29
as a serial monitor let me just show you
0:33
the port where the ESP is connected to
0:36
as you can see it's comm 6 the
0:40
connection of ESP with the FT 232 is
0:43
shown in the picture you can pause here
0:46
and take a better look go to real term
0:50
and open the port 6 my device is running
0:54
at baud rate of 11 5 200
0:57
it might be different in your case check
1:00
the device details where you bought it
1:02
from check the CR and LF boxes these are
1:08
needed for the 80 commands here is the
1:12
manual 480 instruction sets first we are
1:21
going to take a look at a T command this
1:25
basically checks if the device is
1:41
as you can see the device returned okay
1:46
so the connection is good I am going to
1:50
restart it using the rst command if
1:54
restarted but as you see the last two
1:56
messages it is been connecting to a
1:58
Wi-Fi so I will just restore the factory
2:03
settings to ensure the transparent
2:05
process I am using the command restore
2:08
for that process it is restored to
2:12
factory settings now and there is no
2:14
connection let's take a look at our
2:24
first command 80-plus CW mode is used to
2:33
set the configuration for the device it
2:37
can be configured to use as a station or
2:39
as an access point or both let's first
2:43
check the default configuration adding a
2:47
question mark means we are querying it
2:51
returned to which means that it is in
2:53
access point mode but we want it to be a
2:57
station so that it can be connected to
2:59
our Wi-Fi so set the CW mode as one
3:15
now you can see it's returning one
3:19
now as the ESP can be connected to a
3:23
Wi-Fi we are going to connect it to one
3:31
CW lap is used to list all the access
3:34
points that are available in the range
3:47
it returned three AP mine is the middle
3:52
one it's time to join the access point
4:01
now to do so we will use the command cwj
4:10
the usage of it is given in the example
4:23
basically we have to enter CW equals
4:27
the name of the AP comma the password of
4:31
the AP it is now connected to the Wi-Fi
4:44
but this connection is just temporary
4:47
if the device restarts it will be lost
4:50
to make it permanent we have to write it
4:54
to the default settings
4:56
CW underscore Neff is used for the
5:00
purpose and now the connection is
5:03
permanent let's restart the device and
5:06
test it as you can see it is connecting
5:17
to the Wi-Fi by its own next thing we
5:20
need is the IP address of the device
5:38
CIFS are is the command to do so
5:54
it'd have returned the IP address here
5:57
copied you are going to need it
6:21
we can also use the static IP using the
6:25
SIP Sta death command the example is
6:33
mentioned here itself I am not using one
6:36
this time cause this IP that we got is
6:40
also static and I am okay with it
6:57
zip MUX command is used to set the
7:00
multiple connections by default it is
7:08
set to zero so we are going to set it to
7:11
one so that we can use multiple
7:29
next we are going to create our server
7:31
and 80-plus sip server is used for the
7:55
one creates the server and eighty is the
7:58
port if you want you can set the maximum
8:02
number of connections allowed by the
8:04
server the usage is given here I will
8:13
show you what is meant by number of
8:15
connections in a while let's now go to
8:24
the IP address of our device if you look
8:28
at the terminal the device got a request
8:31
the important part that we are
8:34
interested in is the connection number
8:36
it is zero as mentioned here after IPD
8:41
we are going to send some data to this
8:44
connection 80-plus sips send is the
8:55
the first parameter is the connection
8:58
number and second is the length of the
9:01
data that you want to send in our case
9:11
that the number is zero and length hello
9:14
world is 11 characters next we have to
9:18
send the data once the data length is
9:21
reached you will receive okay
9:24
at last close the connection using sip
9:27
closed equals connection number once
9:30
done you can check the browser for the
9:33
data and yes we did receive the hello
9:37
world let's refresh this page we are
9:41
again getting the request from same
9:43
connection number now to show multiple
9:47
connections I will try to access the IP
9:49
from another browser as you can see this
9:59
time the connection number is 1 so right
10:02
now the device is getting requests from
10:05
2 connections at the same time and I
10:09
will send the data to the connection 1
10:18
let's first close the connection zero
10:20
and see what happens as you can see the
10:31
edge browsers connection is closed
10:33
without any data and Chrome is still
10:37
waiting now I am closing connection one
10:40
which is the Chrome's connections and
10:48
yes the chrome received its data
10:51
successfully we can also check the
11:03
status of the connection using sip
11:24
right now it's disconnected let's
11:27
refresh the edge connection and check
11:43
this time you can see the TCP connection
11:46
is established this time connection
11:50
number is zero again
12:00
I will send hello chrome to the edge and
12:04
close the connection zero and it
12:08
received the data successfully of course
12:12
guys this is just the getting started
12:14
tutorial we will create an actual web
12:18
page in the next tutorial also we will
12:22
work on some IOT related stuff hope you
12:26
liked the video have a nice day