You are not logged in.

#1 2008-09-06 11:51:36

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

information regarding wpa_supplicant and netcfg v2

Hi all, just downloaded and installed the Overlord release of Arch. All went straight, even if I think that I miss some packages (even if I downloaded the CORE and not FTP image)

Anyway, I would like to know how netcfg calls wpa_supplicant, because with a netcfg profile I can't connect to my wireless lan (I get an error regarding wpa_ctrl_open: No such file or dir), while I can connect regularly associating to my router with -Dwext option passed to wpa_supplicant


My profile:

CONNECTION="wireless"
INTERFACE=wlan0
SCAN="yes"
SECURITY="wpa"
ESSID="myssid"
KEY="mykey"
IP="dhcp"

I get that error then it stucks some seconds and exit failing...Any idea or help?

Offline

#2 2008-09-06 11:54:00

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: information regarding wpa_supplicant and netcfg v2

Just let wpa_supplicant handle the authentication completely, like this:

[stijn@hermes ~]$ cat /etc/network.d/intel 
CONNECTION="wireless"
INTERFACE="intel"
HOSTNAME="hermes"

# AP authentication
SCAN="yes"
SECURITY="wpa-config"
WPA_CONF="/etc/wpa_supplicant.conf"
WPA_OPTS="-Dwext -B"
ESSID="BorrominiNet"

# IP address
IP="dhcp"
DHCP_TIMEOUT=10

Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2008-09-06 12:09:48

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: information regarding wpa_supplicant and netcfg v2

Whats the exact output of netcfg.

Sometimes you get that error if wpa_supplicant is a tad slow starting up. It's harmless and doesnt happen very often.

Last edited by iphitus (2008-09-06 12:24:19)

Offline

#4 2008-09-06 12:46:48

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

The exact output is: "Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file. \n Wireless association failed"

I tried the setting proposed by B, too, but still can't manage how to connect with netcfg, so to connect on boot without too many worries

Offline

#5 2008-09-06 13:33:34

rockdrigo_a
Member
Registered: 2008-09-06
Posts: 1

Re: information regarding wpa_supplicant and netcfg v2

you tried with netcfg2 yourprofile  ??
and..what is your essid name ?

Offline

#6 2008-09-06 13:53:28

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: information regarding wpa_supplicant and netcfg v2

lafayette wrote:

The exact output is: "Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file. \n Wireless association failed"

I tried the setting proposed by B, too, but still can't manage how to connect with netcfg, so to connect on boot without too many worries

Few seconds delay between the wpa_supplicant error and the association failed message? If so, ignore the wpa_supp error and focus on the association.

Have a look at the wiki page with regards to association issues and try the netcfg in [testing]. Also, what wireless driver?

Last edited by iphitus (2008-09-06 13:54:05)

Offline

#7 2008-09-06 13:59:40

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

Exactly. immediately the error and, a bunch of seconds later, the failing of association. I'm using mrv10k851 with ndiswrapper, module ndiswrapper is loaded at boot. Now I'll read something in the wiki.

p.s. can I update netcfg with pacman? if yes, how?

Offline

#8 2008-09-06 14:43:49

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

no good news...I've updated netcfg to testing/ one, tried with some different combo of QUIRKS but nothing, still get exactly the same error...

Offline

#9 2008-09-06 17:39:07

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

what should I put in SECURITY field? wpa or wpa_config?

Offline

#10 2008-09-07 07:07:05

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: information regarding wpa_supplicant and netcfg v2

SECURITY=wpa_config

tells netcfg to use a pre-existing wpa_supplicant.conf file.

SECURITY=wpa

tells netcfg to create a wpa_supplicant.conf file on the fly and use it. Until you get this debugged, you want to keep the variables to a minimum, so stick to SECURITY=wpa_config. You say you can connect manually, without using netcfg. Can you post the exact commands that you use to successfully connect? Also post what your wireless driver is. And one commenter asked what your ESSID is: there may be issues if it contains spaces or special characters. There shouldn't be, but there may be. So it's good to eliminate that possibility if we can.

Last edited by Profjim (2008-09-07 07:08:02)

Offline

