ESP32 running a webserver, connection times out on PC, work fine on phone

Hello everyone,

I have a strange issue. For a long time I was looking into why my ESP32 is soooo slow that my browser times out. Even curl -vvvv shows that it can take more than 10 seconds to just establish a TCP connection.

The ESP is running a pretty basic HTTPS webserver (using the ESP-IDF’s httpd/httpsd).

But just now I realized that connecting from my phone works fine. I even have logs from the ESP every time it gets a request and I can send requests fine from my phone and receive responses pretty fast (especially once the TCP connection is already established).

So somehow my PC is sending the requests differently (even establishing the connection differently). but I don’t know what could be causing it, I have the same issue with both PCs I own. They are all on the same wifi network, I ruled out interference because I tried to access the webserver from both my PC and my phone at the same time and I can make plenty of requests while the PC’s curl is still opening a TCP connection. Any idea what else I can try or test to figure this out?

Thank you in advance! I’m going nuts over this!

Edit: Or it could be the ESP32 responding to the packets from the PC slower in some way? But not sure how, since the packets should be the same whether coming from the PC or from the phone (apart from the source IP address of course).

Is the behavior the same when you use ESP-IDFs native build system / setup? If yes, file an issue at GitHub - espressif/esp-idf: Espressif IoT Development Framework. Official development framework for Espressif SoCs.. If no, file an issue with a reproducable project at GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO.