Question

Hello,

I have been successful in running the lwIP echo server on the Zybo Z7 board. However, I want to develop a web server on Zynq. I have gone through the lwIP documentation. However,  in the discussion of this topic,

 

I was successful in reading the .bin file from the SD card. Now I want to set up a web server on Zynq so I can command the server to read the .bin file from SD card and store it in the DDR. How do I start working on the web server. I have been searching a lot for the tutorial or anything that could make me understand in a simpler way but I failed to find any.!

I also tried understanding the echo server C code in sdk however, after a point it seems too confusing to me. I could even think of modifying the echo server C code to develop a web server with some help, may be.

The documentation of lwIP is confusing to me at this point.... 

 

Thanks,

Shyama.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi @jpeyron,

So, do I just change echo.c using the file you provided? I am even suppose to change main.c when using the template of lwIP echo server in the SDK?

 

Thanks for the reply,

Shyama.

Share this post


Link to post
Share on other sites
  • 0

Hi @sgandhi,

The attached echo.c shows how to take the typed text off of tera term on the PC and compare it to a pre-selected string and then send a pre-determined string back to tera term through the ethernet connection. 

I would suggest looking here: C:\Xilinx\SDK\2019.1\data\embeddedsw\ThirdParty\sw_services\lwip202_v1_2\examples for better examples for a web server using the LWiP.

I would also suggest looking for more detailed xilinx information here.

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hello @jpeyron,

 

I was looking into some examples in the \lwip202....\examples and found one lwip webserver example that uses index.htm file present in FS! Now when I follow the readme.txt file for directions to execute the example, I see some steps as follows:

**********************************************************************

Creating FAT image on Linux
---------------------------

This requires root (sudo) access on the Linux host

Following commands can be used on terminal to create FAT image to be used with
webserver application:

# create image file of 3MB
dd if=/dev/zero of=example.img bs=512 count=6144

# format image with FAT
/sbin/mkfs.vfat example.img

# mount it
mkdir /tmp/fs
sudo mount -t vfat -o loop,rw example.img /tmp/fs/

# copy your webpages
sudo cp -r  webpages_dir/* /tmp/fs/
sudo umount /tmp/fs
 

***************************************************************

And then it tells to run the application... I just tried to run the application w/o creating FAT image, which is obvious to give me the errors!!

In order for the webserver to gain access to index.htm, the file needs to be present at the specific location. Is that why we create a FAT image on linux???

Also, the steps in readme.txt tells me to runs those commands on the terminal... How do I start with this? Is it talking about the sdk terminal?

As per the directions, I added all the necessary source files and I also included the BSP settings as mentioned! Next step is to create a FAT image on linux... I am wondering how do I start with this!

 

 

Thanks,

Shyama.

Share this post


Link to post
Share on other sites
  • 0

Hi @sgandhi,

I did a quick internet search for "create a FAT image on linux" and this blog looks like it should be helpful.  I have not worked with this example. I would suggest reaching out to Xilinx support about the LWiP examples since they would have experience with the webserver example.

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron,

 

I tried to follow the steps from the blog you mention above but when it does not allow me the mount command saying permission denied....

However, I have tried working with FAT FS for sd card however, the lwIP webserver README.txt says that "The application expects web pages to be stored in RAM based FAT FS". So, is it the talking about storing the webpages in the computer's RAM?  However, I am not able to figure out how do I do that?

Incase of Xilinx forum, it takes much time to get back the reply!!! So, I am posting my question if there is anything you could help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now