# Establishing wireless connection failed with wicd

## samo

Hello,

I have problems with my wireless network interface. Sometimes connection is not automatically established after startup. wicd.log looks like this:

```
2011/04/17 09:18:03 :: ---------------------------

2011/04/17 09:18:03 :: wicd initializing...

2011/04/17 09:18:03 :: ---------------------------

2011/04/17 09:18:03 :: wicd is version 1.7.1b2 565

2011/04/17 09:18:03 :: setting backend to external

2011/04/17 09:18:03 :: trying to load backend external

2011/04/17 09:18:03 :: successfully loaded backend external

2011/04/17 09:18:03 :: WARNING: No path found for dhcpcd-bin

2011/04/17 09:18:03 :: WARNING: No path found for udhcpc

2011/04/17 09:18:03 :: WARNING: No path found for gksudo

2011/04/17 09:18:03 :: WARNING: No path found for resolvconf

2011/04/17 09:18:03 :: trying to load backend external

2011/04/17 09:18:03 :: successfully loaded backend external

2011/04/17 09:18:03 :: WARNING: No path found for dhcpcd-bin

2011/04/17 09:18:03 :: WARNING: No path found for udhcpc

2011/04/17 09:18:03 :: WARNING: No path found for gksudo

2011/04/17 09:18:03 :: WARNING: No path found for resolvconf

2011/04/17 09:18:03 :: Couldn't detect a wireless interface.

2011/04/17 09:18:03 :: setting wireless interface wlan0

2011/04/17 09:18:03 :: automatically detected wired interface eth1

2011/04/17 09:18:03 :: setting wired interface eth0

2011/04/17 09:18:03 :: setting wpa driver wext

2011/04/17 09:18:03 :: setting use global dns to True

2011/04/17 09:18:03 :: setting global dns

2011/04/17 09:18:03 :: global dns servers are 208.67.222.222 None None

2011/04/17 09:18:03 :: domain is None

2011/04/17 09:18:03 :: search domain is None

2011/04/17 09:18:03 :: setting automatically reconnect when connection drops True

2011/04/17 09:18:03 :: found wired_connect_mode in configuration 1

2011/04/17 09:18:03 :: found should_verify_ap in configuration 1

2011/04/17 09:18:03 :: Setting dhcp client to 2

2011/04/17 09:18:03 :: Wireless configuration file found...

2011/04/17 09:18:03 :: Wired configuration file found...

2011/04/17 09:18:03 :: chmoding configuration files 0600...

2011/04/17 09:18:03 :: chowning configuration files root:root...

2011/04/17 09:18:03 :: Using wireless interface...wlan0

2011/04/17 09:18:03 :: Using wired interface...eth0

2011/04/17 09:18:03 :: scanning start

2011/04/17 09:18:03 :: ifconfig wlan0 up

2011/04/17 09:18:05 :: iwlist wlan0 scan

2011/04/17 09:18:09 :: scanning done

2011/04/17 09:18:09 :: found 7 networks:

2011/04/17 09:18:09 :: found afterscript in configuration None

2011/04/17 09:18:09 :: found postdisconnectscript in configuration None

2011/04/17 09:18:09 :: found predisconnectscript in configuration None

2011/04/17 09:18:09 :: found beforescript in configuration None

2011/04/17 09:18:09 :: found afterscript in configuration None

2011/04/17 09:18:09 :: found psk in configuration 3256da0781fb12ce15f680a13cb9225744ae7618dd3b33d4ec4c1497cb8e9601

2011/04/17 09:18:09 :: found dhcphostname in configuration None

2011/04/17 09:18:09 :: found postdisconnectscript in configuration None

2011/04/17 09:18:09 :: found use_dhcphostname in configuration 0

2011/04/17 09:18:09 :: found netmask in configuration 255.255.255.0

2011/04/17 09:18:09 :: found key in configuration password

2011/04/17 09:18:09 :: found predisconnectscript in configuration None

2011/04/17 09:18:09 :: found gateway in configuration 192.168.178.1

2011/04/17 09:18:09 :: found use_global_dns in configuration True

2011/04/17 09:18:09 :: found disconnect in configuration None

2011/04/17 09:18:09 :: found use_settings_globally in configuration False

2011/04/17 09:18:09 :: found use_static_dns in configuration True

2011/04/17 09:18:09 :: found ip in configuration 192.168.178.22

2011/04/17 09:18:09 :: found beforescript in configuration None

2011/04/17 09:18:09 :: found enctype in configuration wpa

2011/04/17 09:18:09 :: found automatic in configuration True

2011/04/17 09:18:09 :: found afterscript in configuration None

2011/04/17 09:18:09 :: found postdisconnectscript in configuration None

2011/04/17 09:18:09 :: found predisconnectscript in configuration None

2011/04/17 09:18:09 :: found beforescript in configuration None

2011/04/17 09:18:10 :: ifconfig eth0

2011/04/17 09:18:10 :: ifconfig wlan0

2011/04/17 09:18:10 :: iwconfig wlan0

2011/04/17 09:18:10 :: GetCurrentNetworkID: Returning -1, current network not found

2011/04/17 09:18:10 :: Autoconnecting...

2011/04/17 09:18:10 :: ifconfig eth0 up

2011/04/17 09:18:12 :: Starting wireless autoconnect...

2011/04/17 09:18:12 :: No wired connection present, attempting to autoconnect to wireless network

2011/04/17 09:18:12 :: scanning start

2011/04/17 09:18:12 :: ifconfig wlan0 up

2011/04/17 09:18:12 :: iwlist wlan0 scan

2011/04/17 09:18:16 :: scanning done

2011/04/17 09:18:16 :: found 10 networks:

2011/04/17 09:18:16 :: found afterscript in configuration None

2011/04/17 09:18:16 :: found postdisconnectscript in configuration None

2011/04/17 09:18:16 :: found predisconnectscript in configuration None

2011/04/17 09:18:16 :: found beforescript in configuration None

2011/04/17 09:18:16 :: found afterscript in configuration None

2011/04/17 09:18:16 :: found postdisconnectscript in configuration None

2011/04/17 09:18:16 :: found predisconnectscript in configuration None

2011/04/17 09:18:16 :: found beforescript in configuration None

2011/04/17 09:18:16 :: found afterscript in configuration None

2011/04/17 09:18:16 :: found psk in configuration 3256da0781fb12ce15f680a13cb9225744ae7618dd3b33d4ec4c1497cb8e9601

2011/04/17 09:18:16 :: found dhcphostname in configuration None

2011/04/17 09:18:16 :: found postdisconnectscript in configuration None

2011/04/17 09:18:16 :: found use_dhcphostname in configuration 0

2011/04/17 09:18:16 :: found netmask in configuration 255.255.255.0

2011/04/17 09:18:16 :: found key in configuration password

2011/04/17 09:18:16 :: found predisconnectscript in configuration None

2011/04/17 09:18:16 :: found gateway in configuration 192.168.178.1

2011/04/17 09:18:16 :: found use_global_dns in configuration True

2011/04/17 09:18:16 :: found disconnect in configuration None

2011/04/17 09:18:16 :: found use_settings_globally in configuration False

2011/04/17 09:18:16 :: found use_static_dns in configuration True

2011/04/17 09:18:16 :: found ip in configuration 192.168.178.22

2011/04/17 09:18:16 :: found beforescript in configuration None

2011/04/17 09:18:16 :: found enctype in configuration wpa

2011/04/17 09:18:16 :: found automatic in configuration True

2011/04/17 09:18:16 :: wMeisterBVB09_11 has profile

2011/04/17 09:18:16 :: WLAN-EE0F30 has profile

2011/04/17 09:18:16 :: Gentoo has profile

2011/04/17 09:18:16 :: trying to automatically connect to...Gentoo

2011/04/17 09:18:16 :: Connecting to wireless network Gentoo

2011/04/17 09:18:16 :: iwconfig wlan0

2011/04/17 09:18:16 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wireless X X

2011/04/17 09:18:16 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 1

2011/04/17 09:18:16 :: /sbin/dhcpcd -k wlan0

2011/04/17 09:18:16 :: ifconfig wlan0 0.0.0.0 

2011/04/17 09:18:16 :: /sbin/ip route flush dev wlan0

2011/04/17 09:18:16 :: ifconfig wlan0 down

2011/04/17 09:18:16 :: ifconfig wlan0 up

2011/04/17 09:18:17 :: wpa_cli -i wlan0 terminate

2011/04/17 09:18:17 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wired wired wired

2011/04/17 09:18:17 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 1

2011/04/17 09:18:17 :: /sbin/dhcpcd -k eth0

2011/04/17 09:18:17 :: ifconfig eth0 0.0.0.0 

2011/04/17 09:18:17 :: /sbin/ip route flush dev eth0

2011/04/17 09:18:17 :: ifconfig eth0 down

2011/04/17 09:18:17 :: ifconfig eth0 up

2011/04/17 09:18:17 :: Putting interface down

2011/04/17 09:18:17 :: ifconfig wlan0 down

2011/04/17 09:18:17 :: Releasing DHCP leases...

2011/04/17 09:18:17 :: /sbin/dhcpcd -k wlan0

2011/04/17 09:18:17 :: Setting false IP...

2011/04/17 09:18:17 :: ifconfig wlan0 0.0.0.0 

2011/04/17 09:18:18 :: iwconfig wlan0

2011/04/17 09:18:19 :: Stopping wpa_supplicant

2011/04/17 09:18:19 :: wpa_cli -i wlan0 terminate

2011/04/17 09:18:19 :: Flushing the routing table...

2011/04/17 09:18:19 :: /sbin/ip route flush dev wlan0

2011/04/17 09:18:19 :: iwconfig wlan0 mode managed

2011/04/17 09:18:19 :: Putting interface up...

2011/04/17 09:18:19 :: ifconfig wlan0 up

2011/04/17 09:18:21 :: enctype is wpa

2011/04/17 09:18:21 :: Generating psk...

2011/04/17 09:18:21 :: ['/usr/bin/wpa_passphrase', 'Gentoo', 'password']

2011/04/17 09:18:21 :: Attempting to authenticate...

2011/04/17 09:18:21 :: ['wpa_supplicant', '-B', '-i', 'wlan0', '-c', '/var/lib/wicd/configurations/001c4a4f9ef9', '-D', 'wext']

2011/04/17 09:18:21 :: ['iwconfig', 'wlan0', 'essid', '--', 'Gentoo']

2011/04/17 09:18:21 :: iwconfig wlan0 channel 36

2011/04/17 09:18:21 :: iwconfig wlan0 ap 00:1C:4A:4F:9E:F9

2011/04/17 09:18:21 :: WPA_CLI RESULT IS DISCONNECTED

2011/04/17 09:18:22 :: WPA_CLI RESULT IS DISCONNECTED

2011/04/17 09:18:23 :: WPA_CLI RESULT IS DISCONNECTED

2011/04/17 09:18:24 :: iwconfig wlan0

2011/04/17 09:18:24 :: WPA_CLI RESULT IS DISCONNECTED

2011/04/17 09:18:24 :: wpa_supplicant rescan forced...

2011/04/17 09:18:25 :: WPA_CLI RESULT IS DISCONNECTED

2011/04/17 09:18:26 :: WPA_CLI RESULT IS DISCONNECTED

2011/04/17 09:18:27 :: WPA_CLI RESULT IS COMPLETED

2011/04/17 09:18:27 :: Setting static IP : 192.168.178.22

2011/04/17 09:18:27 :: ifconfig wlan0 192.168.178.22 netmask 255.255.255.0 

2011/04/17 09:18:27 :: Setting default gateway : 192.168.178.1

2011/04/17 09:18:27 :: route add default gw 192.168.178.1 dev wlan0

2011/04/17 09:18:27 :: Setting DNS : 208.67.222.222

2011/04/17 09:18:27 :: Verifying AP association...

2011/04/17 09:18:27 :: Attempt 1 of 10...

2011/04/17 09:18:27 :: ping -q -w 3 -c 1 192.168.178.1

2011/04/17 09:18:27 :: Successfully associated.

2011/04/17 09:18:27 :: Executing /etc/wicd/scripts/postconnect/start-init-services with params wireless Gentoo 00:1C:4A:4F:9E:F9

2011/04/17 09:18:29 :: iwconfig wlan0

2011/04/17 09:17:30 :: /etc/wicd/scripts/postconnect/start-init-services returned 0

2011/04/17 09:17:30 :: Connecting thread exiting.

2011/04/17 09:17:30 :: IP Address is: None

2011/04/17 09:17:36 :: Sending connection attempt result Success

2011/04/17 09:17:36 :: Autoconnecting...

2011/04/17 09:17:36 :: Starting wireless autoconnect...

2011/04/17 09:17:36 :: No wired connection present, attempting to autoconnect to wireless network

2011/04/17 09:17:36 :: scanning start

2011/04/17 09:17:36 :: ifconfig wlan0 up

2011/04/17 09:17:36 :: iwlist wlan0 scan

2011/04/17 09:17:44 :: scanning done

2011/04/17 09:17:44 :: found 9 networks:

2011/04/17 09:17:44 :: found afterscript in configuration None

2011/04/17 09:17:44 :: found postdisconnectscript in configuration None

2011/04/17 09:17:44 :: found predisconnectscript in configuration None

2011/04/17 09:17:44 :: found beforescript in configuration None

2011/04/17 09:17:44 :: found afterscript in configuration None

2011/04/17 09:17:44 :: found psk in configuration 3256da0781fb12ce15f680a13cb9225744ae7618dd3b33d4ec4c1497cb8e9601

2011/04/17 09:17:44 :: found dhcphostname in configuration None

2011/04/17 09:17:44 :: found postdisconnectscript in configuration None

2011/04/17 09:17:44 :: found use_dhcphostname in configuration 0

2011/04/17 09:17:44 :: found netmask in configuration 255.255.255.0

2011/04/17 09:17:44 :: found key in configuration password

2011/04/17 09:17:44 :: found predisconnectscript in configuration None

2011/04/17 09:17:44 :: found gateway in configuration 192.168.178.1

2011/04/17 09:17:44 :: found use_global_dns in configuration True

2011/04/17 09:17:44 :: found disconnect in configuration None

2011/04/17 09:17:44 :: found use_settings_globally in configuration False

2011/04/17 09:17:44 :: found use_static_dns in configuration True

2011/04/17 09:17:44 :: found ip in configuration 192.168.178.22

2011/04/17 09:17:44 :: found beforescript in configuration None

2011/04/17 09:17:44 :: found enctype in configuration wpa

2011/04/17 09:17:44 :: found automatic in configuration True

2011/04/17 09:17:44 :: found afterscript in configuration None

2011/04/17 09:17:44 :: found postdisconnectscript in configuration None

2011/04/17 09:17:44 :: found predisconnectscript in configuration None

2011/04/17 09:17:44 :: found beforescript in configuration None

2011/04/17 09:17:44 :: wMeisterBVB09_11 has profile

2011/04/17 09:17:44 :: Gentoo has profile

2011/04/17 09:17:44 :: trying to automatically connect to...Gentoo

2011/04/17 09:17:44 :: Connecting to wireless network Gentoo

2011/04/17 09:17:44 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wireless Gentoo 00:1C:4A:4F:9E:F9

2011/04/17 09:17:44 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 0

2011/04/17 09:17:44 :: /sbin/dhcpcd -k wlan0

2011/04/17 09:17:44 :: ifconfig wlan0 0.0.0.0 

2011/04/17 09:17:44 :: /sbin/ip route flush dev wlan0

2011/04/17 09:17:44 :: ifconfig wlan0 down

2011/04/17 09:17:44 :: ifconfig wlan0 up

2011/04/17 09:17:45 :: wpa_cli -i wlan0 terminate

2011/04/17 09:17:45 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wired wired wired

2011/04/17 09:17:45 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 1

2011/04/17 09:17:45 :: /sbin/dhcpcd -k eth0

2011/04/17 09:17:45 :: ifconfig eth0 0.0.0.0 

2011/04/17 09:17:45 :: /sbin/ip route flush dev eth0

2011/04/17 09:17:45 :: ifconfig eth0 down

2011/04/17 09:17:45 :: ifconfig eth0 up

2011/04/17 09:17:45 :: Putting interface down

2011/04/17 09:17:45 :: ifconfig wlan0 down

2011/04/17 09:17:45 :: Releasing DHCP leases...

2011/04/17 09:17:45 :: /sbin/dhcpcd -k wlan0

2011/04/17 09:17:45 :: Setting false IP...

2011/04/17 09:17:45 :: ifconfig wlan0 0.0.0.0 

2011/04/17 09:17:46 :: Forced disconnect on

2011/04/17 09:17:46 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wireless Gentoo 00:1C:4A:4F:9E:F9

2011/04/17 09:17:46 :: Stopping wpa_supplicant

2011/04/17 09:17:46 :: wpa_cli -i wlan0 terminate

2011/04/17 09:17:46 :: Flushing the routing table...

2011/04/17 09:17:46 :: /sbin/ip route flush dev wlan0

2011/04/17 09:17:46 :: iwconfig wlan0 mode managed

2011/04/17 09:17:46 :: Putting interface up...

2011/04/17 09:17:46 :: ifconfig wlan0 up

2011/04/17 09:17:46 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 1

2011/04/17 09:17:46 :: /sbin/dhcpcd -k wlan0

2011/04/17 09:17:46 :: ifconfig wlan0 0.0.0.0 

2011/04/17 09:17:48 :: /sbin/ip route flush dev wlan0

2011/04/17 09:17:48 :: ifconfig wlan0 down

2011/04/17 09:17:48 :: ifconfig wlan0 up

2011/04/17 09:17:49 :: wpa_cli -i wlan0 terminate

2011/04/17 09:17:49 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wired wired wired

2011/04/17 09:17:49 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 1

2011/04/17 09:17:49 :: /sbin/dhcpcd -k eth0

2011/04/17 09:17:49 :: ifconfig eth0 0.0.0.0 

2011/04/17 09:17:49 :: /sbin/ip route flush dev eth0

2011/04/17 09:17:49 :: ifconfig eth0 down

2011/04/17 09:17:49 :: ifconfig eth0 up

2011/04/17 09:17:57 :: WARNING: Timed out waiting for interface to come up

2011/04/17 09:17:57 :: enctype is wpa

2011/04/17 09:17:57 :: Generating psk...

2011/04/17 09:17:57 :: ['/usr/bin/wpa_passphrase', 'Gentoo', 'password']

2011/04/17 09:17:57 :: Attempting to authenticate...

2011/04/17 09:17:57 :: ['wpa_supplicant', '-B', '-i', 'wlan0', '-c', '/var/lib/wicd/configurations/001c4a4f9ef9', '-D', 'wext']

2011/04/17 09:17:58 :: ['iwconfig', 'wlan0', 'essid', '--', 'Gentoo']

2011/04/17 09:17:58 :: iwconfig wlan0 channel 36

2011/04/17 09:17:58 :: iwconfig wlan0 ap 00:1C:4A:4F:9E:F9

2011/04/17 09:17:58 :: WPA_CLI RESULT IS None

2011/04/17 09:17:58 :: connect result is Failed

2011/04/17 09:17:58 :: exiting connection thread

2011/04/17 09:18:00 :: Sending connection attempt result bad_pass

2011/04/17 09:18:00 :: Autoconnecting...

2011/04/17 09:18:00 :: Starting wireless autoconnect...

2011/04/17 09:18:00 :: No wired connection present, attempting to autoconnect to wireless network

2011/04/17 09:18:00 :: scanning start

2011/04/17 09:18:00 :: ifconfig wlan0 up

2011/04/17 09:18:01 :: iwlist wlan0 scan

2011/04/17 09:18:01 :: scanning done

2011/04/17 09:18:01 :: found 0 networks:

2011/04/17 09:18:01 :: Unable to autoconnect, you'll have to manually connect

2011/04/17 09:18:01 :: Forced disconnect on

2011/04/17 09:18:01 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wireless Gentoo 00:1C:4A:4F:9E:F9

2011/04/17 09:18:01 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 1

2011/04/17 09:18:01 :: /sbin/dhcpcd -k wlan0

2011/04/17 09:18:01 :: ifconfig wlan0 0.0.0.0 

2011/04/17 09:18:02 :: /sbin/ip route flush dev wlan0

2011/04/17 09:18:02 :: ifconfig wlan0 down

2011/04/17 09:18:02 :: ifconfig wlan0 up

2011/04/17 09:18:03 :: wpa_cli -i wlan0 terminate

2011/04/17 09:18:03 :: Executing /etc/wicd/scripts/predisconnect/stop-init-services with params wired wired wired

2011/04/17 09:18:03 :: /etc/wicd/scripts/predisconnect/stop-init-services returned 1

2011/04/17 09:18:03 :: /sbin/dhcpcd -k eth0

2011/04/17 09:18:03 :: ifconfig eth0 0.0.0.0 

2011/04/17 09:18:03 :: /sbin/ip route flush dev eth0

2011/04/17 09:18:03 :: ifconfig eth0 down

2011/04/17 09:18:03 :: ifconfig eth0 up

2011/04/17 09:18:05 :: GetCurrentNetworkID: Returning -1, current network not found

2011/04/17 09:18:05 :: Autoconnecting...

2011/04/17 09:18:05 :: Starting wireless autoconnect...

2011/04/17 09:18:05 :: No wired connection present, attempting to autoconnect to wireless network

2011/04/17 09:18:05 :: scanning start

2011/04/17 09:18:05 :: ifconfig wlan0 up

2011/04/17 09:18:06 :: iwlist wlan0 scan

2011/04/17 09:18:06 :: scanning done

2011/04/17 09:18:06 :: found 0 networks:

2011/04/17 09:18:06 :: Unable to autoconnect, you'll have to manually connect

2011/04/17 09:18:15 :: ifconfig eth0

2011/04/17 09:18:15 :: ifconfig wlan0

2011/04/17 09:18:20 :: ifconfig eth0

2011/04/17 09:18:20 :: ifconfig wlan0

2011/04/17 09:18:25 :: ifconfig eth0

2011/04/17 09:18:25 :: ifconfig wlan0

2011/04/17 09:18:30 :: ifconfig eth0

2011/04/17 09:18:30 :: ifconfig wlan0
```

When I compare this log with one of a successful connection setup I notice the following warning:

```
2011/04/17 09:17:57 :: WARNING: Timed out waiting for interface to come up
```

ifconfig shows that wlan0 is missing. After reconnect the wlan-stick into the usb port and restart wicd manually the connection is established. The root cause seems to be the missing interface.

Does someone have an idea to solve the problem?

Regards

----------

