- Mon Apr 22, 2019 3:36 am
I have made another step in "sanitising" LWIP (from Espressif).
Like proposed earlier, I now actually did it: take the nearest LWIP version to the one Espressif used in their "fork" (which appears to be 1.4.1), find all the differences between that version and the one that Espressif ships and then incoorporate the changes that are really needed to make LWIP work with the "eagle" SoC netif into it. All nonsense changes, including lots of debug stuff that was never cleaned up and some "improvements" that are really not, I dropped.
The result is here: https://github.com/eriksl/lwip-for-esp8266-nonos-sdk
And yes it works
At least the modules I am using myself (others I can't test): TCP, UDP, ICMP. I am not using DNS, MDNS, SNTP.
This should be a good starting point for step-by-step cherry-picking the commits from the LWIP master branch that should lead to 2.0 and further (and fixing all the conflicts
This repository is a 1:1 mirror of the "real stuff", with only minimal (marked) patches, so there are also no Makefiles. You're supposed to add the source files to your own Makefile (which works quite well I think).
I have changed a few (default) options that are required for building LWIP for the ESP8266. All other options I've left to their initial LWIP defaults. This mean, I think, that it should be not that difficult to use it in a random project. Git add submodule, add file "lwiptops.h" file in your top directory that has overrides for the default options (none really needed, it's ok to leave it empty) and add the LWIP *.c files that you need to your Makefile. Add <lwip>/src/ipv4/include and <lwip>/src/include to the cc -I flags.
The MDNS and SNTP source code files do not belong to LWIP actually, so I removed them. If you want to use them, copy them somewhere in your project yourself.
The interesting thing is that since I started this operation, from the point where I was using espconn to now my highly minimalised version of LWIP, the network response has improved greatly. It has become quite a bit faster and I'm not getting any of these broken tcp connections anymore.