# wpa_supplicant only works if I start it manually [SOLVED]

## GimmeFuel

I have Gentoo on my EeePC, and I'm trying to connect it to my wireless network at home. However, it only works if I run wpa_supplicant manually. Starting it with the init scripts causes this:

```
minimoose ~ # /etc/init.d/net.wlan0 start

 * Caching service dependencies ...                                                                                           [ ok ]

 * Service net.wlan0 starting

 * WARNING:  net.wlan0 has started but is inactive

minimoose ~ # iwconfig

lo        no wireless extensions.

dummy0    no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"pepperjack"

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1A:70:EE:67:64

          Bit Rate=54 Mb/s

          Encryption key:F3BF-E277-ECF5-CBC3-731F-669A-F64B-06E8   Security mode:restricted

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

minimoose ~ # iwconfig

lo        no wireless extensions.

dummy0    no wireless extensions.

wlan0     IEEE 802.11g  ESSID:off/any

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1A:70:EE:67:64

          Bit Rate=54 Mb/s

          Encryption key:F3BF-E277-ECF5-CBC3-731F-669A-F64B-06E8   Security mode:restricted

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

minimoose ~ # iwconfig

lo        no wireless extensions.

dummy0    no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"pepperjack"

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1A:70:EE:67:64

          Bit Rate=54 Mb/s

          Encryption key:8061-DFDF-EF5F-432F-8AB5-7AC5-2615-036F   Security mode:restricted

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
```

It seems to connect, but then the ESSID changes to off/any, then it reconnects with a different encryption key, only to disconnect again. This goes on forever until I stop net.wlan0.

Now, I try to start the interface manually, and it works perfectly:

```
minimoose ~ # wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Trying to associate with SSID 'pepperjack'

Associated with 00:1a:70:ee:67:64

WPA: Key negotiation completed with 00:1a:70:ee:67:64 [PTK=CCMP GTK=CCMP]

CTRL-EVENT-CONNECTED - Connection to 00:1a:70:ee:67:64 completed (auth) [id=0 id_str=]

^Z

[1]+  Stopped                 wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

minimoose ~ # bg

[1]+ wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf &

minimoose ~ # iwconfig

lo        no wireless extensions.

dummy0    no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"pepperjack"

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1A:70:EE:67:64

          Bit Rate=54 Mb/s

          Encryption key:7185-9F29-9201-C498-5BFA-F8A6-D9D3-FE77   Security mode:restricted

          Power Management:off

          Link Quality:46/100  Signal level:-66 dBm  Noise level:-96 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

minimoose ~ # dhcpcd wlan0

minimoose ~ # ifconfig wlan0

wlan0     Link encap:Ethernet  HWaddr 00:15:AF:5A:5F:85

          inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::215:afff:fe5a:5f85/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000

          RX bytes:45980338 (43.8 Mb)  TX bytes:16586188 (15.8 Mb)

          Interrupt:18 Memory:fbef0000-fbf00000
```

Does anyone know what might cause this?

Other info that might be relevant:

```
minimoose ~ # cat /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ap_scan=1

network={

        ssid="pepperjack"

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=CCMP TKIP

        group=CCMP TKIP WEP104 WEP40

        psk="XXX"

        priority=1

}

minimoose ~ # cat /etc/conf.d/net

modules_wlan0=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

config_wlan0=( "dhcp" )

minimoose ~ # uname -a

Linux minimoose 2.6.24-gentoo-r4 #2 PREEMPT Fri Apr 18 23:19:01 PDT 2008 i686 Intel(R) Celeron(R) M processor 900MHz GenuineIntel GNU/Linux

minimoose ~ # eix wpa_supp

[I] net-wireless/wpa_supplicant

     Available versions:  0.5.7 ~0.5.8 (~)0.5.10 [M]~0.6.1 [M]~0.6.3 {dbus gnutls gsm kernel_FreeBSD kernel_linux madwifi ps3 qt3 qt4 readline ssl}

     Installed versions:  0.5.10(20:42:34 05/01/08)(kernel_linux readline ssl -dbus -gnutls -gsm -kernel_FreeBSD -madwifi -qt3 -qt4)

     Homepage:            http://hostap.epitest.fi/wpa_supplicant/

     Description:         IEEE 802.1X/WPA supplicant for secure wireless transfers

minimoose ~ # eix ndiswr

[I] net-wireless/ndiswrapper

     Available versions:  1.47 ~1.48 ~1.49 1.50 ~1.51 ~1.52 {debug kernel_linux usb}

     Installed versions:  1.50(19:41:58 04/19/08)(kernel_linux -debug -usb)

     Homepage:            http://ndiswrapper.sourceforge.net/

     Description:         Wrapper for using Windows drivers for some wireless cards
```

I was originally using wpa_supplicant 0.5.7, but I upgraded it to 0.5.10 hoping that might fix it. No luck.

----------

## kds66

Some people observed problems with ndiswrapper on 2.6.23 and 2.6.24. You could switch to 2.6.22, which is known to work well with ndiswrapper, or to 2.6.25, which might also work (post your results if you try). I switched to the native driver with 2.6.24 and, apart from lower bandwidth, it works okay.

----------

## pappy_mcfae

I agree, but as a word of advice, if you want it to work right away, go with the .22 kernel. Yes, the .25 kernel does give much better support to ndiswrapper than .23 &.24, but it is still a bit buggy, sometimes taking up to five minutes for the interface to become fully active.

Blessed be!

Pappy

----------

## GimmeFuel

2.6.22 is working great. Thanks for your help.

----------

## pappy_mcfae

You are most welcome.

Blessed be!

Pappy

----------