#11 2008-09-07 09:38:59

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

the exact command I give, immediately after logging (root) is:
"wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf"

then, after some seconds (between 5 and 10) I get associated, so just an i

fconfig wlan0 192.168.0.100

and a

route add default gw 192.168.0.1

the essid is: homewifinet, pretty straight I think

As I said, driver is mrv10k851 on ndiswrapper

Offline

#12 2008-09-07 17:46:21

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: information regarding wpa_supplicant and netcfg v2

Sorry, missed that you had already told us the driver. Your setup looks pretty straightforward. Netcfg should be sending exactly the same commands to wpa_supplicant. I've looked at the netcfg scripts closely but I don't have experience with a lot of drivers, so for all I know maybe there's something funny with ndiswrapper.

Does this profile work?

CONNECTION="wireless"
INTERFACE=wlan0"
SCAN="yes"
ESSID="homewifinet"
SECURITY="wpa-config"
WPA_CONF="/etc/wpa_supplicant.conf"
IP="dhcp"

[Edit] Don't know why I said "wpa_config" (with underscore) in earlier post. It's SECURITY=wpa-config and WPA_CONF=<file>, as in the above profile.

Last edited by Profjim (2008-09-07 17:47:56)

Offline

#13 2008-09-07 21:43:40

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

well, I've reached a configuration that almost works, using wpa-config options and passing the same command I wrote before. The almost is because sometimes doesn't works, due to the timeout I think. I thought a value of 30 would be enough but, seems that isn't.

A last question: difference between netcfg and netcfg2? both can handle the network profiles? Which is the one invoked on boot?

Offline

#14 2008-09-08 11:49:01

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: information regarding wpa_supplicant and netcfg v2

If you have netcfg2 installed (at least, the one from testing, I don't know about earlier versions), then netcfg is just a symlink to netcfg2.

Offline

#15 2008-09-08 12:38:25

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

perfect. Yes, I think the symlink was created when I installed netcfg2 from testing.

Anyway, the strange fact is that it can't connect no more now, but issuing the same wpa_supplicant command from console gets me associated in just 3-4 seconds. I'll post my profile here

CONNECTION="wireless"
INTERFACE="wlan0"
HOSTNAME="archbox"

# AP authentication
SCAN="yes"
SECURITY="wpa-config"
WPA_CONF="/etc/wpa_supplicant.conf.mine"
WPA_OPTS="-Dwext -B -iwlan0"
ESSID="homewifinet"

# IP address
IP="static"
IFOPTS="192.168.0.100 netmask 255.255.255.0"
GATEWAY="192.168.0.1"
DNS1="192.168.0.1"
TIMEOUT="30"

Offline

#16 2008-09-08 13:56:41

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: information regarding wpa_supplicant and netcfg v2

Try setting SCAN="no"

Don't put anything in WPA_OPTS, what you've put there is already passed to wpa_supplicant, so it's just going to cause problems.

Also... could you continue to give us the exact message from netcfg, instead of "it can't connect". With netcfg2 I intentionally made the failure messages clear and useful -- even if it is just two words "association failed"

Offline

#17 2008-09-08 14:52:45

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

okI'll try removing the WPA_OPTS string when I'll be back home. Sorry for the lack of precision, but actually I'm getting always the same pretty bare string: "Wireless association failed".

I'll try tonite removing SCAN and WPA_OPTS and I'll let you know. Anyway thanks for the great support you're giving me, that's great

Offline

#18 2008-09-08 17:39:43

tut
Member
Registered: 2008-09-08
Posts: 12

Re: information regarding wpa_supplicant and netcfg v2

I have some problem regarding wpa and netcfg, too. So I thought I can continue with this thread. I can connect to a wireless network with the command wpa_supplicant -Bw -c /etc/wpa_supplicant.conf -i eth1 and dhcpcd eht1. My wpa_suppclicant.conf looks like:
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="mynetwork"
scan_ssid=1
key_mgmt=WPA-PSK
psk="mykey"
}
Then I tried to connect via netcfg with a profile like the ones that were posted in this thread before (I tried different options), but netcfg says (after starting it with netcfg2 myprofile):
err, eth1: read: Network is down
err, eth1: sendto: Network is down
err, eth1: sendto: Network is down
etc.
until timout occurs
and then: wpa_supplicant did not start, possible configuration [FAIL].
Does someone have an idea whats wrong?

