I modified the demo STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB to use the lwIP httpd server for testing.
Giovanni
[INFO] lwIP version 2.0 Topic is solved
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [INFO] lwIP version 2.0
OK, back to reality...
I wanted to have httpd_opts.h in the application directory and I discovered:
1) httpd_opts.h is placed together with other headers, OK... let's rename it so it will find my copy.
2) httpd.c includes "lwip/apps/httpd.h" which includes "httpd_opts.h" (without path).
3) fs.c includes "lwip/apps/httpd_opts.h" (with path).
So you need to have both "./ext/lwip/src/include" (empty dir) and "./ext/lwip/src/include/lwip/apps" in your search path AND you cannot relocate the file. At very least I need to edit the inclusion in fs.c and rename httpd_opts.h in something else.
This before even writing one line of code, enthusiasm evaporated quickly
The positive note is that they introduced a .mk file for everything, very similar to those used in ChibiOS.
Giovanni
I wanted to have httpd_opts.h in the application directory and I discovered:
1) httpd_opts.h is placed together with other headers, OK... let's rename it so it will find my copy.
2) httpd.c includes "lwip/apps/httpd.h" which includes "httpd_opts.h" (without path).
3) fs.c includes "lwip/apps/httpd_opts.h" (with path).
So you need to have both "./ext/lwip/src/include" (empty dir) and "./ext/lwip/src/include/lwip/apps" in your search path AND you cannot relocate the file. At very least I need to edit the inclusion in fs.c and rename httpd_opts.h in something else.
This before even writing one line of code, enthusiasm evaporated quickly
The positive note is that they introduced a .mk file for everything, very similar to those used in ChibiOS.
Giovanni
Re: [INFO] lwIP version 2.0
This might have been another reason I decided to not use the lwip web server.
Will obviously depend on the application, but there are a number of reasons why a different solution might be better:
The lwip server is fine for a basic proof of concept, but IMO its not very useful for the reasons above.
Digressing slightly, there are a number of alternative web servers out there, which generally assume a POSIX or *nix-style interface, and C-style file access functions. So shims to support these within Chibi could be useful. (A sockets-based network interface is also required, which lwip supports)
Will obviously depend on the application, but there are a number of reasons why a different solution might be better:
- It might be desirable to mix files from a ROM-based file system and memory card. In this case the ideal solution is probably something which maps both to the standard C file calls (not difficult)
- It will usually be necessary to embed the current value of some variables into the displayed web page. While this can be done using SSI, my perception (based on code inspection, rather than tests) is that this can be slow. And at least one implementation I came across was buggy
- Some level of security may be required - probably simple digest authorisation will suffice, but it's not supported (SSL is another ballgame, which I've avoided so far)
- If it's required to set values, the POST interface needs to be supported
The lwip server is fine for a basic proof of concept, but IMO its not very useful for the reasons above.
Digressing slightly, there are a number of alternative web servers out there, which generally assume a POSIX or *nix-style interface, and C-style file access functions. So shims to support these within Chibi could be useful. (A sockets-based network interface is also required, which lwip supports)
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [INFO] lwIP version 2.0
The socket interface would add significant overhead over callback API, of course it depends on requirements. I think it is possible to make a mix of ROM files and dynamic files looking at the code.
Probably would be worth spend some time creating a lean solution, even more simple than the lwIP one. I would like to have CGI-like threads that output on a stream and take POST data from the same stream..
Anyway, it is good enough for the demos after patching those issues. I still need to replace all the lwipopts.h files in demos, those are from 1.4.1.
Giovanni
Probably would be worth spend some time creating a lean solution, even more simple than the lwIP one. I would like to have CGI-like threads that output on a stream and take POST data from the same stream..
Anyway, it is good enough for the demos after patching those issues. I still need to replace all the lwipopts.h files in demos, those are from 1.4.1.
Giovanni
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [INFO] lwIP version 2.0
I added a new configuration file to the demo and... it stopped working
I am missing some required setting that was present in the old file...
Giovanni
I am missing some required setting that was present in the old file...
Giovanni
Re: [INFO] lwIP version 2.0
If its any help, here's the config file I'm currently using. Might give a clue.
- Attachments
-
- lwipopts.zip
- (21.13 KiB) Downloaded 221 times
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [INFO] lwIP version 2.0
It helped.
For some reason it does not work with LWIP_TCPIP_CORE_LOCKING=0, it used to work in 1.4.1, I wish to know why...
Giovanni
For some reason it does not work with LWIP_TCPIP_CORE_LOCKING=0, it used to work in 1.4.1, I wish to know why...
Giovanni
Re: [INFO] lwIP version 2.0
I've just run a quick test on my project with LWIP_TCPIP_CORE_LOCKING=0, and it works for me. This is using lwIP 2.0.2, with the interface as submitted some time ago - haven't looked to see how that ended up! Running on a Nucleo-F429.
Bear in mind that I am using solely TCP/IP comms over the lwIP sockets interface - I've got my own comms handlers and web server. Part of the test just done sends a poll to the Nucleo, and gets a modified response - I can do just short of 1000 transactions/second, which I suspect is saturating the network.
I'll try and have a better look, and update lwIP, but probably not until next week.
Bear in mind that I am using solely TCP/IP comms over the lwIP sockets interface - I've got my own comms handlers and web server. Part of the test just done sends a poll to the Nucleo, and gets a modified response - I can do just short of 1000 transactions/second, which I suspect is saturating the network.
I'll try and have a better look, and update lwIP, but probably not until next week.
Re: [INFO] lwIP version 2.0
Updated to use lwip 2.0.3 and the lwip bindings from trunk.
Still using Chibi 17.6.0, so had to change the mailbox calls in sys_arch.c
All works regardless of the value of LWIP_TCPIP_CORE_LOCKING
Still using Chibi 17.6.0, so had to change the mailbox calls in sys_arch.c
All works regardless of the value of LWIP_TCPIP_CORE_LOCKING
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [INFO] lwIP version 2.0
Strange, have you tried the new "multi" demo or your own application?
Giovanni
Giovanni
Return to “Small Change Requests”
Who is online
Users browsing this forum: No registered users and 35 guests