# Ralink rt2x00 repeatedly tries to connect to wireless

## exclarinetist

I've recently upgraded from the 3.5.7 kernel to the 3.7.10-r1 kernel and my usb wireless adapter is no longer connecting. When I plug it in it still shows all of my neighbor's access points, but when I try and connect to mine network manager shows the two lit up dots like it's about to complete the connection. It stays like this for a while and then says disconnected. It will then instantly try and reconnect, fail, and loop over again. The device in question is a Linksys AE1000 with a Ralink chip in it.

Here's my dmesg.

```

# dmesg | tail

[   41.178875] wlp0s19f2u6: send auth to <my mac addr> (try 1/3)

[   41.182619] wlp0s19f2u6: authenticated

[   41.183091] wlp0s19f2u6: associate with <my mac addr> (try 1/3)

[   41.185528] wlp0s19f2u6: RX AssocResp <my mac addr> (capab=0x411 status=0 aid=5)

[   41.186226] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CWmin: 4, CWmax: 10, Aifs: 3, TXop: 0.

[   41.187468] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 4, CWmax: 10, Aifs: 7, TXop: 0.

[   41.188715] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 3, CWmax: 4, Aifs: 2, TXop: 94.

[   41.189962] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 2, CWmax: 3, Aifs: 2, TXop: 47.

[   41.192086] wlp0s19f2u6: associated

[   41.833734] IPv6: wlp0s19f2u6: IPv6 duplicate address fe80::6a7f:74ff:fef5:dbd8 detected!

```

After it attempt to connect a few times it then says

```

[ 1328.786157] wlp0s19f2u6: deauthenticating from <my mac addr> by local choice (reason=3)

[ 1328.810251] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1328.811493] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1328.812747] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1328.813986] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1328.818309] cfg80211: Calling CRDA for country: US

```

Does anyone have any ideas about what could be wrong? I also upgraded dhcpcd and udev before this upgrade.

----------

## DONAHUE

You are probably in need of a kernel with proper ehci support, later 3.7 kernels reported to have problems

either

add =sys-kernel/gentoo-sources-3.9.0 to /etc/portage.keywords to advance to a newer testing branch kernel (recommended)

or

add >sys-kernel/gentoo-sources-3.6.11-r2 to /etc/portage/package.mask to revert to an older kernel (less recommended)

then

emerge gentoo-sources

you have changed all wlan0 to the new nomenclature?

----------

## exclarinetist

 *DONAHUE wrote:*   

> 
> 
> you have changed all wlan0 to the new nomenclature?

 

I haven't manually changed anything to the new nomenclature. After you were able to help me get udev working again I noticed that my wired connection had changed names. I will switch to 3.9 then and report back on my findings.

You are definitely right about the EHCI issue. If I boot up and I don't have my ethernet cable plugged in network manager keeps trying and failing to connect to my ethernet connection.

```

[   89.828622] ehci_hcd 0000:00:13.2: shutdown urb ffff880131a40b40 ep1in-bulk

[   89.828624] ehci_hcd 0000:00:13.2: shutdown urb ffff880131a40540 ep1in-bulk

[   89.828625] ehci_hcd 0000:00:13.2: shutdown urb ffff880131a40e40 ep1in-bulk

[   89.828627] ehci_hcd 0000:00:13.2: shutdown urb ffff880131a40240 ep1in-bulk

[   89.828629] ehci_hcd 0000:00:13.2: shutdown urb ffff880131a40840 ep1in-bulk

[   90.925786] phy0 -> rt2800_wait_wpdma_ready: Error - WPDMA TX/RX busy [0xffffffff].

[   90.974740] usb 2-6: usb_disable_device nuking all URBs

[   91.078438] hub 2-0:1.0: debounce: port 6: total 100ms stable 100ms status 0x100

[  126.322245] r8169 0000:02:00.0 enp2s0: link down

[  139.763015] r8169 0000:02:00.0 enp2s0: link up

```

----------

## exclarinetist

I've upgraded and booted into the 3.9.0 kernel. However, I'm still getting the exact same problems with my wireless device (same error messages and same behavior).

```

$ dmesg | tail

[   39.070639] wlp0s19f2u6: send auth to <mac_addr> (try 1/3)

[   39.074143] wlp0s19f2u6: authenticated

[   39.074608] wlp0s19f2u6: associate with <mac_addr> (try 1/3)

[   39.077065] wlp0s19f2u6: RX AssocResp from <mac_addr> (capab=0x411 status=0 aid=4)

[   39.077760] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 2 - CWmin: 4, CWmax: 10, Aifs: 3, TXop: 0.

[   39.079006] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 3 - CWmin: 4, CWmax: 10, Aifs: 7, TXop: 0.

[   39.080256] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 1 - CWmin: 3, CWmax: 4, Aifs: 2, TXop: 94.

[   39.081506] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 0 - CWmin: 2, CWmax: 3, Aifs: 2, TXop: 47.

[   39.083887] wlp0s19f2u6: associated

[   39.850507] IPv6: wlp0s19f2u6: IPv6 duplicate address fe80::6a7f:74ff:fef5:dbd8 detected!

```

