You are not logged in.

#1 2012-03-06 18:00:38

sinorev
Member
Registered: 2012-03-06
Posts: 13

ath9k wireless works but disconnects frequently [SOLVED]

Hi all,

I'm running kernel 3.2.9 with nl80211, wext, and all ath9k drivers compiled as modules. I have rfkill, iw, CRDA, wireless-regdb, dhcpcd, and wpa_supplicant installed for the actual connection. Everything works well; however, the connection is dropped every 3-5 minutes. It manages to reconnect and re authenticate, but I can tell that there is a blip whenever this occurs. For example, I will be typing in vim and the cursor / key input won't move for a few seconds, then everything's back to normal. I don't see any explicit errors when this is occurring either. Signal strength is pretty good and when it works, connection speed is pretty fast. This occurs regardless whether I am using wext or nl80211 as wpa_supplicant's driver.


Here's the output from wpa_supplicant with wext:

[root@localhost ~]# iwconfig wlan0 power off
[root@localhost ~]# iwconfig wlan0 txpower 19dBm
[root@localhost ~]# iwconfig wlan0 rts auto
[root@localhost ~]# iwconfig wlan0 frag auto
[root@localhost ~]# iwconfig wlan0 rate 1M fixed
[root@localhost ~]# wpa_supplicant -i wlan0 -Dwext -c /etc/wpa_supplicant.conf
Trying to associate with 00:24:a5:6f:7b:e0 (SSID='myAP' freq=2422 MHz)
Associated with 00:24:a5:6f:7b:e0
WPA: Key negotiation completed with 00:24:a5:6f:7b:e0 [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:24:a5:6f:7b:e0 completed
(auth) [id=0 id_str=]

[~5 minutes later]

CTRL-EVENT-DISCONNECTED bssid=00:24:a5:6f:7b:e0 reason=0
Trying to associate with 00:24:a5:6f:7b:e0 (SSID='myAP' freq=2422 MHz)
Associated with 00:24:a5:6f:7b:e0
WPA: Key negotiation completed with 00:24:a5:6f:7b:e0 [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:24:a5:6f:7b:e0 completed
(reauth) [id=0 id_str=]

Here's the output from wpa_supplicant with nl80211 (note the difference in the CTRL-EVENT-DISCONNECTED reason code)

[root@localhost ~]# wpa_supplicant -i wlan0 -Dnl80211 -c /etc/wpa_supplicant.conf
Trying to authenticate with 00:24:a5:6f:7b:e0 (SSID='myAP' freq=2422 MHz)
Trying to associate with 00:24:a5:6f:7b:e0 (SSID='myAP' freq=2422 MHz)
Associated with 00:24:a5:6f:7b:e0
WPA: Key negotiation completed with 00:24:a5:6f:7b:e0 [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:24:a5:6f:7b:e0 completed (auth) [id=0 id_str=]

[~5 minutes later]

CTRL-EVENT-DISCONNECTED bssid=00:24:a5:6f:7b:e0 reason=4
Trying to authenticate with 00:24:a5:6f:7b:e0 (SSID='myAP' freq=2422 MHz)
Trying to associate with 00:24:a5:6f:7b:e0 (SSID='myAP' freq=2422 MHz)
Associated with 00:24:a5:6f:7b:e0
WPA: Key negotiation completed with 00:24:a5:6f:7b:e0 [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:24:a5:6f:7b:e0 completed
(reauth) [id=0 id_str=]

Any ideas?

Thanks in advance!

Last edited by sinorev (2012-04-05 16:22:34)

Offline

#2 2012-03-07 09:38:11

hadrons123
Member
From: chennai
Registered: 2011-10-07
Posts: 1,249

Re: ath9k wireless works but disconnects frequently [SOLVED]

There is a similar thread. try this

https://bbs.archlinux.org/viewtopic.php?pid=1040748


LENOVO Y 580 IVYBRIDGE 660M NVIDIA
Unix is user-friendly. It just isn't promiscuous about which users it's friendly with. - Steven King

Offline

#3 2012-03-08 07:05:08

sinorev
Member
Registered: 2012-03-06
Posts: 13

Re: ath9k wireless works but disconnects frequently [SOLVED]

I'm going to give the wireless-compat from 3.3.x a try -- I'll keep you posted, thank you smile

Offline

#4 2012-03-17 23:06:07

sinorev
Member
Registered: 2012-03-06
Posts: 13

Re: ath9k wireless works but disconnects frequently [SOLVED]

compat-wireless-3.3-rc6-1 compiled successfully, but when trying to do a "make install", I get this cryptic message:

/sbin/modprobe: invalid option -- 'l'
/sbin/modprobe: invalid option -- 'l'

Your old wireless subsystem modules were left intact:

/sbin/modprobe: invalid option -- 'l'
make: *** [uninstall] Error 1

Any suggestions? I am running 3.2.11, but still the same problem.

Offline

#5 2012-03-17 23:08:40

Gusar
Member
Registered: 2009-08-25
Posts: 3,501

Re: ath9k wireless works but disconnects frequently [SOLVED]

Use the very latest compat-wireless instead of 3.3-rc6. Worked for this person here: https://bbs.archlinux.org/viewtopic.php?id=137643

Offline

#6 2012-03-18 01:33:03

sinorev
Member
Registered: 2012-03-06
Posts: 13

Re: ath9k wireless works but disconnects frequently [SOLVED]

Unfortunately, compat-wireless 03-17-2012 locked up my machine with a very nasty kernel panic when I tried to run wpa_supplicant

The worst thing about this bug is that there are no errors in my dmesg or /var/log/messages.log. Nothing. I've tried looking up the cryptic "CTRL-EVENT-DISCONNECTED" reason, which changes depending on the driver I'm running with wpa_supplicant. If I'm using -Dnl80211, it's reason "4." Additionally, I'm running the ath9k module with options "ath9k nohwcrypt=1" in my modprobe.conf and "iwconfig wlan0 rate 1M fixed", as these have both been recommended as solutions for the issue I am experiencing.

To better document this error, I performed a test:
1.) Set up iwconfig parameters. Activate wlan0 with wpa_supplicant.
2.) Ping wireless interface's IP address from a local machine on the LAN. Monitor what happens when wireless connection is dropped. Occasionally, I'll see a packet get 10-60ms of latency, but it isn't that often.

"iwconfig wlan0" shows me this:

[root@localhost ~]# iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:"my_ssid"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:24:A5:6F:7B:E0
          Bit Rate=1 Mb/s   Tx-Power=20 dBm
          Retry limit:0   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-37 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:8   Missed beacon:0

I start off wpa_supplicant:

wpa_supplicant -i wlan0 -Dwext -dd -c /etc/wpa_supplicant.conf
Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A'
BSS: Expire BSS 10 due to age
BSS: Remove id 10 BSSID 00:11:4e:cb:5d:bc SSID 'LAMEDUCK'
...
Everything's fine this time. I'm surprised it hasn't disconnected for awhile, and I stop the ping...

All of a sudden, the following happens
...
WPA: Request PTK rekeying
WPA: Sending EAPOL-Key Request (error=0 pairwise=1 ptk_set=1 len=99)
WPA: TX EAPOL-Key - hexdump(len=99): 01 03 00 5f 02 09 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b5 08 4a 0f e3 af 1a 0f 69 6b 46 29 54 f0 2a 00 00
RTM_NEWLINK: operstate=1 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
RTM_NEWLINK: operstate=1 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b15 len=24
Wireless event: new AP: 00:00:00:00:00:00
Disassociation notification
Setting scan request: 0 sec 100000 usec
**Added BSSID 00:24:a5:6f:7b:e0 into blacklist (This is me)
**CTRL-EVENT-DISCONNECTED bssid=00:24:a5:6f:7b:e0 reason=0 (The usual error, ugh)
Disconnect event - remove keys
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
State: COMPLETED -> DISCONNECTED

As you expected, the -dd debug output is also vague. Any suggestions? I am totally at a loss here. Given that this is card is running an AR5008 on drivers that have been created by the FOSS community, I didn't think that configuring it would be such a bleeding pain!

Last edited by sinorev (2012-03-18 02:43:29)

Offline

#7 2012-03-18 13:00:59

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,277

Re: ath9k wireless works but disconnects frequently [SOLVED]

Your original deauthication with reason=4 should mean the router disconnects due to inactivity. That would explain also your test with the ping (not the output then though).
Maybe have a look in your router config as well for keep-alive options.

Offline

#8 2012-04-05 16:22:18

sinorev
Member
Registered: 2012-03-06
Posts: 13

Re: ath9k wireless works but disconnects frequently [SOLVED]

The problem turned out to be a combination of my router and TP-LINK TL-WN951N card. My router is B/G only, and the card is B/G/N. I don't think the card or drivers were truly backward compatible. After a lot of fiddling with all of the parameters in wpa_supplicant and the kernels, I reverted to the defaults and switched out to a B/G card with an RT61 chipset, and it's been running flawlessly with no disconnects or issues right out of the box. I have heard people complain about the TL-WN951N and sporadic disconnects even under Windows, so I suppose this shouldn't be much of a surprise... Hopefully this post helps someone.

Offline

#9 2012-04-05 18:59:54

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,277

Re: ath9k wireless works but disconnects frequently [SOLVED]

Pity .. after all that hazzle you had. I would not call this solved; nevermind.

Offline

#10 2012-12-11 04:34:24

mutified
Member
Registered: 2012-12-11
Posts: 1

Re: ath9k wireless works but disconnects frequently [SOLVED]

I had these problems. I discovered that I had multiple wpa_supplicant processes running as well as 2 dhclient3 processes. I also made sure I wasn't in monitor mode, iwconfigured, and ifconfig wlan0 up.

After that I was able to wpa_supplicant without the disconnects. Very Interesting.....

Offline

#11 2013-02-18 02:06:35

ketepi
Member
Registered: 2013-02-18
Posts: 1

Re: ath9k wireless works but disconnects frequently [SOLVED]

Hi everyone, I know this post is marked as solved. But I've been fighting with this problem for 3 days and I solved it in a different way. The problem appeared suddenly.

I noticed that it dosen't happen with my card model and every time someone fixed it was in a different way, and noone is sure about how it fixed the problem. This is also reported as a bug of the kernel (if find the link again and I will post it)

So I tried everything: Adding the nohwcrypt=1 option to the modprobe module, install compat-wireless drivers, changing my wifi configuration (some people fixed it by changing WPA/WPA2 to WP" only) installing wicd, and even reinstalling a clean copy of ubuntu.

I though it was a specific problem of linux, since I worked in windows 7. But I was skeptical and  finally I found this post.
http://www.verboon.info/index.php/2011/ … k-quality/

So I found that it also happen in windows, but W7 is very fast recovering the connection. All the clues pointed to the hardware, I opened my computer played with the wifi PCI card. I made a mistake connecting the antenna and after that the problem remains and was also noiteable under Windows (I got the same errar message related security, nothing related with the signal). So I checked the connections again (this time I plugged all correctly ) and it finally worked in windows 7 and ubuntu.

In summarizing, I think this is a hardware problem, but depending on the SO the kernel and the software it can be override with a quick reconnection.
I hope it helps.

Offline

Board footer

Powered by FluxBB