# wpa_supplicant instantly disconnect after connection[SOLVED]

## xm6

Hey, 

i updated yesterday my system (after a while, cause examination phase...)

Now wpa_supplicant will not connect to my router...

Yes, there were an kernel update, but with the old kernel the problem is still there.

First i thought, okay, maybe i forgot something in the kernel configuration, but thats not.

Maybe wpa_supplicant update, check emerge-log: wpa_supplicant's last update was at november....(last system update..)

The configuration files for the network and wpa_supplicant are still the same.

So, what does wpa_supplicant say:

```
wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf  

Successfully initialized wpa_supplicant

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

wlan0: Trying to associate with 8a:25:2c:b9:13:d3 (SSID='Hive' freq=2412 MHz)

wlan0: Associated with 8a:25:2c:b9:13:d3

wlan0: WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK

wlan0: WPA: Could not verify EAPOL-Key MIC - dropping packet

wlan0: Authentication with 8a:25:2c:b9:13:d3 timed out.

ioctl[SIOCSIWMLME]: Invalid argument

wlan0: CTRL-EVENT-DISCONNECTED bssid=8a:25:2c:b9:13:d3 reason=3 locally_generated=1

wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect

wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Hive" auth_failures=1 duration=10

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

ioctl[SIOCSIWMLME]: Invalid argument

wlan0: CTRL-EVENT-DISCONNECTED bssid=8a:25:2c:b9:13:d3 reason=3 locally_generated=1

ioctl[SIOCSIWSCAN]: Device or resource busy

wlan0: Failed to initiate AP scan

[...]

```

wpa_cli:

```

Interactive mode

> status

bssid=8a:25:2c:b9:13:d3

ssid=Hive

id=0

mode=station

pairwise_cipher=CCMP

group_cipher=TKIP

key_mgmt=WPA2-PSK

wpa_state=COMPLETED

address=3c:a9:f4:34:c1:c0

<3>CTRL-EVENT-DISCONNECTED bssid=8a:25:2c:b9:13:d3 reason=0

<3>CTRL-EVENT-SCAN-RESULTS 

<3>Trying to associate with 8a:25:2c:b9:13:d3 (SSID='Hive' freq=2412 MHz)

<3>Association request to the driver failed

<3>Associated with 8a:25:2c:b9:13:d3

<4>WPA: No SSID info found (msg 1 of 4)

<3>CTRL-EVENT-DISCONNECTED bssid=8a:25:2c:b9:13:d3 reason=0

<3>CTRL-EVENT-SCAN-RESULTS 

<3>Trying to associate with 8a:25:2c:b9:13:d3 (SSID='Hive' freq=2412 MHz)

<3>Association request to the driver failed

<3>Associated with 8a:25:2c:b9:13:d3

<4>WPA: No SSID info found (msg 1 of 4)

<3>CTRL-EVENT-DISCONNECTED bssid=8a:25:2c:b9:13:d3 reason=0

<3>CTRL-EVENT-SCAN-RESULTS 

<3>Trying to associate with 8a:25:2c:b9:13:d3 (SSID='Hive' freq=2412 MHz)

<3>Association request to the driver failed

<3>Associated with 8a:25:2c:b9:13:d3

<4>WPA: No SSID info found (msg 1 of 4)

<3>CTRL-EVENT-DISCONNECTED bssid=8a:25:2c:b9:13:d3 reason=0

<3>CTRL-EVENT-SCAN-RESULTS 

<3>Trying to associate with 8a:25:2c:b9:13:d3 (SSID='Hive' freq=2412 MHz)

<3>Association request to the driver failed

<3>Associated with 8a:25:2c:b9:13:d3

<4>WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK

<4>WPA: Could not verify EAPOL-Key MIC - dropping packet

```

Note: For the first time i started the network interface, it will be connect -- for a second (with an ip adress)

wpa_supplicant.conf 