----------

## DONAHUE

are you using ipv6 on purpose?

run 

```
ifconfig
```

 what result for wlp0s19f2u6 ?

----------

## exclarinetist

 *DONAHUE wrote:*   

> are you using ipv6 on purpose?
> 
> run 
> 
> ```
> ...

 

On the new 3.9.0 kernel the naming for my USB wireless device is now back to wlan0.

```

wlan0     Link encap:Ethernet  HWaddr 68:7f:74:f5:db:d8  

          inet6 addr: fe80::6a7f:74ff:fef5:dbd8/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:5 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:1564 (1.5 KiB)  TX bytes:1412 (1.3 KiB)

```

I haven't manually configured it to use ipv6, that I'm aware of.

----------

## DONAHUE

what networking are you attempting? networkmanager --now I see it.

you have emerged wpa_supplicant and (dhcp or dhcpcd)?

networkmanager is in the boot run level? net.wlan0, net.wlp0s19f2u6, wpa_supplicant, dhclient, and dhcpcd are not in any run level?

the networkmanager gui sees the wlan0 interface?

----------

## exclarinetist

 *DONAHUE wrote:*   

> what networking are you attempting? networkmanager --now I see it.
> 
> you have emerged wpa_supplicant and (dhcp or dhcpcd)?
> 
> networkmanager is in the boot run level? net.wlan0, net.wlp0s19f2u6, wpa_supplicant, dhclient, and dhcpcd are not in any run level?
> ...

 

None of those were on rc. NetworkManager can definitely see wlan0 because it's showing my neighbor's wireless access points. I'm still getting the same behavior after I set networkmanager to load at boot and restarted.

----------

## DONAHUE

try disabling ipv6 by uncommenting  *Quote:*   

> # alias net-pf-10 off		# IPv6

 as *Quote:*   

> alias net-pf-10 off		# IPv6

  in /etc/modprobe.d/aliases.conf ; then rebooting

----------

## exclarinetist

 *DONAHUE wrote:*   

> try disabling ipv6 by uncommenting  *Quote:*   # alias net-pf-10 off		# IPv6 as *Quote:*   alias net-pf-10 off		# IPv6  in /etc/modprobe.d/aliases.conf ; then rebooting

 

```

# Aliases to tell insmod/modprobe which modules to use                          

# Uncomment the network protocols you don't want loaded:                        

# alias net-pf-1 off            # Unix                                          

# alias net-pf-2 off            # IPv4                                          

# alias net-pf-3 off            # Amateur Radio AX.25                           

# alias net-pf-4 off            # IPX                                           

# alias net-pf-5 off            # DDP / appletalk                               

# alias net-pf-6 off            # Amateur Radio NET/ROM                         

# alias net-pf-9 off            # X.25                                          

 alias net-pf-10 off            # IPv6                                          

# alias net-pf-11 off           # ROSE / Amateur Radio X.25 PLP                 

# alias net-pf-19 off           # Acorn Econet                                  

alias char-major-10-175 agpgart

alias char-major-10-200 tun

alias char-major-81     bttv

...

```

After rebooting I'm still getting the same kinds of errors:

```

[ 1422.080327] ehci-pci 0000:00:13.2: shutdown urb ffff88012fe430c0 ep1in-bulk

[ 1423.180896] phy0 -> rt2800_wait_wpdma_ready: Error - WPDMA TX/RX busy [0xffffffff].

[ 1423.187914] wlan0: deauthenticating from <mac_addr> by local choice (reason=3)

[ 1423.187990] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 0 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1423.187993] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 1 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1423.187995] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 2 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1423.187997] phy0 -> rt2x00mac_conf_tx: Debug - Configured TX queue 3 - CWmin: 4, CWmax: 10, Aifs: 2, TXop: 0.

[ 1423.188042] cfg80211: Calling CRDA to update world regulatory domain

[ 1423.207003] usb 2-6: usb_disable_device nuking all URBs

[ 1423.310982] hub 2-0:1.0: debounce: port 6: total 100ms stable 100ms status 0x100

```

----------

## DONAHUE

 *Quote:*   

> NetworkManager can definitely see wlan0 because it's showing my neighbor's wireless access points.

  Implies that NetworkManager can not scan your access point while at the same time it can scan more than one of your neighbor's?

Are you using a GUI or CLI to scan your neighbors AP's?

does iwlist scan show your AP and ypur neighbors?

```
emerge iw

iw wlan0 scan
```

does ifconfig still show an ipv6 address?

do you have a log at /var/log/NetworkManager.log?

What are the contents of: (wgetpaste could help)

/etc/NetworkManager/NetworkManager.conf

/etc/NetworkManager/system-connections

/etc/NetworkManager/dispatcher.d

----------

## exclarinetist

 *DONAHUE wrote:*   

>  *Quote:*   NetworkManager can definitely see wlan0 because it's showing my neighbor's wireless access points.  Implies that NetworkManager can not scan your access point while at the same time it can scan more than one of your neighbor's?
> 
> Are you using a GUI or CLI to scan your neighbors AP's?
> 
> does iwlist scan show your AP and ypur neighbors?
> ...

 

/usr/sbin/iw wlan0 scan is showing all of my neighbor's access points. Yes, I'm running NetworkManager through the tray icon gui and not over command line.

ifconfig is still showing an ipv6 address for wlan0 which is very strange since I disabled ipv6. I don't have a network manager log there.

```

