tharada
Posts: 6
Joined: Wed Mar 23, 2016 9:30 pm

WiFi instability with 802.11n routers

Fri Apr 29, 2016 6:43 pm

I'm using a Raspberry Pi 3 as the platform for a project whose requirements include acting as a WiFi access point as well as connecting to a wide variety of WiFi routers. Unfortunately, the WiFi connectivity is very unstable. The most prominent symptom is frequent disassociations from the router, often accompanied by a failure to reassociate. In the worst case, the RPi3 disconnects more than once per minute. Pinging the RPi3 from a machine connected to its software access point results in wildly varying ping times in addition to significant packet loss.

Some example output from wpa_supplicant:

Code: Select all

wlan0: CTRL-EVENT-DISCONNECTED bssid=60:02:92:cd:d9:30 reason=0 locally_generated=1
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
wlan0: Trying to associate with SSID 'MySSID'
wlan0: CTRL-EVENT-ASSOC-REJECT status_code=16
wlan0: Trying to associate with SSID 'MySSID'
wlan0: Associated with 60:02:92:cd:d9:30
wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=US
wlan0: WPA: Key negotiation completed with 60:02:92:cd:d9:30 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 60:02:92:cd:d9:30 completed [id=0 id_str=]
I've tried several fixes that worked for other people, including updating the kernel, disabling power management, setting the regulatory domain, and switching the channel of the router, without any success. Disabling the software AP doesn't help either. However, I've made a couple of interesting discoveries.

Firstly, the instability seems to be affected by use of the built-in Bluetooth, which our project also requires. Running a repeated Bluetooth inquiry greatly increases the rate of disconnects reported by the RPi's wpa_supplicant, and also seems to make it less likely that the reassociation will succeed.

Secondly, the instability only seems to occur on WiFi routers supporting 802.11n. This is based on the following sample, which admittedly isn't very large:
1. Cisco DPC3939B (n) - unstable
2. Cisco Linksys E1200 (n) - unstable
3. Netgear WNDR3400 (n) - unstable in n mode, but stable when limited to 54 Mbit/s.
4. Linksys WAP54G v3 (g) - stable

Based on these observations, I'd like to try limiting the BCM43438 chip's data rate and forcing it to connect as an 802.11g device, but it's not clear whether this is possible using the existing drivers.

Other installation details:
Raspberry Pi 3 Model B with official power supply
No USB devices
Raspbian Jessie from March 2016 with up-to-date packages, rpi-updated to kernel 4.4.6

Any recommendations would be much appreciated.

drewjacks0n
Posts: 1
Joined: Mon May 02, 2016 6:50 pm

Re: WiFi instability with 802.11n routers

Mon May 02, 2016 6:52 pm

Hi-

I'm running into the same issues with a WNDR3400 (n) and two different raspberrypi 3's running rasbpian.

I've disabled power management on the interface, which does not seem to help.

juched
Posts: 1
Joined: Thu May 05, 2016 2:09 am

Re: WiFi instability with 802.11n routers

Thu May 05, 2016 2:22 am

I see to be seeing the similar thing with my Netgear R7000 running Shibby Tomato. Around 2 days in the wifi drops, and in the sys logs I see:

CTRL-EVENT-DISCONNECTED
brcmfmac: brcmf_link_down: WLC_DISASSOC failed (-52)
brcmfmac: send_key_to_dongle: wsec_key error (-52)
...
brcmfmac: brcmf_do_escan: error (-52)
...
wpa_supplicant[506]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
...
brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code

(then I see it scan and re-pick my country code CA)

brcmfmac: _brcmf_set_multicast_list: Setting allmulti failed, -52
brcmfmac: _brcmf_set_multicast_list: Setting BRCMF_C_SET_PROMISC failed, -52
brcmfmac: _brcmf_set_multicast_list: Setting mcast_list failed, -52

Then it seems to never reconnect...

Using sudo ifdown wlan0 followed by sudo ifup wlan0 brings back my connection.

tharada
Posts: 6
Joined: Wed Mar 23, 2016 9:30 pm

Re: WiFi instability with 802.11n routers

Fri May 27, 2016 2:34 pm

Here's some feedback from the linux-wireless mailing list. To summarize the important points: AP mode and Bluetooth should not be used at the same time (though station mode is fine), and limiting the Wi-Fi bit rate of the BCM34348 is not implemented. I've worked around the issue by disabling the Bluetooth interface when devices are connected to the AP. This seems to be sufficient.

broe23
Posts: 903
Joined: Thu Jan 28, 2016 9:35 pm
Location: Central IL
Contact: Website

Re: WiFi instability with 802.11n routers

Sat May 28, 2016 5:31 pm

The antenna is not really great on the Pi 3. You need a way to use an external antenna on a USB Wifi adapter.

Also your wireless A/P has to be on a non-congrsted channel. Set for 40 mhz Channel Bandwidth.

I use Channel 1 for my lower and 5 for the upper on the Engenius ECB350 that I have. I am only running Wireless-N on it.
Ren: Now listen, Cadet. I've got a job for you. See this button? Ren: Don't touch it! It's the History Eraser button, you fool! Stimpy: So what'll happen? Ren: That's just it. We don't know. Maybe something bad, maybe something good.

saspus
Posts: 1
Joined: Fri Jun 03, 2016 11:14 pm

Re: WiFi instability with 802.11n routers

Fri Jun 03, 2016 11:27 pm

Another observation:

I have two routers - one is 802.11n Airport Extreme (3rd gen) and the other Linksys WRT54GS with Tomato firmware.

I have found that the issue is not related to which router it attempts to connect to, but rather to the wireless channel.

It works rather reliably on channels 1-3; not so reliably on channels 6-10 and it could never associate on channel 11 - to neither base stations. There is an "ctrl-event-ssid-reject" with reason code "16" in the log when this happens.

(I have WiFi region set to US (which is 1-11 channels), so the channel 11 should work)

I could not find the meaning of the code 16 though. Any ideas?

Return to “Troubleshooting”