```

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

ap_scan=1

eapol_version=1

network={

    ssid="SSID_NAME"

    key_mgmt=WPA-PSK

    psk="PSK"

}

```

I tested a few configurations the last hours...

wpa_passphrase, pairwise=TKIP CCMP (all variants), group=TKIP, comment things out  etc.

Kernel-Driver: iwlwifi 

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

Firmware: net-wireless/iwl6000-ucode

I tested wpa_suppplicant version: 2.0-r2 and 2.0-r3

awk '/(WEXT|(MAC|CFG)80211)/' /usr/src/linux/.config:

```

CONFIG_WEXT_CORE=y

CONFIG_WEXT_PROC=y

CONFIG_CFG80211=y

# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set

# CONFIG_CFG80211_REG_DEBUG is not set

CONFIG_CFG80211_DEFAULT_PS=y

# CONFIG_CFG80211_DEBUGFS is not set

# CONFIG_CFG80211_INTERNAL_REGDB is not set

CONFIG_CFG80211_WEXT=y

CONFIG_MAC80211=y

CONFIG_MAC80211_HAS_RC=y

CONFIG_MAC80211_RC_MINSTREL=y

CONFIG_MAC80211_RC_MINSTREL_HT=y

CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y

CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"

# CONFIG_MAC80211_MESH is not set

CONFIG_MAC80211_LEDS=y

# CONFIG_MAC80211_DEBUGFS is not set

# CONFIG_MAC80211_MESSAGE_TRACING is not set

# CONFIG_MAC80211_DEBUG_MENU is not set

# CONFIG_MAC80211_HWSIM is not set

```

At the moment I don't know what to do... 

With wpa_gui and wicd the same.

Sorry for my bad english, i work hard on it  :Wink: 

I hope somebody can help me

Regards xm6

//edit: When I disable encryption the problem is still the same

//edit2

I don't know if this matters but there is something else strange.

I --sync my portage tree and run emerge -uDN @world,

in hope that maybe a lib has an update or so.. 

But emerge tells:

```

These are the packages that would be merged, in order:

Calculating dependencies | * Digest verification failed:

 * /usr/portage/dev-lang/php/php-5.5.9.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 22167

 * Expected: 22166                                                                                                    - * Digest verification failed:

 * /usr/portage/dev-lang/php/php-5.4.25.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 22329

 * Expected: 22328                                                                                                   ... done!

Total: 0 packages, Size of downloads: 0 kB

Nothing to merge; quitting.

```

Maybe there is an hash calculation problem?Last edited by xm6 on Sat Feb 08, 2014 1:45 am; edited 1 time in total

----------

## xm6

So, now I have a stable connection.

What I've done?

First:

revdeb-rebuild --library libcrypto.so.0.9.8

revdeb-rebuild --library libcrypto.so.1.0.0

After that I was able to get an stable connection for 1 min,

then disconnect and reconnect for another min. and so on.

After trying, and trying, and trying, I get a stable connection with this wpa_supplicant.conf

```

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

ap_scan=1

eapol_version=1

fast_reauth=1

networkt={

       ssid="SSID"

       proto=RSN

       key_mgmt=WPA-PSK

       group=CCMP TKIP

       pairwise=CCMP TKIP

       psk=WPA_PASSPHRASE KEY

       mode=0

}

```

And changed the wpa_supplicant driver to nl80211.

But.. I still have a little problem.

At startup wpa_supplicant crashed:

```

[...]

Feb  8 02:18:29 localhost /etc/init.d/net.wlan0[2410]: start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant'

Feb  8 02:18:29 localhost /etc/init.d/net.wlan0[2313]: ERROR: net.wlan0 failed to start

[...]

```

Solved:

I had added the line modules_wlan0="wpa_supplicant" in /etc/conf.d/net

Both net.lo and net.wlan0 were start in the default runlevel,

after adding this line, it would be start twice --- and crashed...

removing net.wlan0 from the runlevel solved the last little problem and with it the whole problem  :Wink: 

Good night everybody.

----------

