The ESP32 is connected to a router, with a good connection.
The web-page has a 500ms refresh to show real time values updating on a simple web page.
Initially I thought it was working great then realised I have an issue where intermittently (about every 50 seconds) the web-server task hangs from 5 to 20 seconds then catches up again causing a refresh lag on the web page.
I have tried using sockets and LwIP, they both have the same issue. I have set the TCP_NODELAY and also tried turning off the WiFi AMPDU (TX and RX). Tried adjusting the number of WiFi RX/TX buffers and the buffer sizes, tried static and dynamic.
I have tried setting the task priority, the task stack size and even ran it on different cores. Nothing seems to change this. It happens on Chrome and Explorer... I have tried a 2000ms refresh this does not affect the issue.
Below is a sample output with one task outputting the time every second, the webserver task showing socket listening and accepted. You can see the webserver task freeze for 15 seconds then it does a massive catch-up. There are no error codes.
There is no point in posting code as this output is using the example tcp server in IDF 4.3
I also think I have a similar problem using UDP on another project.....
- I (12:41:52.484) dts: Time is Thu Jan 6 12:41:52 2022
I (12:41:52.562) WebServer: Socket accepted ip address: 192.168.1.33
I (12:41:52.567) WebServer: Socket listening
I (12:41:53.179) WebServer: Socket accepted ip address: 192.168.1.33
I (12:41:53.183) WebServer: Socket listening
I (12:41:53.481) dts: Time is Thu Jan 6 12:41:53 2022
I (12:41:53.489) WebServer: Socket accepted ip address: 192.168.1.33
I (12:41:53.493) WebServer: Socket listening
I (12:41:54.105) WebServer: Socket accepted ip address: 192.168.1.33
I (12:41:54.109) WebServer: Socket listening
I (12:41:54.484) dts: Time is Thu Jan 6 12:41:54 2022
I (12:41:55.484) dts: Time is Thu Jan 6 12:41:55 2022
I (12:41:56.484) dts: Time is Thu Jan 6 12:41:56 2022
I (12:41:57.484) dts: Time is Thu Jan 6 12:41:57 2022
I (12:41:58.484) dts: Time is Thu Jan 6 12:41:58 2022
I (12:41:59.484) dts: Time is Thu Jan 6 12:41:59 2022
I (12:42:00.484) dts: Time is Thu Jan 6 12:42:00 2022
I (12:42:01.484) dts: Time is Thu Jan 6 12:42:01 2022
I (12:42:02.484) dts: Time is Thu Jan 6 12:42:02 2022
I (12:42:03.484) dts: Time is Thu Jan 6 12:42:03 2022
I (12:42:04.484) dts: Time is Thu Jan 6 12:42:04 2022
I (12:42:05.484) dts: Time is Thu Jan 6 12:42:05 2022
I (12:42:06.484) dts: Time is Thu Jan 6 12:42:06 2022
I (12:42:07.484) dts: Time is Thu Jan 6 12:42:07 2022
I (12:42:08.484) dts: Time is Thu Jan 6 12:42:08 2022
I (12:42:09.484) dts: Time is Thu Jan 6 12:42:09 2022
I (12:42:09.767) WebServer: Socket accepted ip address: 192.168.1.33
I (12:42:09.771) WebServer: Socket listening
I (12:42:09.789) WebServer: Socket accepted ip address: 192.168.1.33