Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By kadamski
#8883 I've created a project on github that aims on providing open source LwIP library for ESP8266. It's of course based on Espressif code drop in SDK 0.9.4 but it's put on top of official LwIP git, is splited in small and readable commits and have simple Makefile. Here's the link:
https://github.com/kadamski/esp-lwip

I only tested building this on Linux. If somebody could tell me what has to be changed so it can be compiled on Linux, please contact me. Comments, pull requests and bug reports are welcome.
User avatar
By pvvx
#9664
kadamski wrote:The project has different goals but is still interesting, indeed. I'll take a look at it in spare time.

espconn in your project has a lot of errors.
Or delete or insert espconn correction...
viewtopic.php?p=8297#p8297

You need to insert test before any appeal to the lwip pcb, when user call is not called of Lwip and espconn use old pointer to the current pcb. Old pointer (saved espconn) should be checked to remote ip:port and local ip:port from LwIP. If esp_tcp.remote_port, esp_tcp.local_port, esp_tcp.local_ip, esp_tcp.remote_ip not equal tcp_pcb.remote_port ... signal an error and close esp_tcp. Otherwise espconn climb into someone else's connection (or into closed pcb).
To do this, SDK 0.9.5 added ( + espconn_find_current_pcb() ):
Code: Select alltypedef struct _esp_tcp {
    int remote_port;
    int local_port;
    uint8 local_ip[4];
    uint8 remote_ip[4];
   espconn_connect_callback connect_callback;
   espconn_reconnect_callback reconnect_callback;
   espconn_connect_callback disconnect_callback;
} esp_tcp;