From 865ee21b643e718ef35b22dad1a62a5377a73a4e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Jan 2026 01:39:05 +0000 Subject: [PATCH] Add TCP/IP stack tuning for better WiFi throughput Configure lwIP stack with larger buffers: - TCP_MSS: 1460 (full ethernet frame) - TCP send/receive buffers: 5744 bytes (4x MSS) - Increased mailbox sizes for better packet queuing - Enable out-of-order segment queuing Note: The ~200 KB/s limit appears to be inherent to the synchronous ESP32 WebServer library. For significantly higher speeds (500KB-1MB/s), consider migrating to ESPAsyncWebServer or raw TCP sockets. --- platformio.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platformio.ini b/platformio.ini index 75d1a77b..b9128b08 100644 --- a/platformio.ini +++ b/platformio.ini @@ -28,6 +28,13 @@ build_flags = -std=c++2a # Enable UTF-8 long file names in SdFat -DUSE_UTF8_LONG_NAMES=1 +# TCP/IP stack tuning for better WiFi upload performance + -DCONFIG_LWIP_TCP_MSS=1460 + -DCONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 + -DCONFIG_LWIP_TCP_WND_DEFAULT=5744 + -DCONFIG_LWIP_TCP_RECVMBOX_SIZE=12 + -DCONFIG_LWIP_TCP_QUEUE_OOSEQ=1 + -DCONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 ; Board configuration board_build.flash_mode = dio