TCP client lwip_connect() takes long time

lemury
Posts: 1
Joined: Tue Feb 24, 2026 8:20 pm

TCP client lwip_connect() takes long time

Postby lemury » Tue Feb 24, 2026 8:27 pm

Hello, New forum user here.

I have an ESP-IDF based multi-client ESP32 TCP socket server connected to my local network via my wifi router.
Several ESP32 devices wake up from deep sleep, connect to wifi, connect to this TCP server and send their sensor data to be stored.

After a few hours these wifi clients start to take a long time to reconnect to the TCP server.
That is; they connect to wifi fast, but take a long time to get out of lwip_connect();

It has something to do with wifi because ethernet connected devices always connect immediately to the server.
Also, once a wifi client has finaly made a TCP connection, closing and reopening it without closing wifi is also immediately.
I use hard coded server IP addresses in the clients so it's not an DHCP issue either.

Restarting the server fixes the problem.
Any suggestion are welcome.
Thank you.

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: TCP client lwip_connect() takes long time

Postby nopnop2002 » Thu Feb 26, 2026 8:36 pm

Restarting the server fixes the problem.
I think this means there is some problem on the TCP server side.

Who is online

Users browsing this forum: Amazon [Bot], Bytespider, Semrush [Bot] and 4 guests