# Can't connect to WLAN using wpa_supplicant, Centrino Advanc



## teknon (Feb 15, 2014)

Hello FreeBSD community,

I have installed FreeBSD 10 onto my new notebook, and so far I'm quite satisfied, with the only exception that I'm having issues with connecting to my wireless network. I've got a Centrino Advanced-N6235 card, which I managed to get detected by means of applying the patch provided here and recompiling the kernel.

Now, the card is detected by `pciconf`, and after runnning `ifconfig wlan0 create wlandev iwn0`, I can use `ifconfig scan` which will indeed display the wireless networks in my area. As soon as I try running `wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf` however, I get tons of output, with `wpa_supplicant` constantly trying to associate with the network, but yielding different error patterns, with an example output looking like this

```
Successfully initialized wpa_supplicant
wlan0: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='myWireless' freq=2462 MHz)
wlan0: Associated with xx:xx:xx:xx:xx:xx
wlan0: Authentication with xx:xx:xx:xx:xx:xx timed out.
wlan0: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx 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="myWireless" auth_failures=1 duration=10
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Can't assign requested address
wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="myWireless"
wlan0: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='myWireless' freq=2462 MHz)
wlan0: Associated with xx:xx:xx:xx:xx:xx
wlan0: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx 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="myWireless" auth_failures=2 duration=20
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Can't assign requested address
```

`wpa_supplicant` doesn't establish a connection and `ifconfig`'s status with regard to wlan0 constantly switches between "no carrier" and "associated".

My /etc/wpa_supplicant.conf contains the following (the info is correct for the network, though -- I've got another machine with FreeBSD 9.1 which connects to that network just fine using the same wpa_supplicant.conf):

```
network={
	ssid="myWireless"
	scan_ssid=1
	proto=RSN
	key_mgmt=WPA-PSK
	pairwise=TKIP
	group=TKIP
	psk="MyPSK"
}
```

How can I fix this problem?

Some more info:

Online I only found one result on a German forum, without any solution whatsoever, with a person having a seemingly identical problem, with the same driver.

From what I gathered (compare this thread), a firmware (in my case, iwn6000g2bfw) must be loaded as a kernel module before loading if_iwn (which in my case is a kernel module, rather than compiled into the kernel). It seems that loading this firmware -- or loading any other firmware for this driver -- doesn't make any difference with regard to the error messages I get from `wpa_supplicant`. Does this point to a firmware problem? Or maybe my process -- first loading the firmware, then the driver, then creating wlan0 by means of `ifconfig`, then trying to connect via `wpa_supplicant`, and eventually using `dhclient` (I've played quite a bit with the order though, to no avail) -- is problematic/wrong?

The card has no problems connecting to that network on the Linux distribution Knoppix.



Thanks to everyone spending time to help me with this problem.


----------



## fmegally (May 16, 2018)

I'm having the same issue but with a different card. did you manage to resolve it ?


----------



## ShelLuser (May 16, 2018)

teknon said:


> My /etc/wpa_supplicant.conf contains the following (the info is correct for the network, though -- I've got another machine with FreeBSD 9.1 which connects to that network just fine using the same wpa_supplicant.conf):
> 
> ```
> network={
> ...


Shame I didn't see this thread back in the day, but oh well. I have some decent hands-on experience with wireless networking (no extensive amounts) and from what I can tell your psk entry is wrong, see also WPA_SUPPLICANT.CONF(5):


```
psk     WPA preshared key used in WPA-PSK mode.  The key is specified as
             64 hex digits or as an 8-63 character ASCII passphrase.  ASCII
             passphrases are dynamically converted to a 256-bit key at runtime
             using the network SSID, or they can be statically converted at
             configuration time using the wpa_passphrase(8) utility.
```
Your passphrase is 5 characters long so it doesn't even come close of meeting these requirements. As such my suggestion, look into the wpa_passphrase(8) utility.



fmegally said:


> I'm having the same issue but with a different card. did you manage to resolve it ?


First: please keep in mind that the thread is over nearly 4 years old, it might have been better to start your own especially because there's no telling if your problem has the same cause as the OP. At any rate, I'm pretty confident that I just fixed the OP's issue (4 years too late, but you know what they say: better late than never  ) and if this doesn't apply to you then I'd definitely suggest to start your own thread.

Be sure to provide all relevant parts though: the wpa_supplicant file, optionally your relevant /etc/rc.conf entries and of course making sure that your card actually works. As mentioned by the OP: if you can perform an `ifconfig wlan0 scan` then you probably covered that part.

Hope this can help.


----------

