WiFi AP erratic ping and TCP retransmission

tized_m
Posts: 1
Joined: Tue May 21, 2019 4:35 pm

WiFi AP erratic ping and TCP retransmission

Postby tized_m » Tue May 21, 2019 4:49 pm

Hello,

I've been running into some trouble with WiFi throughput on the ESP32. Trying to stream data from a ESP32 configured as an AP to a PC station just a few cm away, I get hiccups and delays that reduce the bitrate. Analyzing the stream with Wireshark I see many "TCP Spurious Retransmissions" and using 'ping' shows some large RTTs and 5%-10% packet loss:

Code: Select all

> ping -c 100 -s 1024 10.138.0.1
PING 10.138.0.1 (10.138.0.1) 1024(1052) bytes of data.
1032 bytes from 10.138.0.1: icmp_seq=1 ttl=255 time=23.5 ms
1032 bytes from 10.138.0.1: icmp_seq=2 ttl=255 time=15.0 ms
1032 bytes from 10.138.0.1: icmp_seq=3 ttl=255 time=13.1 ms
1032 bytes from 10.138.0.1: icmp_seq=4 ttl=255 time=14.4 ms
1032 bytes from 10.138.0.1: icmp_seq=5 ttl=255 time=12.6 ms
1032 bytes from 10.138.0.1: icmp_seq=6 ttl=255 time=27.9 ms
1032 bytes from 10.138.0.1: icmp_seq=7 ttl=255 time=14.6 ms
1032 bytes from 10.138.0.1: icmp_seq=8 ttl=255 time=16.5 ms
1032 bytes from 10.138.0.1: icmp_seq=9 ttl=255 time=15.4 ms
1032 bytes from 10.138.0.1: icmp_seq=10 ttl=255 time=9.27 ms
1032 bytes from 10.138.0.1: icmp_seq=11 ttl=255 time=29.0 ms
1032 bytes from 10.138.0.1: icmp_seq=12 ttl=255 time=4.96 ms
1032 bytes from 10.138.0.1: icmp_seq=13 ttl=255 time=58.7 ms
1032 bytes from 10.138.0.1: icmp_seq=14 ttl=255 time=35.7 ms
1032 bytes from 10.138.0.1: icmp_seq=15 ttl=255 time=15.1 ms
1032 bytes from 10.138.0.1: icmp_seq=16 ttl=255 time=39.9 ms
1032 bytes from 10.138.0.1: icmp_seq=17 ttl=255 time=6.08 ms
1032 bytes from 10.138.0.1: icmp_seq=18 ttl=255 time=7.78 ms
1032 bytes from 10.138.0.1: icmp_seq=19 ttl=255 time=5.27 ms
1032 bytes from 10.138.0.1: icmp_seq=21 ttl=255 time=14.9 ms
1032 bytes from 10.138.0.1: icmp_seq=22 ttl=255 time=79.9 ms
1032 bytes from 10.138.0.1: icmp_seq=23 ttl=255 time=59.8 ms
1032 bytes from 10.138.0.1: icmp_seq=24 ttl=255 time=42.7 ms
1032 bytes from 10.138.0.1: icmp_seq=25 ttl=255 time=215 ms
1032 bytes from 10.138.0.1: icmp_seq=27 ttl=255 time=5.17 ms
1032 bytes from 10.138.0.1: icmp_seq=28 ttl=255 time=5.12 ms
1032 bytes from 10.138.0.1: icmp_seq=29 ttl=255 time=8.60 ms
1032 bytes from 10.138.0.1: icmp_seq=31 ttl=255 time=20.6 ms
1032 bytes from 10.138.0.1: icmp_seq=32 ttl=255 time=42.7 ms
1032 bytes from 10.138.0.1: icmp_seq=34 ttl=255 time=22.6 ms
1032 bytes from 10.138.0.1: icmp_seq=35 ttl=255 time=70.8 ms
1032 bytes from 10.138.0.1: icmp_seq=36 ttl=255 time=202 ms
1032 bytes from 10.138.0.1: icmp_seq=37 ttl=255 time=4.71 ms
1032 bytes from 10.138.0.1: icmp_seq=38 ttl=255 time=4.71 ms
1032 bytes from 10.138.0.1: icmp_seq=39 ttl=255 time=5.99 ms
1032 bytes from 10.138.0.1: icmp_seq=40 ttl=255 time=59.2 ms
1032 bytes from 10.138.0.1: icmp_seq=41 ttl=255 time=74.6 ms
1032 bytes from 10.138.0.1: icmp_seq=42 ttl=255 time=55.6 ms
1032 bytes from 10.138.0.1: icmp_seq=43 ttl=255 time=46.1 ms
1032 bytes from 10.138.0.1: icmp_seq=44 ttl=255 time=78.0 ms
1032 bytes from 10.138.0.1: icmp_seq=45 ttl=255 time=26.5 ms
1032 bytes from 10.138.0.1: icmp_seq=46 ttl=255 time=52.5 ms
1032 bytes from 10.138.0.1: icmp_seq=47 ttl=255 time=5.40 ms
1032 bytes from 10.138.0.1: icmp_seq=48 ttl=255 time=6.71 ms
1032 bytes from 10.138.0.1: icmp_seq=49 ttl=255 time=4.62 ms
1032 bytes from 10.138.0.1: icmp_seq=50 ttl=255 time=82.6 ms
1032 bytes from 10.138.0.1: icmp_seq=51 ttl=255 time=86.2 ms
1032 bytes from 10.138.0.1: icmp_seq=52 ttl=255 time=52.3 ms
1032 bytes from 10.138.0.1: icmp_seq=53 ttl=255 time=68.2 ms
1032 bytes from 10.138.0.1: icmp_seq=54 ttl=255 time=53.5 ms
1032 bytes from 10.138.0.1: icmp_seq=55 ttl=255 time=93.4 ms
1032 bytes from 10.138.0.1: icmp_seq=57 ttl=255 time=4.99 ms
1032 bytes from 10.138.0.1: icmp_seq=58 ttl=255 time=7.61 ms
1032 bytes from 10.138.0.1: icmp_seq=59 ttl=255 time=6.48 ms
1032 bytes from 10.138.0.1: icmp_seq=60 ttl=255 time=8.66 ms
1032 bytes from 10.138.0.1: icmp_seq=61 ttl=255 time=76.1 ms
1032 bytes from 10.138.0.1: icmp_seq=62 ttl=255 time=14.9 ms
1032 bytes from 10.138.0.1: icmp_seq=63 ttl=255 time=39.3 ms
1032 bytes from 10.138.0.1: icmp_seq=64 ttl=255 time=76.0 ms
1032 bytes from 10.138.0.1: icmp_seq=65 ttl=255 time=87.7 ms
1032 bytes from 10.138.0.1: icmp_seq=66 ttl=255 time=60.6 ms
1032 bytes from 10.138.0.1: icmp_seq=67 ttl=255 time=6.83 ms
1032 bytes from 10.138.0.1: icmp_seq=68 ttl=255 time=8.25 ms
1032 bytes from 10.138.0.1: icmp_seq=69 ttl=255 time=4.63 ms
1032 bytes from 10.138.0.1: icmp_seq=71 ttl=255 time=19.8 ms
1032 bytes from 10.138.0.1: icmp_seq=72 ttl=255 time=63.7 ms
1032 bytes from 10.138.0.1: icmp_seq=73 ttl=255 time=111 ms
1032 bytes from 10.138.0.1: icmp_seq=74 ttl=255 time=24.8 ms
1032 bytes from 10.138.0.1: icmp_seq=75 ttl=255 time=243 ms
1032 bytes from 10.138.0.1: icmp_seq=76 ttl=255 time=75.1 ms
1032 bytes from 10.138.0.1: icmp_seq=77 ttl=255 time=5.84 ms
1032 bytes from 10.138.0.1: icmp_seq=78 ttl=255 time=4.51 ms
1032 bytes from 10.138.0.1: icmp_seq=79 ttl=255 time=4.77 ms
1032 bytes from 10.138.0.1: icmp_seq=81 ttl=255 time=37.0 ms
1032 bytes from 10.138.0.1: icmp_seq=82 ttl=255 time=198 ms
1032 bytes from 10.138.0.1: icmp_seq=83 ttl=255 time=51.3 ms
1032 bytes from 10.138.0.1: icmp_seq=84 ttl=255 time=71.1 ms
1032 bytes from 10.138.0.1: icmp_seq=85 ttl=255 time=91.1 ms
1032 bytes from 10.138.0.1: icmp_seq=86 ttl=255 time=102 ms
1032 bytes from 10.138.0.1: icmp_seq=87 ttl=255 time=9.20 ms
1032 bytes from 10.138.0.1: icmp_seq=88 ttl=255 time=40.6 ms
1032 bytes from 10.138.0.1: icmp_seq=89 ttl=255 time=7.60 ms
1032 bytes from 10.138.0.1: icmp_seq=90 ttl=255 time=4.50 ms
1032 bytes from 10.138.0.1: icmp_seq=91 ttl=255 time=4.84 ms
1032 bytes from 10.138.0.1: icmp_seq=92 ttl=255 time=19.3 ms
1032 bytes from 10.138.0.1: icmp_seq=93 ttl=255 time=41.8 ms
1032 bytes from 10.138.0.1: icmp_seq=94 ttl=255 time=20.8 ms
1032 bytes from 10.138.0.1: icmp_seq=95 ttl=255 time=16.9 ms
1032 bytes from 10.138.0.1: icmp_seq=96 ttl=255 time=9.07 ms
1032 bytes from 10.138.0.1: icmp_seq=97 ttl=255 time=5.02 ms
1032 bytes from 10.138.0.1: icmp_seq=98 ttl=255 time=8.38 ms
1032 bytes from 10.138.0.1: icmp_seq=99 ttl=255 time=168 ms
1032 bytes from 10.138.0.1: icmp_seq=100 ttl=255 time=166 ms

--- 10.138.0.1 ping statistics ---
100 packets transmitted, 93 received, 7% packet loss, time 99225ms
rtt min/avg/max/mdev = 4.500/43.539/243.487/50.236 ms
Is there any specific configurations that can improve and stabilize WiFi performance?

Edit 26/5/2019: The above results were from the Sparkfun ESP32 Thing. On Core Board V2 the problem does't reproduce. Could this be an issue the 26MHz xtal on the ESP32 Thing versus the 40MHz xtal on the Core Board?

Thanks

Who is online

Users browsing this forum: No registered users and 159 guests