$ cat /etc/NetworkManager/NetworkManager.conf 

[main]

plugins=ifnet,keyfile

[ifnet]

managed=true

auto_refresh=false

```

Only file in system-connections is:

```

$ stat /etc/NetworkManager/system-connections/.keep_net-misc_networkmanager-0 

  File: ‘/etc/NetworkManager/system-connections/.keep_net-misc_networkmanager-0’

  Size: 0            Blocks: 0          IO Block: 4096   regular empty file

```

```

$ cat /etc/NetworkManager/dispatcher.d/10-openrc-status 

#!/bin/sh

# Copyright (c) 2012 Alexandre Rostovtsev

# Released under the 2-clause BSD license.

# Ensures that the NetworkManager OpenRC service is marked as started and

# providing net only when it has a successful connection.

# Ensure rc-service is in PATH

PATH="${PATH}:/sbin:/usr/sbin"

# Exit if the NetworkManager OpenRC service is not running

rc-service NetworkManager status 2>&1 | grep -Eq "status: (starting|started|inactive|stopping)" || exit 0

# Call rc-service in background mode so that the start/stop functions update

# NetworkManager service status to started or inactive instead of actually

# starting or stopping the daemon

export IN_BACKGROUND=YES

case "$2" in

   up) nm-online -t 0 -x &&

      ! rc-service NetworkManager status 2>&1 | grep -q started &&

      exec rc-service NetworkManager start ;;

   down) nm-online -t 0 -x ||

      rc-service NetworkManager status 2>&1 | grep -q stopped ||

      exec rc-service NetworkManager stop ;;

   pre-sleep) rc-service NetworkManager status 2>&1 | grep -q stopped ||

      exec rc-service NetworkManager stop ;;

esac

exit 0

# vim: set ts=4:

```

There's also another empty .keep_net-misc_networkmanager-0 file in dispatcher.d.

----------

## DONAHUE

After a few frustrating hours of converting my wicd system to network manager (unsuccessfully) and restoring wicd (hard, frustrating, but ultimately successful) I changed course and shifted a vanilla gentoo style networking system to networkmanager. Easy success. As soon as I rebooted and started Gnome I got a large notification that wireless networks were available. A click on the icon showed a couple of my neighbors networks and 2 of my own.from their All I had to do was pick one and enter my PSK code. Seem familiar?

```
grep -i networkmanager /var/log/messages 
```

will show your networkmanager "log"

----------

## exclarinetist

 *DONAHUE wrote:*   

> After a few frustrating hours of converting my wicd system to network manager (unsuccessfully) and restoring wicd (hard, frustrating, but ultimately successful) I changed course and shifted a vanilla gentoo style networking system to networkmanager. Easy success. As soon as I rebooted and started Gnome I got a large notification that wireless networks were available. A click on the icon showed a couple of my neighbors networks and 2 of my own.from their All I had to do was pick one and enter my PSK code. Seem familiar?
> 
> ```
> grep -i networkmanager /var/log/messages 
> ```
> ...

 

I'm not exactly certain what you're saying. Are you saying this is a network manager problem in general? I tried clearing my stored password and reconnecting along with trying to connect to other networks with my password but neither of them worked.

Also, I've noticed if I unplug my ethernet cable and try and replug it in it also scans that multiple times trying to connect, but it can't. I'm thinking now this is a general problem with my network stack but I'm not certain where it is. Here's the dmesg of an attempt to reconnect:

```

[ 2795.426938] hub 6-0:1.0: state 7 ports 3 chg 0000 evt 0000

[ 2795.426940] hub 4-0:1.0: state 7 ports 3 chg 0000 evt 0000

[ 2795.426942] hub 5-0:1.0: state 7 ports 3 chg 0000 evt 0000

[ 2795.426847] Restarting tasks ... done.

[ 2795.645863] EXT4-fs (sda3): re-mounted. Opts: commit=0

[ 2795.746424] r8169 0000:02:00.0 enp2s0: link down

[ 2795.746437] r8169 0000:02:00.0 enp2s0: link down

[ 2795.746463] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready

[ 2797.443797] r8169 0000:02:00.0 enp2s0: link up

[ 2797.443807] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0: link becomes ready

```

----------

## DONAHUE

what does 

```
grep -i networkmanager /var/log/messages
```

 produce?

----------

## 666threesixes666

i ran into major wifi problems with the new naming scheme....  to revert back to wlan0

```

su -c 'touch /etc/udev/rules.d/80-net-name-slot.rules'

```

if this changes nothing for your situation you can go back to the new names via

```

su -c 'rm /etc/udev/rules.d/80-net-name-slot.rules'

```

----------

