Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED!] madiwfi startup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 7:38 am    Post subject: [SOLVED!] madiwfi startup Reply with quote

good morning,

I have read several posts about recent problems using madwifi, especially in combination with wpa_supplicant. however, I could get a stable connection using the madwifi drivers and wpa_supplicant, but I dunno how to automate the startup process.

what I need to do to get a connection is:

create wifi0
Code:
wlanconfig ath0 create wlandev wifi0 wlanmode sta


up ath0
Code:
ifconfig ath0 up


start supplicant
Code:
wpa_supplicant -c /etc/wpa_supplicant.conf -Dmadwifi -iath0


get ip adress

Code:
dhcpcd ath0


voila, here we go. it works fine. :) my questions now is, is there a way to automate this process or do I need to write my own init script? since there is no net.ath0 I dunno what to do. linking ath0 to net.lo or net.eth0 does not work. it tries to start ath0 but cannot associate with any access points.
but since it works the hard way, I'm pretty sure /etc/conf.d/net and wpa_supplicant.conf are right.

thanks in advance
trilexx
_________________
if it lives, compile it :D


Last edited by trilexx on Tue Jan 24, 2006 7:46 am; edited 1 time in total
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 8:17 am    Post subject: Reply with quote

Hi! :)
First of all, if you want ath0 to be created on each startup, you'll need to emerge udev-081 or 081-r1.
Then in /etc/conf.d/net, you need to have this:
Code:
modules=( "wpa_supplicant" )
wpa_supplicant_eth0="-Dmadwifi"
config_ath0=( "dhcp" )


And now :
Code:
# ln -s /etc/init.d/net.lo /etc/init.d/net.ath0
# rc-update add net.ath0 start


This should be enough. :wink:
Have fun!
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 8:48 am    Post subject: Reply with quote

Quote:
wpa_supplicant_eth0="-Dmadwifi"


I have a correct wpa_supplicant.conf with the settings you mentioned, but are you sure I have to specify eth0 here?

I am not sure about udev though, this is a newly setup system. I thought udev is installed anyway on new gentoo systems.

thanks for your reply,
trilexx
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 9:00 am    Post subject: Reply with quote

trilexx wrote:
Quote:
wpa_supplicant_eth0="-Dmadwifi"
I have a correct wpa_supplicant.conf with the settings you mentioned, but are you sure I have to specify eth0 here?

My mistake, sorry about this. This is:
Code:
wpa_supplicant_ath0="-Dmadwifi"

But I didn't mention anything about /etc/wpa_supplicant.conf. The settings I told you about are for: /etc/conf.d/net .
If you think it's weird, just parse /etc/conf.d/net.example, it helps a lot.
trilexx wrote:
I am not sure about udev though, this is a newly setup system. I thought udev is installed anyway on new gentoo systems.

Yes, you're right, udev is always installed with the gentoo base system (on newer versions at least). The thing is madwifi-tools package writes a udev rule (/etc/udev/rules.d/65-madwifi.rules) that's meant to create ath0 iface on each startup. AND this rule doesn't work with versions of udev prior to 081.
So:
Code:
# echo "sys-fs/udev ~x86" >> /etc/portage/package.keywords
# emerge -u udev


trilexx wrote:
thanks for your reply,
trilexx

You're welcome! :)
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 9:18 am    Post subject: Reply with quote

Quote:
But I didn't mention anything about /etc/wpa_supplicant.conf. The settings I told you about are for: /etc/conf.d/net.


Sorry, my mistake. I meant to write /etc/conf.d/net. The files are fine and contain what you listed above.

Quote:
...AND this rule doesn't work with versions of udev prior to 081.
So:
Code:
# echo "sys-fs/udev ~x86" >> /etc/portage/package.keywords
# emerge -u udev



that's it! I will try it as soon as I am at home. thanks, mate :)

greetings from austria
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 9:23 am    Post subject: Reply with quote

trilexx wrote:
that's it! I will try it as soon as I am at home. thanks, mate :)
greetings from austria

