Pi Zero W - Wifi ping latency within lan not consistent
we use rpi for voip and pbx and everything works fine except if we use the builtin wifi, then for some reason ping latency increases even on LAN and its more erratic when there is a voip call going through the rpi. For multiple calls we use the rpi3 and for single call purpose we are using the rpi zero w, power management is off on both and both on latest firmware and kernel, the strnage thing is if we use those cheap usb nano wifi dongles then those work flawless with latency close to 5-7ms only but with the builtin wifi it starts at 20-30ms and randomly goes upto 50-100ms even when the cpu load is hardly 10%. Power supply for both r beefy
You say that you are using latest kernel and firmware, are these latest with apt-get update or rpi-update
A recent fix by @JamesH65 in the SMSC9514 and BCM fmac drivers may well explain why ping packets are going missing but he has since fixed that...
just today i updated using rpi-update coz till now apt-get update was what i was using but that didnt fix it and with rpi-update also the latency is still high even when pinging from rpi to the internet router.
both the rpi3 and rpi zero w are just next to the WiFi ap and we even tried using a different ap but results r same so for the rpi3 we use Ethernet and for the rpi zero w we r using the cheap realtek 8188 nano dongle which heat up a lot but atleast they work consistently
Does ifconfig show a lot of dropped packets? We've had reports that the dropped packet count has been unusually high since a kernel update about 6 months (guessing) ago. Does the dropped packet count increase when the ping time increases?
the dropped packet issue remains on the Ethernet connection on the rip3 but in my case those dont happen on the wifi connection, ill get u a ping log using the builtin wifi as well as the one with a external wifi dongle to show what i mean shortly.
the Ethernet dropped packet issue is as below, its reduced compared to older versions but is still there RX packets:537935 errors:0 dropped:7618 overruns:0 frame:0 TX packets:338381 errors:0 dropped:0 overruns:0 carrier:0
here is the ping log using inbuilt wifi chip to the internet router, the rpi is right next to the ap, notice the latency goes to 10+ms at times, when the rpi is a 2-3 meters away from the ap that latency goes higher than 30ms randomly:
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. 64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=7.90 ms 64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=8.53 ms 64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=10.3 ms 64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=4.77 ms 64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=5.18 ms 64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=5.18 ms 64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=6.14 ms 64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=4.81 ms 64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=4.84 ms 64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=7.95 ms 64 bytes from 192.168.0.1: icmp_seq=11 ttl=64 time=2.05 ms 64 bytes from 192.168.0.1: icmp_seq=12 ttl=64 time=1.99 ms 64 bytes from 192.168.0.1: icmp_seq=13 ttl=64 time=2.08 ms 64 bytes from 192.168.0.1: icmp_seq=14 ttl=64 time=10.4 ms 64 bytes from 192.168.0.1: icmp_seq=15 ttl=64 time=8.13 ms 64 bytes from 192.168.0.1: icmp_seq=16 ttl=64 time=2.66 ms 64 bytes from 192.168.0.1: icmp_seq=17 ttl=64 time=2.70 ms 64 bytes from 192.168.0.1: icmp_seq=18 ttl=64 time=1.98 ms 64 bytes from 192.168.0.1: icmp_seq=19 ttl=64 time=2.83 ms 64 bytes from 192.168.0.1: icmp_seq=20 ttl=64 time=2.90 ms 64 bytes from 192.168.0.1: icmp_seq=21 ttl=64 time=4.46 ms 64 bytes from 192.168.0.1: icmp_seq=22 ttl=64 time=5.48 ms 64 bytes from 192.168.0.1: icmp_seq=23 ttl=64 time=4.89 ms 64 bytes from 192.168.0.1: icmp_seq=24 ttl=64 time=6.32 ms 64 bytes from 192.168.0.1: icmp_seq=25 ttl=64 time=6.29 ms 64 bytes from 192.168.0.1: icmp_seq=26 ttl=64 time=10.7 ms 64 bytes from 192.168.0.1: icmp_seq=27 ttl=64 time=16.7 ms 64 bytes from 192.168.0.1: icmp_seq=28 ttl=64 time=4.90 ms 64 bytes from 192.168.0.1: icmp_seq=29 ttl=64 time=4.81 ms 64 bytes from 192.168.0.1: icmp_seq=30 ttl=64 time=5.52 ms
there is no dropped packets on the wifi:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:9527 errors:0 dropped:0 overruns:0 frame:0 TX packets:9404 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1843330 (1.7 MiB) TX bytes:2243786 (2.1 MiB)
here is a second try and now ping latency goes upto 200ms:
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. 64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=1.71 ms 64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=4.78 ms 64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=4.13 ms 64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=4.84 ms 64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=7.61 ms 64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=5.02 ms 64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=4.90 ms 64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=8.99 ms 64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=6.30 ms 64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=9.46 ms 64 bytes from 192.168.0.1: icmp_seq=11 ttl=64 time=5.02 ms 64 bytes from 192.168.0.1: icmp_seq=12 ttl=64 time=5.77 ms 64 bytes from 192.168.0.1: icmp_seq=13 ttl=64 time=5.02 ms 64 bytes from 192.168.0.1: icmp_seq=14 ttl=64 time=6.23 ms 64 bytes from 192.168.0.1: icmp_seq=15 ttl=64 time=9.87 ms 64 bytes from 192.168.0.1: icmp_seq=16 ttl=64 time=2.22 ms 64 bytes from 192.168.0.1: icmp_seq=17 ttl=64 time=6.71 ms 64 bytes from 192.168.0.1: icmp_seq=18 ttl=64 time=3.29 ms 64 bytes from 192.168.0.1: icmp_seq=19 ttl=64 time=1.71 ms 64 bytes from 192.168.0.1: icmp_seq=20 ttl=64 time=3.81 ms 64 bytes from 192.168.0.1: icmp_seq=21 ttl=64 time=1.63 ms 64 bytes from 192.168.0.1: icmp_seq=22 ttl=64 time=2.01 ms 64 bytes from 192.168.0.1: icmp_seq=23 ttl=64 time=2.46 ms 64 bytes from 192.168.0.1: icmp_seq=24 ttl=64 time=11.1 ms 64 bytes from 192.168.0.1: icmp_seq=25 ttl=64 time=51.6 ms 64 bytes from 192.168.0.1: icmp_seq=26 ttl=64 time=36.0 ms 64 bytes from 192.168.0.1: icmp_seq=27 ttl=64 time=4.27 ms 64 bytes from 192.168.0.1: icmp_seq=28 ttl=64 time=6.41 ms 64 bytes from 192.168.0.1: icmp_seq=29 ttl=64 time=51.0 ms 64 bytes from 192.168.0.1: icmp_seq=30 ttl=64 time=194 ms 64 bytes from 192.168.0.1: icmp_seq=31 ttl=64 time=20.2 ms 64 bytes from 192.168.0.1: icmp_seq=32 ttl=64 time=16.9 ms 64 bytes from 192.168.0.1: icmp_seq=33 ttl=64 time=42.5 ms 64 bytes from 192.168.0.1: icmp_seq=34 ttl=64 time=2.14 ms 64 bytes from 192.168.0.1: icmp_seq=35 ttl=64 time=3.60 ms 64 bytes from 192.168.0.1: icmp_seq=36 ttl=64 time=1.57 ms 64 bytes from 192.168.0.1: icmp_seq=37 ttl=64 time=2.09 ms 64 bytes from 192.168.0.1: icmp_seq=38 ttl=64 time=1.62 ms 64 bytes from 192.168.0.1: icmp_seq=39 ttl=64 time=2.43 ms 64 bytes from 192.168.0.1: icmp_seq=40 ttl=64 time=9.97 ms 64 bytes from 192.168.0.1: icmp_seq=41 ttl=64 time=1.56 ms 64 bytes from 192.168.0.1: icmp_seq=42 ttl=64 time=4.76 ms 64 bytes from 192.168.0.1: icmp_seq=43 ttl=64 time=4.83 ms 64 bytes from 192.168.0.1: icmp_seq=44 ttl=64 time=5.10 ms
could it be the wifi chip starts getting lower priority on the bus it sends data to the processor when there is just a small CPU spike because when the VoIP call is initiated the cpu is at 10% and combined with other system processes the cpu jumps to 20% once in a while and at that time u see this ping latency shoot up. Problem then is the audio starts lagging by more than 200ms and it takes a while for things to go back to normal probably due to the packet queue on the wifi. This doesnt happen with Ethernet connection even with the dropped packets issue nor does it with a realtek based usb wifi dongle
That's an interesting data point, the Zero's only have the single core, and it's not exactly a speed demon, so other processes needing CPU time will affect the speed with which the Wifi requests can be dealt with. I believe that Wifi does need more CPU cycles than the wired ethernet, or perhaps we need to adjust some priorities somewhere.
On 11 July 2017 at 13:54, xbipin [email protected] wrote:
could it be the wifi chip starts getting lower priority on the bus it sends data to the processor when there is just a small CPU spike because when the VoIP call is initiated the cpu is at 10% and combined with other system processes the cpu jumps to 20% once in a while and at that time u see this ping latency shoot up. Problem then is the audio starts lagging by more than 200ms and it takes a while for things to go back to normal probably due to the packet queue on the wifi. This doesnt happen with Ethernet connection even with the dropped packets issue nor does it with a realtek based usb wifi dongle
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_raspberrypi_firmware_issues_839-23issuecomment-2D314433919&d=DwMFaQ&c=DpyQ_ftY536pf7wCBQXXU58xADDRY77THQzJu1OmzOo&r=w09_2ePv8G3zRjoV19Wm1Q6rI7CDlOns4PuRv2hHkek&m=NQM1jMNWa3LuXqUv8PijImRk45ee3PFy4zlSx069FkY&s=iztOfAhoI1-0skGwBqlIU-7ooTcNve9LdfYpXGBiIYI&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADqrHSp0IOswTFgMEAnVnfD9hcAGSL0gks5sM3BogaJpZM4OTDL1&d=DwMFaQ&c=DpyQ_ftY536pf7wCBQXXU58xADDRY77THQzJu1OmzOo&r=w09_2ePv8G3zRjoV19Wm1Q6rI7CDlOns4PuRv2hHkek&m=NQM1jMNWa3LuXqUv8PijImRk45ee3PFy4zlSx069FkY&s=WEP83CGpNQdt485XGI9iwFbQe7iRsKaY09gg0iON2wI&e= .
-- James Hughes Principal Software Engineer, Raspberry Pi (Trading) Ltd
let me add that the rpi3 and rpi zero w both run the basic raspbian lite image headless with no other packages other than freeswitch which we use for voip and the same behavior appears on both using the builtin wifi but disappears when using the usb wifi dongle. If it was related to cpu cycles then rpi3 wouldnt be affected compared to pi zero w and also why does it happen with a cpu usage of 20% only, it should happen when the cpu is very much busy right?
Ah, OK, I thought you only saw this on the Zero. Maybe not such an interesting data point!
On 11 July 2017 at 16:11, xbipin [email protected] wrote:
let me add that the rpi3 and rpi zero w both run the basic raspbian lite image headless with no other packages other than freeswitch which we use for voip and the same behavior appears on both using the builtin wifi but disappears when using the usb wifi dongle. If it was related to cpu cycles then rpi3 wouldnt be affected compared to pi zero w and also why does it happen with a cpu usage of 20% only, it should happen when the cpu is very much busy right?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_raspberrypi_firmware_issues_839-23issuecomment-2D314475969&d=DwMFaQ&c=DpyQ_ftY536pf7wCBQXXU58xADDRY77THQzJu1OmzOo&r=w09_2ePv8G3zRjoV19Wm1Q6rI7CDlOns4PuRv2hHkek&m=uTM6hsrZmjyTuKPLBEMFPSIk_0o-SBzV4hONHSpQCRg&s=CUA7oO4c5eWpY8D13vr16M3dinvkEq8ug3HXxMX0uRo&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADqrHW4OIi04uaV4-5FLt9ztpmSxvknnp4ks5sM5COgaJpZM4OTDL1&d=DwMFaQ&c=DpyQ_ftY536pf7wCBQXXU58xADDRY77THQzJu1OmzOo&r=w09_2ePv8G3zRjoV19Wm1Q6rI7CDlOns4PuRv2hHkek&m=uTM6hsrZmjyTuKPLBEMFPSIk_0o-SBzV4hONHSpQCRg&s=so8EEb2eXzbzlmc1_Qy2Ye1M0nREAj0k9oU5xcGsEOo&e= .
-- James Hughes Principal Software Engineer, Raspberry Pi (Trading) Ltd
Is it worse on the Zero though? If not, then that implies a different source for the issue than if it is, but either way, I'd be willing to bet it's some combination of hardware and driver code that's causing the issue.
its not worse on zero, its same on both and im having a strong feeling its related to the drivers only. If u have any realtek 8188cu based wifi dongles i recommend u test that and u will notice no matter what the cpu load it still pings happily under 5-7ms consistently always and there is almost no noticeable latency in calls compared to a wired connection
shall i paste a ping output using that usb dongle on the same pi zero?
No, that won't help, just shows that the dongle is working correctly.
On 11 July 2017 at 16:25, xbipin [email protected] wrote:
shall i paste a ping output using that usb dongle on the same pi zero?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/raspberrypi/firmware/issues/839#issuecomment-314480422, or mute the thread https://github.com/notifications/unsubscribe-auth/ADqrHaZ_xY5n2e9fmDWbUrHySsxGl1DAks5sM5PwgaJpZM4OTDL1 .
-- James Hughes Principal Software Engineer, Raspberry Pi (Trading) Ltd
any other way this can be traced, i could provide remote SSH as well if required or if any command that can put the system in debug mode which i can send to get this resolved
Just a warning, the last wireless bug, referred to by Gordon above, took about a month of debugging to find...so don't expect instant results on this one.
On 11 July 2017 at 16:48, xbipin [email protected] wrote:
any other way this can be traced, i could provide remote SSH as well if required or if any command that can put the system in debug mode which i can send to get this resolved
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/raspberrypi/firmware/issues/839#issuecomment-314487643, or mute the thread https://github.com/notifications/unsubscribe-auth/ADqrHRE58iFDYC4-kOR2RiyJcK5hbnnMks5sM5lagaJpZM4OTDL1 .
-- James Hughes Principal Software Engineer, Raspberry Pi (Trading) Ltd
yes i can understand and for now ill continue to use the usb dongle on the zero and Ethernet on the 3. the way i see u can trace this much quicker is if u connect a usb wifi dongle and the builtin wifi to same ap and compare
I am seeing similar but worse issues on the PI Zero W.
The ping times vary a lot and connections get lost.
64 bytes from 192.168.1.47: icmp_seq=737 ttl=64 time=1399 ms 64 bytes from 192.168.1.47: icmp_seq=738 ttl=64 time=919 ms 64 bytes from 192.168.1.47: icmp_seq=739 ttl=64 time=447 ms 64 bytes from 192.168.1.47: icmp_seq=740 ttl=64 time=450 ms 64 bytes from 192.168.1.47: icmp_seq=745 ttl=64 time=2001 ms 64 bytes from 192.168.1.47: icmp_seq=746 ttl=64 time=1002 ms 64 bytes from 192.168.1.47: icmp_seq=747 ttl=64 time=916 ms 64 bytes from 192.168.1.47: icmp_seq=748 ttl=64 time=231 ms 64 bytes from 192.168.1.47: icmp_seq=750 ttl=64 time=634 ms 64 bytes from 192.168.1.47: icmp_seq=753 ttl=64 time=1739 ms 64 bytes from 192.168.1.47: icmp_seq=756 ttl=64 time=1254 ms 64 bytes from 192.168.1.47: icmp_seq=757 ttl=64 time=1760 ms 64 bytes from 192.168.1.47: icmp_seq=758 ttl=64 time=762 ms 64 bytes from 192.168.1.47: icmp_seq=759 ttl=64 time=183 ms 64 bytes from 192.168.1.47: icmp_seq=760 ttl=64 time=166 ms 64 bytes from 192.168.1.47: icmp_seq=761 ttl=64 time=245 ms 64 bytes from 192.168.1.47: icmp_seq=762 ttl=64 time=806 ms 64 bytes from 192.168.1.47: icmp_seq=763 ttl=64 time=1479 ms 64 bytes from 192.168.1.47: icmp_seq=764 ttl=64 time=917 ms 64 bytes from 192.168.1.47: icmp_seq=771 ttl=64 time=652 ms 64 bytes from 192.168.1.47: icmp_seq=772 ttl=64 time=642 ms 64 bytes from 192.168.1.47: icmp_seq=773 ttl=64 time=323 ms 64 bytes from 192.168.1.47: icmp_seq=776 ttl=64 time=941 ms 64 bytes from 192.168.1.47: icmp_seq=778 ttl=64 time=127 ms 64 bytes from 192.168.1.47: icmp_seq=779 ttl=64 time=14.2 ms 64 bytes from 192.168.1.47: icmp_seq=780 ttl=64 time=146 ms 64 bytes from 192.168.1.47: icmp_seq=782 ttl=64 time=1355 ms 64 bytes from 192.168.1.47: icmp_seq=783 ttl=64 time=321 ms 64 bytes from 192.168.1.47: icmp_seq=784 ttl=64 time=461 ms 64 bytes from 192.168.1.47: icmp_seq=785 ttl=64 time=737 ms 64 bytes from 192.168.1.47: icmp_seq=786 ttl=64 time=1614 ms 64 bytes from 192.168.1.47: icmp_seq=787 ttl=64 time=1671 ms 64 bytes from 192.168.1.47: icmp_seq=788 ttl=64 time=673 ms 64 bytes from 192.168.1.47: icmp_seq=789 ttl=64 time=381 ms 64 bytes from 192.168.1.47: icmp_seq=790 ttl=64 time=75.2 ms 64 bytes from 192.168.1.47: icmp_seq=795 ttl=64 time=1450 ms 64 bytes from 192.168.1.47: icmp_seq=796 ttl=64 time=414 ms 64 bytes from 192.168.1.47: icmp_seq=797 ttl=64 time=320 ms 64 bytes from 192.168.1.47: icmp_seq=798 ttl=64 time=449 ms
The wireless here is based on recent AVM products but I have seens this also with other Access Points.
What can be done to analyse and fix this?
I tried it with ubiquiti and mikrotik access point and it's same with both, for now I use a realtek chipset USB dongle