0:10
hello and welcome to controllers tech
0:14
this is another video in the ethernet
0:16
series and today we will see how to
0:22
we will use the http daemon to handle
0:25
the requests for the server
0:27
i am going to make three videos for this
0:31
the first video which is this one will
0:34
cover the setting up of the http daemon
0:36
and we will also run a basic server
0:39
in the next video we will see how to use
0:42
the ssi server side include feature to
0:46
update the web page with new data
0:48
and finally in the third video we will
0:51
use the cgi common gateway interface
0:55
so let's start the today's video in
0:57
which we will simply set the http basic
1:04
stm32f750 discovery board
1:07
give some name to the project and click
1:16
first things first let's set up the
1:20
i am using external high speed crystal
1:22
to provide the clock and running the mcu
1:26
216 megahertz frequency
1:39
m7 processor enable the cache
1:42
this mcu i am using have low flash
1:45
memory and this is why i need to use the
1:49
i have already made a video about qspi
1:53
and here i am doing the same process as
1:55
mentioned in that video
2:00
if you have enough flash you don't need
2:05
all right now let's enable the ethernet
2:09
i have our m-ii connection type
2:15
make sure these pins are correctly
2:17
configured as per the board schematics
2:25
p h y address must be zero as i am using
2:29
the on board ethernet module
2:31
this is it for the ethernet setup now
2:40
here first we will disable the dhcp and
2:44
manually assign a static ip for our
2:50
next assign the memory of 10 kilobytes
2:54
this is the basic setup which has been
2:56
already covered in the first video of
3:10
if you click on the advanced parameters
3:12
you can see a lot of additional setup
3:15
like i said in the beginning we will
3:17
cover the ssi and cgi in the upcoming
3:20
videos so keep them disabled for now
3:26
that's it for the lwip setup now click
3:29
save to generate the project
3:34
there will be a lot of errors and we
3:36
will fix them one by one
3:41
so let's build the code once
3:50
first error we have in the f s data
3:54
it is trying to look for the f s data
3:56
custom dot c file which isn't present in
4:00
so open this declaration and set it to
4:08
we still have the error here but this
4:10
time it's looking for the fs data.c file
4:14
we need to include this file in the
4:17
here is the folder make fs
4:20
this is the program to create the fs
4:24
this folder fs contains all the
4:27
resources you are going to use for the
4:31
by default it have the index page a404
4:35
error page and an image
4:38
you can modify these or add new pages
4:41
here but for the simplicity i will go
4:43
with this basic setup for now
4:46
the index page looks something like this
4:49
and the 404 page looks like this
4:59
now go to middleware third party lwip
5:03
source apps http and open this folder
5:24
we need to copy these files here
5:33
after copying just double click the make
5:35
fs data and it will create a
5:50
all right we have created the fs data
5:52
file so refresh the project and build
6:04
we still have errors but they are not
6:06
about the f-s data file not being
6:28
the error is due to these functions
6:31
so next we have to do is exclude the
6:34
fsdata.c file from the build
6:43
you can see has been excluded from the
6:46
let's try building again
6:50
all right the f s data related errors
6:54
this error is because my flash is
6:57
so i am going to use the external flash
7:01
i am mentioning this again that this
7:03
part has been covered in the qspi video
7:06
and all i am doing is booting from the
7:08
external flash memory
7:16
and now we have zero errors
7:22
i still need to relocate the vector
7:24
table to the external flash
7:41
all right let's write the code now
7:44
first of all include the httpd header
7:52
next we will create the netif structure
7:54
just like we did in the previous videos
7:57
in the main file initialize the http
8:02
and finally in the while loop we will
8:09
and check timeout let's build and debug
8:15
since i am using the external flash i
8:18
need to use the external loader
8:33
let's put a break point here to check if
8:35
everything is initialized properly
8:38
all right we are hitting the break point
8:40
so everything is fine
8:43
let's go to the ip we assigned to the
8:52
and here we got the web page
8:55
if we try to access something else it
8:57
will show the 4 0 4 error
9:19
so the web page is working all right
9:24
like i mentioned all the resources you
9:27
are using must be in this fs folder
9:30
and this is the index page
9:33
you can modify this according to your
9:37
but after modifying you need to again
9:39
create the fs data file
9:47
i am modifying this index file now
9:59
create the new fs data file
10:05
build the code again and run it
10:16
and now you see the new data is showing
10:21
all right what will happen if we don't
10:27
i am modifying the file again
10:37
create a new fs data file
10:43
reloading the page doesn't show the new
11:00
it doesn't work like this
11:03
we must rebuild the code and then upload
11:16
and now you can see the new data showed
11:19
so we can't change the web page in the
11:23
and this is where the ssi comes in
11:26
the server side include will do this job
11:28
of updating the new data in the runtime
11:32
and we will see that in the next
11:35
this is it for today
11:37
i hope you understood the process
11:40
watch the previous ethernet videos to
11:42
understand more about the setup and qspi
11:46
videos for the external flash
11:48
you can download the code from the link
11:52
leave comments in case of any doubt keep
11:56
watching and have a nice day ahead