Skip to content

Commit

Permalink
Revert back to plo default arduino framework and keep custom LwIP
Browse files Browse the repository at this point in the history
Settings changes for LwIP

bounjour-hap sometimes sends massive fragmented mdns packets
Change to the no-feature version of LwIP to  disable all fragmenting
and reassembly of packets.

If the TCP client suddenly goes away, LwIP will continue to send TCP
retries for about 30 minutes. This can consume up to about 4k of heap.
Use a custom lwip library that sets max tcp retries to 2, which will
quickly close the connection and free up memory in this scenerio.
  • Loading branch information
jgstroud committed May 23, 2024
1 parent 6442b8c commit 64e137c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/lwip2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Custom LWIP build
This library is an exact copy of the one used in the PlatformIO Arduino framework but sets the maximum number of TCP retries to 2.

This library was built from:
https://github.com/jgstroud/Arduino/tree/maxrtx

Binary file added lib/lwip2/liblwip2-536.a
Binary file not shown.
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ board_build.filesystem = littlefs
[env:ratgdo_esp8266_hV25]
framework = arduino
platform = espressif8266
platform_packages =
framework-arduinoespressif8266 @ https://github.com/jgstroud/Arduino.git#maxrtx
board = d1_mini
board_build.ldscript = eagle.flash.4m2m.ld
build_flags =
-Llib/lwip2
-llwip2-536
${env.build_flags}
'-fconcepts-ts'
-D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
Expand Down

0 comments on commit 64e137c

Please sign in to comment.