# wpa_supplicant doesn't connect (always scanning?) [SOLVED]

## YsndHalf

Hi all,

I've been looking through the Gentoo handbooks, wiki and forum, but I cannot find the answer... so I hope that somebody can help me please.

I have a Thinkpad laptop with this network card (from lspci):

```
Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 3e)
```

It also has a wired card which works perfectly (Intel Corporation 82579LM Gigabit Network Connection).

I want to connect to a WPA network at home.

I have installed the wpa_supplicant as described in the Gentoo Wiki and in the handbook.

Then I have configured the /etc/conf.d/net file like this:

```

config_eth0="dhcp"

modules="wpa_supplicant"

wpa_supplicant_wlan0="wext"

#iwconfig_wlan0="mode managed"  --> this one didn't make any difference

config_wlan0="dhcp"

```

The /etc/conf.d/wpa_supplicant one just has this:

```
wpa_supplicant_args=""
```

And finally the /etc/wpa_supplicant/wpa_supplicant.conf file has this:

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

update_config=1

network={

        ssid="(MySSID)"

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=CCMP TKIP

        group=CCMP TKIP

        psk=(MyPWD)

}

```

I created (soft link to net.lo) the /etc/init.d/net.wlan0 script, and when I launch it I get:

```

# /etc/init.d/net.wlan0 start

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...                                                                                    [ ok ]

 *   Starting wpa_cli on wlan0 ...                                                                                           [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.wlan0 has started, but is inactive

```

The warning at the end is suspicious.

The point is that I can do this:

```

# iwlist scanning

lo        Interface doesn't support scanning.

wlan0     Scan completed :

          Cell 01 - Address: 00:22:2D:45:B9:4B

                    Channel:9

                    Frequency:2.452 GHz (Channel 9)

                    Quality=70/70  Signal level=-10 dBm  

                    Encryption key:on

                    ESSID:"(MySSID)"

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s

                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s

                    Mode:Master

                    Extra:tsf=000000012767173e

                    Extra: Last beacon: 2994ms ago

                    IE: Unknown: 00124A6F7264694D6F6E7473655F4D5031413132

                    IE: Unknown: 010882848B0C12961824

                    IE: Unknown: 030109

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : TKIP CCMP

                        Authentication Suites (1) : PSK

                       Preauthentication Supported

                    IE: WPA Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : TKIP CCMP

                        Authentication Suites (1) : PSK

                    IE: Unknown: 2A0100

                    IE: Unknown: 32043048606C

                    IE: Unknown: DD180050F2020101020003A4000027A4000042435E0062322F00

```

But the wpa_supplicant doesn't connect at all:

```

# iwconfig 

lo        no wireless extensions.

wlan0     IEEE 802.11abgn  ESSID:off/any  

          Mode:Managed  Access Point: Not-Associated   Tx-Power=15 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

```

It looks like the wpa_supplicant is always scanning: (I always get this)

```

# wpa_cli status

Selected interface 'wlan0'

wpa_state=SCANNING

```

And the wpa_gui indicates the same (status: scanning).

I've tried forcing "ifconfig wlan0 up", and I'm also sure that I've put the password correctly  :Wink: 

What am I doing wrong?

The "dmesg | tail" gives me this:

```

[ 6453.701880] iwlwifi 0000:03:00.0: L1 Enabled; Disabling L0S

[ 6453.702085] iwlwifi 0000:03:00.0: Radio type=0x0-0x3-0x1

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

```

FYI: this same wireless card connects without problem to a WEP network - though done 'manually' (with iwconfig blah blah) - haven't tried with wpa_supplicant.

Many thanks in advance...

   Jordi   :Smile: 

----------

## BillWho

YsndHalf,

Try replacing 

```
wpa_supplicant_wlan0="wext" 
```

with

```
wpa_supplicant_wlan0="-Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf"
```

----------

## YsndHalf

Hi BillWho,

many thanks, but it's not working yet. It's doing exactly the same:

```

# wpa_cli status

Selected interface 'wlan0'

wpa_state=SCANNING

# /etc/init.d/net.wlan0 status

 * status: inactive

# iwconfig 

wlan0     IEEE 802.11abgn  ESSID:off/any  

          Mode:Managed  Access Point: Not-Associated   Tx-Power=15 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:on

```

Other ideas?

----------

## BillWho

YsndHalf,

Beyond that noticeable syntactical  error, I really don't know what else to suggest since a lot has to due with the router configuration. 

To get a better idea of the problem, try starting wpa_supplicant manually with the -d or -dd debugging options. That's how I troubleshooted mine.

This is my net and wpa_supplicant.conf if it helps:

```
metric_wlan0="0"

metric_eth0="1"

#

modules="wpa_supplicant"

wpa_supplicant_wlan0="-Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_wlan0=60

config_wlan0="192.168.1.103/24 brd 192.168.1.255"

routes_wlan0="default via 192.168.1.1"

```

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

update_config=1

network={

   ssid="wireless"

   psk="itsasecret"

   proto=RSN

   key_mgmt=WPA-PSK

   pairwise=TKIP

   auth_alg=OPEN

   priority=5

   id_str="gentoo"

}

```

Hope that helps some   :Smile: 

----------

## YsndHalf

OMG... I feel so stupid... The password was indeed correctly set, but not the SSID!   :Embarassed: 

BillWho, many thanks for your 'debug' hint, that helped me finding this.

And also thanks for your configuration! After setting correctly the SSID it was still not connecting, but completing my wpa_supplicant.conf with your setup that finally solved it.

Many thanks!!

----------

