# Wicd disconnecting as soon as a wireless connection starts

## exclarinetist

I'm having some problems using Wicd lately. I'm using the newest version on portage, and my device had been working fine with Wicd for the past few months. Now whenever I connect I instantly get disconnected as soon as the UI says it's established the connection. The UI says connected, then disconnected, then the LED on my wireless devices goes off. Wicd sees all the other networks near by, and it does make the device's LED light up when it starts. [/code]Does anybody know what could be wrong?

Here's the latest wicd.log showing one connection attempt.

```

2013/01/15 09:20:44 :: Attempting to authenticate...

2013/01/15 09:20:47 :: wpa_supplicant rescan forced...

2013/01/15 09:20:48 :: Running DHCP with hostname amdbuild

2013/01/15 09:20:48 :: dhcpcd[2779]: sending commands to master dhcpcd process

2013/01/15 09:20:48 :: 

2013/01/15 09:20:48 :: 

2013/01/15 09:20:48 :: DHCP connection successful

2013/01/15 09:20:48 :: not verifying

2013/01/15 09:20:48 :: Connecting thread exiting.

2013/01/15 09:20:48 :: Sending connection attempt result success

```

Recent changes:

During init wpa supplicant had been complaining about a parsing error with the file that stores my passphrase. I modified the file after I had noticed that there was a comment in the file which the parser didn't like. That fixed that error, but it also caused wireless to stop working.

Does anybody know how to stop my wireless from dropping the connection?

----------

## BillWho

exclarinetist,

Does dmesg show any other useful  information   :Question: 

----------

## exclarinetist

 *BillWho wrote:*   

> exclarinetist,
> 
> Does dmesg show any other useful  information  

 

Sure, here's my dmesg right as the wireless device is failing.

```

[   49.598103] cfg80211: Calling CRDA for country: US

[   49.703871] ifconfig (2321) used greatest stack depth: 4032 bytes left

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

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

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

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

[   49.909357] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

[   50.057756] wpa_supplicant (2165) used greatest stack depth: 3984 bytes left

[   50.123933] r8169 0000:02:00.0: eth0: link down

[   50.124327] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

```

----------

## BillWho

exclarinetist,

Dmesg really didn't say too much at all. Did you try connecting via wpa_supplicant cl with debugging turned on   :Question: 

----------

## The Doctor

 *Quote:*   

> During init wpa supplicant had been complaining about a parsing error with the file that stores my passphrase. I modified the file after I had noticed that there was a comment in the file which the parser didn't like. That fixed that error, but it also caused wireless to stop working. 

 

You can't use two network management systems. The two block each other. You need to remove you net.* scripts (and wpa_supplicant, if added) from the boot up process and add this line in your /etc/rc.conf 

```
rc_hotplug="!net.*"
```

----------

## exclarinetist

Here's a longer dmesg of Wicd trying to automatically connect:

```

[    5.780261] phy0 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'.

[    5.784133] phy0 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29.

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

[    5.966140] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 4, CWmax: 5, Aifs: 2, TXop: 188.

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

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

[    5.993264] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

[    6.050628] r8169 0000:02:00.0: eth0: link down

[    6.051050] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

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

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

[   14.806351] phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 4, CWmax: 5, Aifs: 2, TXop: 188.

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

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

[   14.835194] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

[   14.914688] r8169 0000:02:00.0: eth0: link down

[   14.915113] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

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

[   15.215050] phy0 -> rt2x00mac_conf_t
```

x: Info - Configured TX queue 1 - CWmin: 4, CWmax: 5, Aifs: 2, TXop: 188.

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

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

[   15.242032] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

[   17.421764] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 0

[   17.500434] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 1

[   17.579107] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 2

[   17.658154] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 3

[   17.736827] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 4

[   17.815500] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 5

[   17.894547] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 6

[   17.973221] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 7

[   18.052267] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 8

[   18.130941] phy0 -> rt2800usb_txdone_entry_check: Warning - TX status report missed for queue 0 entry 9

[   18.230557] phy0 -> rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 10 in queue 0

[   18.230561] phy0 -> rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 10 in queue 0

[   18.230562] phy0 -> rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 10 in queue 0

[   20.531441] wlan0: authenticate with <mac_addr>

[   20.552114] wlan0: send auth to <mac_addr> (try 1/3)

[   20.556273] wlan0: authenticated