Ok! Let us know then! :wink:
And.....french kisses from Paris! :P (just playin' mate! :wink: )
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 6:51 pm    Post subject: Reply with quote

hmm...

this leads to:

Code:
*Couldn't find any access points on ath0
*Failed to configure wireless for ath0


the net and wpa_supplicant.conf must be right, as I can connect manually. whats wrong now? :(
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 6:58 pm    Post subject: Reply with quote

trilexx wrote:
the net and wpa_supplicant.conf must be right, as I can connect manually. whats wrong now? :(

Please post them, and /etc/conf.d/wireless also (Though I'm not sure it's needed when using wpa_supplicant)
How did you start your card? /etc/init.d/net.ath0 start ? Can you give the full output you get from it?
thx! :wink:
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 7:24 pm    Post subject: Reply with quote

output:
Code:
 * Starting ath0
 *   Configuring wireless network for ath0
 *     no access points found
 *   Couldn't find any access points on ath0
 *   Failed to configure wireless for ath0                                [ !! ]


my net:
Code:
preferred_aps=( "cloudcity" )
associate_order="preferredonly"
wpa_supplicant_ath0="-Dmadwifi"
wpa_timeout_ath0=10
dhcpcd_ath0="-t 5"
config_ath0=( "dhcp" )
dhcpcd_ath0="-t 5"


wpa_supplicant.conf:
Code:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=2
fast_reauth=1

#WPA-PSK
network={
        ssid="cloudcity"
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk=" *** "
        priority=5
}


my wirless.conf is empty. I ran etc-update after upgrading udev.
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
optiactive
Tux's lil' helper
Tux's lil' helper


Joined: 08 May 2004
Posts: 92

PostPosted: Mon Jan 23, 2006 7:39 pm    Post subject: Reply with quote

You need to specify to use wpa_supplicant in your /etc/conf.d/net file:

Code:
modules=( "wpa_supplicant" ) <--------------- Add this line
preferred_aps=( "cloudcity" )
associate_order="preferredonly"
wpa_supplicant_ath0="-Dmadwifi"
wpa_timeout_ath0=10
dhcpcd_ath0="-t 5" <------------------- Also, you can remove this line, as you have a duplicate below
config_ath0=( "dhcp" )
dhcpcd_ath0="-t 5"


Check out the wireless networking guide, if you haven't already.
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 7:39 pm    Post subject: Reply with quote

You forgot to comment this out in /etc/conf.d/net:
Code:
#modules=( "wpa_supplicant" )

If it's not commented out the scripts try to use wireless-tools instead and /etc/conf.d/wireless, which is empty. That's why it can't configure your network.
Not sure but I think you should also increase the dhcpcd_ath0 value as wpa is quite long to associate.
Let me know.
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 7:45 pm    Post subject: Reply with quote

omg, what a mistake! :oops:

will try this now. *crossfingers*
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 7:48 pm    Post subject: Reply with quote

ok, tried this.

its trying to connect, but times out. both the dhcp and wpa timeout values have been increased.
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 7:57 pm    Post subject: Reply with quote

trilexx wrote:
ok, tried this.

its trying to connect, but times out. both the dhcp and wpa timeout values have been increased.

Which values exactly?
Double-check you PSK and try:
ap_scan=1
Give us again the output of /etc/init.d/net.ath0 please! :)
Back to top
View user's profile Send private message
optiactive
Tux's lil' helper
Tux's lil' helper


Joined: 08 May 2004
Posts: 92

PostPosted: Mon Jan 23, 2006 8:02 pm    Post subject: Reply with quote

Adrien wrote:
You forgot to comment this out in /etc/conf.d/net:
Code:
#modules=( "wpa_supplicant" )

If it's not commented out the scripts try to use wireless-tools instead and /etc/conf.d/wireless, which is empty. That's why it can't configure your network.
Not sure but I think you should also increase the dhcpcd_ath0 value as wpa is quite long to associate.
Let me know.


I thought it was the other way around. You need to leave the modules line in so that the system knows to use wpa_supplicant, instead of wireless-tools.

If /etc/conf.d/wireless is empty, just remove it. Maybe the system is choking on the fact that the file exists.
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 8:02 pm    Post subject: Reply with quote

output:

Code:
* Starting ath0.... [ok]
*  Starting wpa_supplicant on ath0... [ok]
*    timed out [!!]


I have increased the WPA timeout to 20, and dhcp to 10.
PSK MUST be correct, otherwise I could not connect manually running the commands. Using ap_scan=1 does't change anything, same output. :(
I have disabled SSID broadcasting, I'll enable this now, just to be sure.

see you in a minute :P
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 8:04 pm    Post subject: Reply with quote

optiactive wrote:
I thought it was the other way around. You need to leave the modules line in so that the system knows to use wpa_supplicant, instead of wireless-tools.

Maybe my english is not right, when I said "comment out", I meant: "remove the comment symbol '#' " Is that right? :roll:
Back to top
View user's profile Send private message
optiactive
Tux's lil' helper
Tux's lil' helper


Joined: 08 May 2004
Posts: 92

PostPosted: Mon Jan 23, 2006 8:07 pm    Post subject: Reply with quote

Adrien wrote:
optiactive wrote:
I thought it was the other way around. You need to leave the modules line in so that the system knows to use wpa_supplicant, instead of wireless-tools.

Maybe my english is not right, when I said "comment out", I meant: "remove the comment symbol '#' " Is that right? :roll:


Yeah, I was confused because your status is "veteran", so I'm pretty sure you know what you're talking about. But, you never know. Oh, and to shorten "remove the comment symbol", just say "uncomment". :)
Back to top
View user's profile Send private message
trilexx
Apprentice
Apprentice


Joined: 19 Jul 2004
Posts: 217
Location: Austria

PostPosted: Mon Jan 23, 2006 8:10 pm    Post subject: Reply with quote

I did understand you right :) hey, still the same continent... :P

