Slow response from ESP32-S2 Webserver

Miraculix
Posts: 20
Joined: Wed Sep 16, 2020 9:43 am

Slow response from ESP32-S2 Webserver

Postby Miraculix » Wed Sep 16, 2020 9:55 am

Using the HelloServer.ino example on a ESP32-S2 Wrover I get slow responses when pointing my browser at the ESP32-S2 IP address.

A similar server (with ESP8266 default libraries) running on an ESP-12F has reasonable response times.

According to the network request monitor in Firefox, connecting takes 600ms. Then there is a wait period of over 2000ms. After that, receiving takes 0ms (so it's most likely not a connection speed problem).

Any ideas what could cause this, if it's not a connection speed problem?

Interesting is the ping response from the ESP32-S2:

Code: Select all

ping 192.168.0.29
PING 192.168.0.29 (192.168.0.29) 56(84) bytes of data.
64 bytes from 192.168.0.29: icmp_seq=1 ttl=255 time=84.2 ms
64 bytes from 192.168.0.29: icmp_seq=2 ttl=255 time=1085 ms
64 bytes from 192.168.0.29: icmp_seq=3 ttl=255 time=77.4 ms
64 bytes from 192.168.0.29: icmp_seq=4 ttl=255 time=1074 ms
64 bytes from 192.168.0.29: icmp_seq=5 ttl=255 time=60.3 ms
64 bytes from 192.168.0.29: icmp_seq=6 ttl=255 time=1057 ms
64 bytes from 192.168.0.29: icmp_seq=7 ttl=255 time=43.9 ms
64 bytes from 192.168.0.29: icmp_seq=8 ttl=255 time=1043 ms
Maybe it's related?

I'm using the esp32s2 tree of the Arduino IDE, downloaded a few days ago from here: https://github.com/espressif/arduino-esp32/tree/esp32s2

Edit: Try disabling WIFI powersaving, but it didn't change anything

Code: Select all

esp_wifi_set_ps(WIFI_PS_NONE);

Miraculix
Posts: 20
Joined: Wed Sep 16, 2020 9:43 am

Re: Slow response from ESP32-S2 Webserver

Postby Miraculix » Wed Sep 16, 2020 4:11 pm

Additional infos:

* The first connection after resetting the board sometimes produces an immediate response.

* When I set a static IP in WiFi config, the device connects to the router but does not respond to TCP or ping requests (maybe related?). It only works when letting DHCP choose the IP address.

* I designed the PCB myself. Here is the schematic and PCB: https://easyeda.com/Miraculix200/esp32-s2-test

* Adding a 1000uF electrolytic capacitor doesn't change anything

Miraculix
Posts: 20
Joined: Wed Sep 16, 2020 9:43 am

Re: Slow response from ESP32-S2 Webserver

Postby Miraculix » Thu Sep 17, 2020 7:24 pm

Another thing I've tried: Adding a 100nF capacitor on the 3.3V net

And I just discovered that if I don't connect my browser to the webserver after resetting, the ping response times look better than on my ESP-12F:

Code: Select all

64 bytes from 192.168.0.29: icmp_seq=61 ttl=255 time=2.37 ms
64 bytes from 192.168.0.29: icmp_seq=62 ttl=255 time=2.17 ms
64 bytes from 192.168.0.29: icmp_seq=63 ttl=255 time=2.57 ms
64 bytes from 192.168.0.29: icmp_seq=64 ttl=255 time=2.66 ms
64 bytes from 192.168.0.29: icmp_seq=65 ttl=255 time=2.38 ms
^C
--- 192.168.0.29 ping statistics ---
65 packets transmitted, 65 received, 0% packet loss, time 64112ms
rtt min/avg/max/mdev = 2.084/4.244/18.381/3.221 ms
So I guess that rules out a hardware problem.

When loading the page with my browser, the ping repsonse times get larger again.

Miraculix
Posts: 20
Joined: Wed Sep 16, 2020 9:43 am

Re: Slow response from ESP32-S2 Webserver

Postby Miraculix » Sat Sep 19, 2020 8:20 am

The problem has been solved by adding a delay(1) in handleClient() or loop(): https://github.com/espressif/arduino-es ... -695115885

Who is online

Users browsing this forum: Basalt and 49 guests