I have set up a raspberry pi as a wifi access point. At this point, all I want to do is ssh the rpi. I'm finding that the ssh sessions hang for 5-30 seconds ever 1 to 6 minutes or so. My laptop is the only client connected to the AP. If I set up a continuous ping from my laptop to the AP address, the average ping time is around 1-4ms, but then every so often, excessive delays of around 100-500ms or timeouts for up to 5-30 seconds will occur. This occurs whether there is an ssh session active or not. By comparison, if I ping the ethernet port, all delays are 1ms or less and I have no timeouts. I have tried changing channels with no benefit.
What is interesting is that if I disable wifi 'n' mode (now running in g), wmm and ht_capab in hostapd.conf, I greatly improve the situation with very few (if any) timeouts. With these disabled, usual ping times are 1-2ms with occasional delay of 120ms.
lsmod shows the following modules:
-Module Size Used by
-aes_generic 31536 1
-8021q 17966 0
-garp 6295 1 8021q
-stp 1969 1 garp
-llc 5440 2 stp,garp
-snd_bcm2835 15846 0
-snd_pcm 77560 1 snd_bcm2835
-snd_page_alloc 5145 1 snd_pcm
-snd_seq 53329 0
-snd_seq_device 6438 1 snd_seq
-snd_timer 19998 2 snd_pcm,snd_seq
-snd 58447 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
-arc4 1676 2
-rt2800usb 14940 0
-rt2800lib 55351 1 rt2800usb
-rt2x00usb 11215 1 rt2800usb
-rt2x00lib 42334 3 rt2x00usb,rt2800lib,rt2800usb
-mac80211 273413 3 rt2x00lib,rt2x00usb,rt2800lib
-cfg80211 184163 2 mac80211,rt2x00lib
-rfkill 18202 2 cfg80211
-crc_ccitt 1522 1 rt2800lib
-leds_gpio 2235 0
-led_class 3562 2 leds_gpio,rt2x00lib
hostapd.conf
-interface=wlan0
-driver=nl80211
-ctrl_interface_group=0
-ssid=ivoPI
-hw_mode=g
-ieee80211n=1
-wmm_enabled=1
-channel=5
-#macaddr_acl=0
-auth_algs=3
-#ignore_broadcast_ssid=0
-wpa=3
-wpa_passphrase=*******
-wpa_key_mgmt=WPA-PSK
-wpa_pairwise=TKIP
-rsn_pairwise=CCMP
-ht_capab=[HT20][SHORT-GI-20] #[RX-STBC1]
If anyone can help out here, it would be greatly appreciated. cheers
Ivo
Further to the above:
I have now tried the wifi adapter above, along with another, in client mode. The first adapter has rt3072 chip with rtl2800usb / cfg80211 driver. The second adapter has a Realtek rtl8188us chip with r8712u staging driver. Each adapter (separately), was connected to a powered hub. The pi didn't have the Ethernet connected.
First adapter With low processor load and no shell or shell with no traffic, there was no typical ping results. Delays appeared to be totally random from 2ms to 320ms - all over the place. There were occasional timeouts. When top was run at 0.01 sec, pings became very steady at 2-3ms with occasional single ping delays of 195-222ms. I observed on timeout 5 sec over a period of about 20 minutes.
second adaptor With low processor load and no shell or shell with no traffic, typical ping results were 1-2ms. Ping results were generally very stable. Under load - top running 0.01 sec, ping delay was around 2-3ms with occasional 166-200ms single ping delays. I didn't observe any timeouts.
So what does one conclude from this? It looks to me to be a driver problem with rtl2800usb / cfg80211 or some other related component. One could almost fix the problem by running top continuously, but it does seem kind of wasteful!! and I do still get the occasional timeout. I don't know yet whether it was the higher processor load or the increased tcp/ip traffic that made the improvement.