# Wpa_supplicant not working at all

## s101

Hi to all. I've just reinstalled Gentoo (x86_64, kernel 3.1.6) on my PC. I got the drivers for my wireless card (Broadcom 4357) and got them working, but still I can't connect to any wireless network using wicd or wpa_supplicant. 

When I try to connect using wicd (I can scan for networks normally, meaning wireless drivers are just fine), it tries to connect as normal, but instead of showing the ESSID of the network on the statusbar below, I got a weird None: Validating autentication. Eventually it says it's disconnected or "Bad Password".

When I try to use wpa_supplicant (which isn't in any runlevel, since wicd should start it as needed), either with GUI or not, I can't get it to scan networks. The output it gives me when using wpa_cli is:

```

wpa_cli v0.7.3

Copyright (c) 2004-2010, Jouni Malinen <j@w1.fi> and contributors

This program is free software. You can distribute it and/or modify it

under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the

BSD license. See README and COPYING for more details.

Could not connect to wpa_supplicant - re-trying

```

This is my /etc/conf.d/net (of course my wireless interface is eth1)

```

config_eth0="dhcp"

modules="dhcpcd wpa_supplicant"

config_eth1="dhcp"

wpa_supplicant_eth1="-Dwext" 

```

And this is my ifconfig

```

eth0      Link encap:Ethernet  HWaddr 00:26:9e:f0:78:79  

          inet addr:192.168.1.189  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::226:9eff:fef0:7879/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:21106614 (20.1 MiB)  TX bytes:2649885 (2.5 MiB)

          Interrupt:46 Base address:0xc000 

eth1      Link encap:Ethernet  HWaddr c4:17:fe:34:b6:b3  

          inet addr:169.254.48.107  Bcast:169.254.255.255  Mask:255.255.0.0

          inet6 addr: fe80::c617:feff:fe34:b6b3/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:6 errors:0 dropped:0 overruns:0 frame:862

          TX packets:9 errors:115 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:918 (918.0 B)  TX bytes:1604 (1.5 KiB)

          Interrupt:16 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

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

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

          collisions:0 txqueuelen:0 

          RX bytes:18272 (17.8 KiB)  TX bytes:18272 (17.8 KiB)

```

Thanks to every person who's going to help me.

Matt.

----------

## mikegpitt

Can you post your /etc/wpa_supplicant/wpa_supplicant.conf?

I've not used wicd, but I do use wpa_supplicant, and I start it by starting up the /etc/init.d/net.wlan0 init script (in your case net.eth1).

----------

## s101

Here's my wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=users

update_config=1 

```

And I just realized there's no /etc/init.d/net.eth1 in my init scripts -.-

----------

## mikegpitt

You will need to create a wpa_supplicant.conf to use it directly (again I'm not sure if wicd requires this, or has a separate configuration, but either way it should get your wireless working).  The easiest way I've always found to creating your wpa_supplicant.conf is to use wpa_gui (part of the wpa_supplicant package).  Scan for your network, and fill in the blanks (usually just the password for your network).

As for the missing init script, do this:

```
cd /etc/init.d

ln -s net.lo net.eth1

rc-update add net.eth1 default

/etc/init.d/net.eth1 restart
```

----------

## s101

Wicd doesn't require wpa_supplicant.conf, I just looked back at the backup configuration files of my old installation (where wicd worked just fine) and the file wasn't there. I tried to stop wicd and start wpa_gui, but it can't scan for any network at all. and it says "Could not get status from wpa_supplicant". Maybe (speculation of a noob like myself) it's a dbus problem?

Thank you a lot for your help,  mikegpitt.

----------

## mikegpitt

It sounds like you wireless card isn't functioning properly.  I believe this card requires extra firmware to be installed for the driver to work.  Have you installed the firmware?  I'm not 100% sure about this card, but a lot of firmware is packaged in the linux-firmware package:

```
emerge sys-kernel/linux-firmware
```

If you check your dmesg, you might see errors/messages about what is happening.  Look for eth1 or something specific about the Broadcom hardware.  Post back any interesting lines if the firmware installation doesn't do the trick.

----------

## Gusar

Which driver did you install? From the looks of your ifconfig, it seems you're using the wl driver. The worst possibility, IMO. Use either brcmsmac or b43 instead, both support this card.

For brcmsmac, activate it in the kernel as module and install the linux-firmware package.

For b43, activate bcma and b43 as modules and make sure N-PHY support in b43 is enabled. Then install b43-fwcutter (the newest from ~arch, the stable one is way too old) and install firmware according to the instructions here depending on which kernel you have.

----------

## cach0rr0

just to confirm a few bits:

-wicd does NOT use wpa_supplicant.conf (it creates and uses its own)

-for testing, no need to run wpa_cli or wpa_gui. Just fire off wpa_supplicant from the command line, e.g. wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf, which does of course require a filled-out wpa_supplicant.conf. 'man wpa_supplicant.conf' should show a few decent examples

-make sure you're not hitting this bug: https://bugs.gentoo.org/show_bug.cgi?id=391397 (workaround/fix at https://bugs.gentoo.org/show_bug.cgi?id=391397#c4)

----------

## s101

Yesterday I tried by allowing hotplug in /etc/rc.conf 

```

rc_hotplug="*"

```

And it seemed to work for a while... but when I got home, I couldn't connect to my home wireless network. I noticed wicd brings eth1 (my wireless interface) down; each time I try to connect eth1 disappears from my ifconfig (the same I posted in the first post). 

Took a look at the bugs, and it may be a definite possibility as well... I'm trying to give a shot at networkmanager rather than wicd.

Again, thank you all for the support.

Matt.

----------

## s101

Looks like NetworkManager doesn't fare any better. As for wicd, it shows wireless networks correctly, but it can't connect at all, and endlessly tries to reconnect. I'm starting to think it's an interface issue, because when connecting via wicd, it shows "None: validating autentication" rather than "<Network ESSID>: validating autentication", as though it's not using the correct interface.

----------

## cach0rr0

 *s101 wrote:*   

> when connecting via wicd, it shows "None: validating autentication" rather than "<Network ESSID>: validating autentication", as though it's not using the correct interface.

 

I get that often, though i successfully connect to "None" just fine, even though my SSID is clearly visible as "FBI Surveillance"

the command-line wpa_supplicant test is the most pertinent one. If that results in authenticated/associated, the next test is to manually fire off a "dhcpcd wlan0" (or whatever your wireless interface is) from a terminal, whilst wpa_supplicant is still running in another terminal

----------

## s101

I'm getting really confused. My PC can connect just fine to the wireless network we have at my workplace, but can't when I am at home. That's what I get on dmesg:

```

[  966.874164] r8169 0000:03:00.0: eth0: link down

[  966.874180] r8169 0000:03:00.0: eth0: link down

[  966.874977] ADDRCONF(NETDEV_UP): eth0: link is not ready

[  966.946305] r8169 0000:03:00.0: eth0: link down

[  966.946321] r8169 0000:03:00.0: eth0: link down

[  966.947137] ADDRCONF(NETDEV_UP): eth0: link is not ready

[  969.989205] r8169 0000:03:00.0: eth0: link up

[  969.989999] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

[  979.111010] r8169 0000:03:00.0: eth0: link down

[  979.111027] r8169 0000:03:00.0: eth0: link down

[  979.111804] ADDRCONF(NETDEV_UP): eth0: link is not ready

[  981.366331] iwconfig used greatest stack depth: 2816 bytes left

[  981.420089] INFO @__wl_cfg80211_scan : system busy : scan for "sky_mtom" canceled

[  982.162120] r8169 0000:03:00.0: eth0: link up

[  982.162963] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

[  985.462994] CE: hpet increased min_delta_ns to 30169 nsec

[  989.990734] eth1: no IPv6 routers present

[  992.764045] eth0: no IPv6 routers present

[  999.488915] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[  999.488941] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1001.508143] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1001.508170] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1003.512484] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1003.512510] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1007.481538] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1007.481564] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1009.500919] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1009.500944] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1013.478263] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1013.478289] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1027.468384] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1027.468419] ERROR @wl_cfg80211_get_station : Could not get rssi (-22)

