Is there any way to change the TCP send buffer size (TCP_SND_BUF) on this module ?

Now it is equal to TCP_SND_BUF = 2 * TCP_MSS = 2 * 1460 = 2920.

Editing lwipopts.h doesn't make any difference.

The same question applies to ΤCP_MSS, TCP_WND etc.

I am using v2 Higher Bandwidth variant. Platform is Microchip Studio with vMicro Arduino addon.

2 Answers 2


No, you can't.

The macro you are trying to tweak is for reference only and does not control the size of the buffer.

On the ESP8266 the IP stack (and much of the rest of the system) is precompiled as .a libraries. Changing things like the TCP_SND_BUF macro will never change what has been compiled into those libraries. Instead all it will do is cause problems of buffer overruns and corrupted data as other code is then given incorrect information about the size of the buffer.


I finally figured it out the hard way :


Install Git for windows (https://git-scm.com/download/win)

Install MinGW for windows (https://sourceforge.net/projects/mingw)

In MinGW installation manager, enable:

  • mingw-developer-toolkit
  • mingw32-base
  • mingw32-gcc-g++
  • msys-base

(not sure if all are necessary but just in case)

put C:\MinGW\bin in Windows PATH (check this https://www.rapidee.com)

reboot PC

rename C:\MinGW\bin\mingw32-make.exe to C:\MinGW\bin\make.exe

open bash terminal (just type bash in run)

(from now on assume that hardware files are in \Documents\Arduino\hardware\esp8266com\esp8266)

go to \tools\sdk\lwip2

optional: change lwip options in \tools\sdk\lwip2\builder\glue-lwip\arduino\lwipopts.h

(caution : NOT \tools\sdk\lwip2\include\lwipopts.h, this will be overwritten !)

type in bash: make install to build libraries in \esp8266com\esp8266\tools\sdk\lwip2\builder

type in bash: make clean to clean \esp8266com\esp8266\tools\sdk\lwip2\builder

finally copy new libraries to \esp8266com\esp8266\tools\sdk\lib


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.