Skip to content

Conversation

@dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Sep 3, 2025

Remove some lower-valued LWIP settings in sdkconfig.defaults on espressif. In particular, removed:

CONFIG_LWIP_MAX_ACTIVE_TCP=4
CONFIG_LWIP_MAX_LISTENING_TCP=4

These settings restricted the number of usable sockets. It looks like LWIP might have started paying more attention to these when it was updated in in ESP-IDF 5.4.1.

These were all removed:

CONFIG_LWIP_MAX_ACTIVE_TCP=4
CONFIG_LWIP_MAX_LISTENING_TCP=4
CONFIG_LWIP_TCP_SYNMAXRTX=6
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=2880
CONFIG_LWIP_TCP_WND_DEFAULT=2880
CONFIG_LWIP_TCP_RTO_TIME=3000

Reading Kconfig, it appears the defaults were reasonable, and we might get better performance using the defaults (which are computed in some cases).

Thanks @anecdata for the issue and for the clue re the CONFIG_LWIP_MAX... settings.

@jbrelwof
Copy link

jbrelwof commented Sep 3, 2025

@dhalbert were you able to reproduce the initial problem and then verify that this fixed it? If not, I could probably build & test this on a Lolin S2 or S3 mini

@dhalbert
Copy link
Collaborator Author

dhalbert commented Sep 3, 2025

Yes, I reproduced the problem easily with the test program in #10606, and verified this fixes it.

@dhalbert dhalbert requested a review from tannewt September 3, 2025 20:59
Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the minimal example, and with an async example with 2-3 servers and the remainder of the sockets as clients, and all of the connections get made. Thanks, Dan!

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit b0a7ca2 into adafruit:main Sep 3, 2025
247 checks passed
@dhalbert dhalbert deleted the use-lwip-defaults branch September 3, 2025 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CP 10 has 4 stream sockets; CP 9 had 8

4 participants