[ 1052.014700] cfg80211: Calling CRDA for country: TW

[ 1052.784454] r8169 0000:03:00.0: eth0: link down

[ 1052.784467] r8169 0000:03:00.0: eth0: link down

[ 1052.785253] ADDRCONF(NETDEV_UP): eth0: link is not ready

[ 1052.832527] r8169 0000:03:00.0: eth0: link down

[ 1052.832542] r8169 0000:03:00.0: eth0: link down

[ 1052.833324] ADDRCONF(NETDEV_UP): eth0: link is not ready

[ 1055.869968] r8169 0000:03:00.0: eth0: link up

[ 1055.870764] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

[ 1063.489431] eth1: no IPv6 routers present

[ 1066.366690] eth0: no IPv6 routers present

```

I get many errors where "wl_cfg80211" is involved. Maybe it's a kernel issue? I have lib80211 compiled as a module, though it is loaded at boot normally and figures on my lsmod list.

----------

## mikegpitt

Found this link, that describes the "ERROR @wl_cfg80211_get_station : Could not get rssi (-22) " issue:

http://www.gossamer-threads.com/lists/gentoo/user/246185

Perhaps moving to an older kernel will help?

----------

## s101

Thank you mikegpitt. I'm on 3.1.6 currently, but I'll give it a try as soon as I have some time.

----------