Offline

#19 2008-09-08 18:43:44

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

just tried commenting out WPA_OPTS and putting SCAN to no, but still quits with a "Wireless association failed"

As a further information, I post the output I get when I issue the "wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf.mine" from console

ioctl[SIOCSIWPMKSA]: Invalid argument
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Trying to associate with 00:14:6c:6d:60:22 (SSID='homewifinet' freq=2452 MHz)
Associated with 00:14:6c:6d:60:22
WPA: Key negotiation completed with 00:14:6c:6d:60:22 [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:14:6c:6d:60:22 completed (auth) [id=0 id_str=]

Last edited by lafayette (2008-09-08 18:44:56)

Offline

#20 2008-09-09 10:49:23

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

seems that sometimes it works and sometimes not...tried also setting an high timeout but nothing, I think it's not depending on it...I think I will stuck on 3 lines in rc.local and avoid network profiles until wpa_supplicant will become a little more robust

Offline

#21 2008-09-10 20:39:41

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

no ideas?...

Offline

#22 2008-09-10 21:47:36

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: information regarding wpa_supplicant and netcfg v2

Hi tut and lafayette, sorry, no ideas based on the information you're able to give.

iphitus, maybe it'd be a useful to add a --verbose or --debug option to the next version of netcfg[2? 3?], to spit out lots of status messages, to help in troubleshooting other users' configs.

In the meantime, all I can suggest to you guys is to start looking at the netcfg2 code. It's just a set of bash scripts. If you throw some echo...s into /usr/lib/network/wireless.subr you might get more information about what step of the process isn't working. If you can connect manually then netcfg2 should be able to give the same commands and do it for you. When you're done playing around with the code, you can just reinstall netcfg2 and it'll overwrite your mods with the original scripts.

If your bash-scripting is rusty, or you're still learning, then I realize this won't be an option. Again, sorry, but I'm out of ideas right now.

Offline

#23 2008-09-11 09:33:10

lafayette
Member
From: Italy
Registered: 2004-10-17
Posts: 58

Re: information regarding wpa_supplicant and netcfg v2

thanks anyay...Actually I saw in deep the wireless section of wireless.subr, the commands that it issues and so on, but really have no idea of why is not working...I saw a pid control and so on, the thing I can't manage to understand is how with some greps and text editing, the script gets to know if card is associated or not..I'll keep on studying anyway

Offline

#24 2008-09-11 13:18:41

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: information regarding wpa_supplicant and netcfg v2

That I can answer.

This is based on my own, somewhat-hacked install of netcfg2 (what can I say, I'm compelled to fiddle), so I may conceivably get something wrong. But I think what I'm about to say should be true of a fresh install from the testing repo.

The wpa_check() function issues a call of "wpa_cli -i wlan0 status" (substituting whatever is the right interface for "wlan0". Try that sometime when you're associated. You'll see that one of the lines returned is of the form "wpa_state=COMPLETED". The wpa_check function pipes the output of the wpa_cli status call to a grep that selects just the wpa_state=... line, and then it eval's the result. So when you have associated, the variable wpa_state gets set to COMPLETED. When you haven't associated, it gets set to something else (or nothing, I forget. Maybe it gets set to ASSOCIATING? or SCANNING?).

The wpa_check() function looks to see if wpa_state is equal to COMPLETED, if so it returns 0 (success). Otherwise it increments a timeout counter, sleeps for a moment, then tries again.

Offline

#25 2008-09-12 05:46:14

tut
Member
Registered: 2008-09-08
Posts: 12

Re: information regarding wpa_supplicant and netcfg v2

netcfg2 still istn't worknig, but I tried netcfg-auto-wireless with the configuration-file I posted above and that works fine. One problem still remaining is that netcfg-auto-wireless can only be run by root. Is there a possibility to start network connection as non-root user?

Offline

Board footer

Powered by FluxBB