[   20.575570] wlan0: associate with <mac_addr> (try 1/3)

[   20.577969] wlan0: RX AssocResp from <mac_addr> (capab=0x411 status=0 aid=3)

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

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

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

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

[   20.584775] wlan0: associated

[   20.585164] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

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

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

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

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

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

[   30.970660] cfg80211: Calling CRDA for country: US

[   31.072543] ifconfig (2247) used greatest stack depth: 4032 bytes left

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

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

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

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

[   31.277030] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

[   31.421822] wpa_supplicant (2224) used greatest stack depth: 3984 bytes left

[/code]

----------

## exclarinetist

I recently tried "breaking" the wpa.conf file in the dhcpcd-hooks folder and that seems to *sometimes* fix the instant disconnection.

However, during connection I don't have access to the internet. Pings instantly return an unknown host error when I try and ping any site. I've also tried restarting dhcpcd and I still get this error. Removing the wpa.conf file doesn't seem to work either.

Does anyone know what else I could try to get DNS / internet working again?

----------

## 666threesixes666

i had similar issues, i switched to networkmanager.

my package.use

net-misc/networkmanager avahi dhcpcd resolvconf

and since im gonome i use nm-applet to configure....  it seems to handle things a bit more solid than wicd in my experience.

i still keep wicd around to give me dbi signal strengths, and to tell me what encryption random ap's are using.

----------

## exclarinetist

 *666threesixes666 wrote:*   

> i had similar issues, i switched to networkmanager.
> 
> my package.use
> 
> net-misc/networkmanager avahi dhcpcd resolvconf
> ...

 

I've used networkmanager for a while when I was on GNOME. Would really rather not bring in a bunch of GNOME dependencies. I have had a lot more luck with network manager overall though.

----------

## The Doctor

See my previous post: You should't have any network scripts active. They conflict with wicd and prevent it from working properly (and vice versa). The symptom is that you can't connect. The solution is to stop trying to manually connect to the internet. This includes net.* scripts in any run level and dhcpcd in any run level. use rc-update show to check and rc-update del <foo> to get rid of them. Also change your rc.conf file to eliminate OpenRC starting them.

What was happening before was the error in wpa_supplicant was killing the process. This means that when wicd started it was the sole process controlling the internet connection. When you fixed the file that broke you network setup. wicd uses its own config for wpa_supplicant so it was unaffected by the error.

As for you pings not getting through, that is a symptom of the resolv.conf not being properly generated. This is probably because when you tried "breaking" your conf it was not complete. You can of course add nameserver 8.8.8.8 to the file, but this should be unnecessary once you fix the problem.

This is exactly your problem: you CANNOT have have any scripts that handle networking and wicd. They use the same programs, and hence they jam each other. If you can say "I was messing with some network configs and wicd is not working" there is a problem. Wicd has its own configuration and it handles all the other programs it needs. You basically need to back off and let wicd handle it or remove wicd and handle it yourself. You cannot do both.

----------

## wcg

These two lines in dmesg tell us that wpa_supplicant and your wireless access

point (router) agree on what the PSK (encrypted passphrase) is:

```

[ 20.556273] wlan0: authenticated

[ 20.584775] wlan0: associated

```

This line reports the problem:

```

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

```

If you can figure what "(reason=3)" means, you will have the answer.

(The Doctors suggestion to not enable networking scripts in /etc/init.d/ if

using wicd is accurate and may solve the problem without getting down

into wpa_supplicant or mac80211 error messages.)

One post on a debian list said "reason=3" simply means "local

choice", ie by wpa_supplicant. It saw something it did not like

and issued a command to deauthenticate from the access point.

This guy reported it as a symptom of power saving on his wifi

interface on a raspberry:

 *Quote:*   

> 
> 
> So the problem could be present on the wifi dongle. After some investigation
> 
> I came to the solution of my problem. The power-saving policies of the wifi
> ...

 

I did not see anything in wpa_supplicant.conf for this. It might be this

kernel option:

```

CONFIG_CFG80211_DEFAULT_PS

```

Is this enabled (=y or =m) in your /usr/src/linux/.config?

----------

## exclarinetist

Issue fixed. I had removed the net.* scripts from init earlier, but I didn't remove dhcpcd. After removing that and setting my resolv.conf to add nameserver 8.8.8.8 everything seems to work. Thanks, the doctor.

----------