well, and it finally works! enabling SSID broadcast and ap_scan=2, it can connect within 3 seconds!
my thanks goes out to Adrien! many thanks! :) people like you make the gentoo community to what it is.

hope to see you soon again, on the boards, or icq? :)

see ya!

PS.: "ni**e la police" are the only words I can say in french :P
PPS.: of course, big thank you to optiactive too. ;)
_________________
if it lives, compile it :D
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 8:11 pm    Post subject: Reply with quote

optiactive wrote:
Yeah, I was confused because your status is "veteran", so I'm pretty sure you know what you're talking about. But, you never know.

If you knew how n00bish I am, you'd have a good laugh! :lol:
optiactive wrote:
Oh, and to shorten "remove the comment symbol", just say "uncomment". :)

Thanks! :) This is quite OFF but, is "to comment out" also right or not?

Edit:
trilexx wrote:
PS.: "ni**e la police" are the only words I can say in french :P

:lol:
Glad it works! See you!


Last edited by Adrien on Mon Jan 23, 2006 8:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
optiactive
Tux's lil' helper
Tux's lil' helper


Joined: 08 May 2004
Posts: 92

PostPosted: Mon Jan 23, 2006 8:14 pm    Post subject: Reply with quote

Adrien wrote:
optiactive wrote:
Yeah, I was confused because your status is "veteran", so I'm pretty sure you know what you're talking about. But, you never know.

If you knew how n00bish I am, you'd have a good laugh! :lol:
optiactive wrote:
Oh, and to shorten "remove the comment symbol", just say "uncomment". :)

Thanks! :) This is quite OFF but, is "to comment out" also right or not?


Yes, if you mean you want to add the # symbol to a line, you say "comment out" the line.
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Jan 23, 2006 8:18 pm    Post subject: Reply with quote

optiactive wrote:
Yes, if you mean you want to add the # symbol to a line, you say "comment out" the line.

thx again! I guess it'll will avoid extra issues in the forum! :lol:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum