# [solved] wpa_supplicant for rt2500pci problem

## equaeghe

Hi,

I'm trying to get my wireless working: I have a rt2500pci which I want to connect to a home WPA access point using wpa_supplicant.

I know this is possible, bacause it works under ubuntu (using it right now).

I'm running stable amd64 (so kernel 2.6.34-r12 and wpa_supplicant 7.2) and am fairly sure I have the necessary modules compiled and loaded (rt2500pci, rt2x00pci, rt2x00lib, cfg80211, mac80211) and use the wext driver for wpa_supplicant. I'm also fairly sure my wpa_supplicant.conf is good, as I looked at its log entries in my ubuntu install on my other HDD to see how networkmanager talks to wpa_supplicant to set up the connection; and they're moreover logical and reasonable.

So I think it is a driver problem of some sort (although I can be wrong about the modules and config thing).

Relevant input/edited output (I didn't manage to write wpa_supplicants output to a file using >, so I'm typing this by hand) given that assumption is, I think:

```

# wpa_supplicant -iwlan0 -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf -dd -B

... [reading config works, including passphrase, converting to psk] ...

WEXT: cfg80211 based driver detected

ioctl[SIOCSIWPMKSA]: invalid argument

ioctl[SIOCSIWMODE]: invalid argument

Could not configure driver for managed mode

ioctl[SIOCGIWRANGE]: invalid argument

ioctl[SIOCGIWMODE]: invalid argument

ioctl[SIOCGIWAP]: invalid argument

...

ioctl[SIOCSIWENCODEEXT]: invalid argument

Driver did not support SIOCSIWENCODEEXT

...

```

I'm willing to give more info if people think this is useful, but would like to start with this.

Any suggestions/ideas greatly appreciated.

TIA,

ErikLast edited by equaeghe on Tue Nov 30, 2010 9:40 pm; edited 1 time in total

----------

## idella4

ok,

show that the drivers are in place

lspci -k && lsmod | grep -e rt* -e cfg80211 -e mac80211

----------

## equaeghe

 *idella4 wrote:*   

> 
> 
> lspci -k && lsmod | grep -e rt* -e cfg80211 -e mac80211

 

lspci from my ubuntu system (I'm reinstating my chroot after this to emerge lspci & friends) 

```

03:06.0 Network controller: RaLink RT2500 802.11g (rev 01)

        Subsystem: ASUSTeK Computer Inc. WL-130g

        Kernel driver in use: rt2500pci

        Kernel modules: rt2500pci

```

lsmod from my internetless gentoo system (so a double reboot away)

```

rt2500pci              13128  0 

rt2x00pci               5043  1 rt2500pci

rt2x00lib              19454  2 rt2500pci,rt2x00pci

mac80211              147403  2 rt2x00pci,rt2x00lib

cfg80211              113348  2 rt2x00lib,mac80211

eeprom_93cx6            1256  1 rt2500pci

```

For comparison, from my ubuntu installation:

```

# lsmod | grep -e rt2[5x]00 -e *80211

rt2500pci              15689  0 

rt2x00pci               6993  1 rt2500pci

rt2x00lib              31575  2 rt2500pci,rt2x00pci

led_class               3393  1 rt2x00lib

mac80211              266657  2 rt2x00pci,rt2x00lib

cfg80211              170293  2 rt2x00lib,mac80211

eeprom_93cx6            1789  1 rt2500pci

```

so only led_class differs; I think this is harmless, but will nevertheless try to recompile my gentoo kernel with it and see what it gives

So I'll report back later; any meantime ideas appreciated,

Erik

P.S.: It's actually no big bother to give my wpa_supplicant.conf, so for good measure:

```

# The below line not be changed otherwise we refuse to work

ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration

ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection

ap_scan=1

# here come the networks

network={

  ssid="<snipped>"

  scan_ssid=1

  key_mgmt=WPA-PSK

  psk="<snipped>"

  # The higher the priority the sooner we are matched

  priority=5

}

```

and the ubuntu loglines I got this from:

```

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> Activation (wlan0/wireless): connection '<snipped>' has security, and secrets exist.  No new secrets needed.

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> Config: added 'ssid' value '<snipped>'

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> Config: added 'scan_ssid' value '1'

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> Config: added 'key_mgmt' value 'WPA-PSK'

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> Config: added 'psk' value '<omitted>'

Nov 27 22:20:18 jeje NetworkManager[1486]: nm_setting_802_1x_get_pkcs11_engine_path: assertion `NM_IS_SETTING_802_1X (setting)' failed

Nov 27 22:20:18 jeje NetworkManager[1486]: nm_setting_802_1x_get_pkcs11_module_path: assertion `NM_IS_SETTING_802_1X (setting)' failed

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> Config: set interface ap_scan to 1

Nov 27 22:20:18 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  inactive -> scanning

Nov 27 22:20:19 jeje wpa_supplicant[1511]: Trying to associate with <macaddr> (SSID='<snipped>' freq=2462 MHz)

Nov 27 22:20:19 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  scanning -> associating

... 

Nov 27 22:20:29 jeje wpa_supplicant[1511]: Authentication with <macaddr> timed out.

Nov 27 22:20:29 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  associating -> disconnected

Nov 27 22:20:29 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  disconnected -> scanning

Nov 27 22:20:31 jeje wpa_supplicant[1511]: Trying to associate with <macaddr> (SSID='<snipped>' freq=2462 MHz)

Nov 27 22:20:31 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  scanning -> associating

Nov 27 22:20:31 jeje wpa_supplicant[1511]: Associated with <macaddr>

Nov 27 22:20:31 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  associating -> associated

Nov 27 22:20:31 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  associated -> 4-way handshake

Nov 27 22:20:31 jeje wpa_supplicant[1511]: WPA: Key negotiation completed with <macaddr> [PTK=CCMP GTK=CCMP]

Nov 27 22:20:31 jeje wpa_supplicant[1511]: CTRL-EVENT-CONNECTED - Connection to <macaddr> completed (auth) [id=0 id_str=]

Nov 27 22:20:31 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  4-way handshake -> group handshake

Nov 27 22:20:31 jeje NetworkManager[1486]: <info> (wlan0): supplicant connection state:  group handshake -> completed

Nov 27 22:20:31 jeje NetworkManager[1486]: <info> Activation (wlan0/wireless) Stage 2 of 5 (Device Configure) successful.  Connected to wireless network '<snipped>'.

...

```

----------

## idella4

right,

post output of

ifconfig -a && cat /etc/conf.d/net && rc-update show

----------

## equaeghe

 *idella4 wrote:*   

> 
> 
> ifconfig -a && cat /etc/conf.d/net && rc-update show

 

```

wlan0     Link encap:Ethernet  HWaddr 00:11:2f:d5:0b:36

          BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
```

```
# To create a more complete configuration, please review /etc/conf.d/net.example 

# and save your configuration in /etc/conf.d/net (this file :]!).

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

```

Note that without explicit mention, dhcp is assumed; dhcpcd runs during gentoo boot but of course times out

```
            bootmisc | boot

             checkfs | boot

           checkroot | boot 

               clock | boot

         consolefont | boot

                dbus |      default 

            hostname | boot

             keymaps | boot 

               local |      default nonetwork 

          localmount | boot 

             modules | boot  

              net.lo | boot 

           net.wlan0 |      default 

            netmount |      default

           rmnologin | boot 

      udev-postmount |      default 

             urandom | boot       
```

P.S.: lspci -k in gentoo installation gave the same as under ubuntu

----------

## idella4

you are very close I'd say.

The drivers appear to be fine.

You ought have a wpa_supplicant script in /etc/init.d/

```

idella@genny ~ $ sudo rc-update show

Password: 

................

       wpa_supplicant |      default   

```

rc-update add  wpa_supplicant |default   

Then run

ifconfig wlan0 up

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

dhclient wlan0

The line wpa_supplicant -Dwext -iwl.....

you may find will kind of hang, as in it doesn't complete, iy mat.  If not, just open a new tab in the console to enter the last line.

repost with a big   :Laughing:   hopefully.

----------

## equaeghe

 *idella4 wrote:*   

> 
> 
> You ought have a wpa_supplicant script in /etc/init.d/
> 
> ```
> ...

 

Unfortunately this didn't work. I don't have a wpa_supplicant init script. (Where did yours come from? What does it do?) However, why would I need one: Isn't that taken care of by mentioning wpa_supplicant in my conf.d/net?

 *Quote:*   

> 
> 
> The line wpa_supplicant -Dwext -iwl.....
> 
> you may find will kind of hang, as in it doesn't complete, iy mat.  If not, just open a new tab in the console to enter the last line.
> ...

 

N.B.: Daemonizing wpa_supplicant with -B takes care of that.

----------

## idella4

right, 

 *Quote:*   

> 
> 
> Driver did not support  
> 
> 

 

This is trouble.

For now, what we haven't checked is iwconfig.

```

genny bin # equery b wpa_supplicant   

 * Searching for wpa_supplicant ... 

net-wireless/wpa_supplicant-0.7.3-r1 (/etc/wpa_supplicant)

net-wireless/wpa_supplicant-0.7.3-r1 (/etc/init.d/wpa_supplicant)

net-wireless/wpa_supplicant-0.7.3-r1 (/etc/conf.d/wpa_supplicant)

net-wireless/wpa_supplicant-0.7.3-r1 (/var/run/wpa_supplicant)

net-wireless/wpa_supplicant-0.7.3-r1 (/usr/sbin/wpa_supplicant)

```

right, I found it.  here is s good fedora link that goes right through wpa_supplicant.  There is only one little diff between the distros files & syntax, trivial.

This is what I wanted. post output of iwlist wlan0 scan

and will tell whether your driver is picking up the wireless access points.

SIOCSIWENCODEEXT is the likely root of it, need to have it included in the kernel.

----------

## equaeghe

 *idella4 wrote:*   

> 
> 
> ```
> 
> genny bin # equery b wpa_supplicant   
> ...

 

```

# equery b wpa_supplicant

[ Searching for file(s) wpa_supplicant in *... ]

net-wireless/wpa_supplicant-0.7.2-r3 (/etc/wpa_supplicant)

net-wireless/wpa_supplicant-0.7.2-r3 (/sbin/wpa_supplicant -> /usr/sbin/wpa_supplicant)

net-wireless/wpa_supplicant-0.7.2-r3 (/var/run/wpa_supplicant)

net-wireless/wpa_supplicant-0.7.2-r3 (/usr/sbin/wpa_supplicant)

```

So different versions explains that difference.

 *Quote:*   

> 
> 
>  iwlist wlan0 scan
> 
> and will tell whether your driver is picking up the wireless access points.
> ...

 

I needed to emerge wireless-tools first (in my chroot) and then I got:

```

wlan0     interface does not support scanning

```

which I guess is not good

 *Quote:*   

> 
> 
> SIOCSIWENCODEEXT is the likely root of it, need to have it included in the kernel.

 

Hmm, which modules/configuration options to set, do you think?

I supposed menuconfig would automatically enable/fix the right ones, but I guess they can't really, because some people need to connect to wpa, some to wep, and some to open AP's. That's something I'll investigate tonight (now back to work).

N.B.idella4, you've been very helpful already, thanks! Keep the ideas coming, please.

----------

## idella4

equaeghe

same for you.  I am baffled why I'm the only respondent for your query.  I normally never peruse this sub forum, only I have a post, and there are at lest 3 of you with similar network connectivity issue.

Oh well,

You may have to finish this off yourself, however here is the direction plan.

I found this months ago when I posted one similar to yours.    SIOCSIFFLAGS is clearly along the same lines.  Take the rfkill suggested use fix, and follow the kernel config suggested in the submission.

If not quite it, keep searching the ubuntu and the  gentoo  bugzilla for bugs submitted of this type.

It almost definitely will be there.

You could peruse the kernel config, I tried a few grep on the config but nothing came up.

What you may not have yet done is invoke make defconfig in your kernel, and observe the seeings it creates.  They're often quite right for the bread & butter basics.

Also make the most of the fedora guide.  gentoo has its own on the wiki for wpa-...

repost.

----------

## equaeghe

 *idella4 wrote:*   

> 
> 
> I found this months ago when I posted one similar to yours.    SIOCSIFFLAGS is clearly along the same lines.  Take the rfkill suggested use fix, and follow the kernel config suggested in the submission.
> 
> 

 

I have no problems with ifconfig'ing wlan0 up, so this didn't provide a lead.

Using rfkill list gave all interfaces unblocked.

 *Quote:*   

> 
> 
> What you may not have yet done is invoke make defconfig in your kernel, and observe the seeings it creates.  They're often quite right for the bread & butter basics.
> 
> 

 

I'll try that.

Currently, I think that I first should get iwconfig to find wireless extensions on my wlan0 interface in gentoo (ok under ubuntu), that should be independent of wpa_supplicant, so I'm now thinking the problem is not being to wpa_supplicant.

----------

## idella4

equaeghe;

right, if so look into the kernel.

----------

## equaeghe

 *idella4 wrote:*   

> 
> 
> right, if so look into the kernel.

 

Solved! 

Networking->Wireless->cfg80211 wireless extensions compatibility (CFG_80211_WEXT)

(Thanks to another post in this forum.)

----------

