An error message is printed now :)
My lappy doesn't scan, and it prints out an error message for me

Also, I've added the timeout to association (10 secs) and changed the header.

Thanks. I'll try it out... I tried putting "ndiswrapper" into my modules.autoload.d/kernel-2.6 file, but for whatever reason that causes wlan0 to be brought up really early in the boot sequence and causes lot of "run depscan.sh" errors. It doesn't see to work correctly anyway. I'll try using your sript vanilla instead of my changes and see if that fixes things...

BTW: In this iwlist section of the script, don't you want $IFACE instead of eth1?

Thanks. I'll try it out... I tried putting "ndiswrapper" into my modules.autoload.d/kernel-2.6 file, but for whatever reason that causes wlan0 to be brought up really early in the boot sequence and causes lot of "run depscan.sh" errors. It doesn't see to work correctly anyway. I'll try using your sript vanilla instead of my changes and see if that fixes things...

If my vanilla script has depscan.sh errors, please post them here or email me them so I can fix em

When I'm happy that enough people are using it with a minimum of fuss, I'll submit it as a patch (ie create a diff file against the origonal /etc/init.d/net.etho and /etc/conf.d/net) to bugs.gentoo.org

Say, if there aren't anymore changes by the end of the week to this little script then I'll submit it.

Remember, baselayout is critical to a happily running gentoo, and gentoo really needs a working network!

It'd be nice if there was a way to specifiy access point's preferred order. In particular, I live on a college campus out in the apartement building area. There are currently probably 5-10 APs visible to me.

It'd also be nice to specify dhcp or an ip and router on a per-essid basis. Again, at home I use a static IP and encryption/mac addy filtering while on campus I connect to the campus DHCP+cisco vpn network.

I may hack at the script, but at the moment I'm more interested in hacking together a ndiswrapper ebuild. Been having issues with getting the driver compile to work (tries to jump out to the kernel source dir and build in the ndis dir, and it just dies. Probably easy to fix but haven't ever really delved into ebuilds that deeply before.)

It'd be nice if there was a way to specifiy access point's preferred order. In particular, I live on a college campus out in the apartement building area. There are currently probably 5-10 APs visible to me.

It'd also be nice to specify dhcp or an ip and router on a per-essid basis. Again, at home I use a static IP and encryption/mac addy filtering while on campus I connect to the campus DHCP+cisco vpn network.

I can add the dhcp / static ip + gateway options easily enough. Hopefully do that tomorrow! No promises though - I've gotta busy week of real work head :/

Not sure how to do a preffered order for AP's though. I'll think about it

I'll look into possibly snagging it and playing with the code -- easy enough to test cause I've got plenty of APs around. ;-) I didn't get ndiswrapper working right, but I got a first shot at the ebuild and tossed it up as a bug.

Same type of problem here. I've got a Netgear MA401 card. In XP it works fine. But under Gentoo it won't link up. I tried setting the ESSID to be the network name ("Wireless". Who came up with that I don't know. This is at school).
My card gets named wlan0 by the kernel. It shows for ifconfig:

OK, I've now implemented an essid preference list - and it seems to work
However, I've only got the one AP here, so I can't test it fully
Debugging this was a right PITA - as iwgetid doesn't work properly with the madwifi driver build I'm using :/

How about posting the script output? And does the iwconfig output match the required AP?

There's two sleeps in the script. A 2 second pause after the interface is brought up for scanning (you don't see this if you set the essid directly on the interface) and 20 half second sleeps whilst it associates with an AP.

If you don't get any errors with the script, then it should be setup OK for the specified configuration.

However, there is a bug with the generic gentoo script that handles dhcp loading and unloading. Sometimes is doesn't load dhcp so it has to be started manually.

If it looks OK but it's not talking then the chances are that the WEP key is not configured correctly.

Looks like the driver is loaded ok but the card won't talk to the AP. It works fine under XP.

Any help is appreciated.

This shows that you're not getting anything that the driver can understand. The link quality is 0 - which means you'll get nothing
Invalid misc:35 - means that it is getting something but the driver is not sure what.

The interface is up, it has the IP it should. Route has the routes it should in it.

Trying to ping anywhere gives: Destination Host Unreachable

Some notes:

Line 162: iwconfig $IFACE up - my wireless (intel pro/2100) doesn't need to be up to scan for APs.

General: there were almost no pauses with the script configuring things. I had a script I used to do this by-hand that worked. It takes about 10-15 seconds with the sleeps I have in it to work, but it brings up things correctly every time.

Line unsure: I edited the ath0 to wlan0 in the script... was one rogue one left.

I tried taking the interface down (ifconfig wlan0 down;rmmod ndiswrapper), then running my script. Interface came up without a hitch. I was going to try yours again but this time when it came up it decided it didn't like scanning (ndis does that on me after it's been loaded once).

Tried yours again. It scanned successfully this time again, but connected to the wrong AP! APs found in order: decpepid13, jbooth, linksys, Apt, #103. It chose decrepid13 when it's order is jbooth then UIUCNet.

If you are using the madwifi drivers and having problems with the card being recognized or giving unexpected errors, you need to download the CVS. They have been constantly working on these drivers since the August release and they are much improved. So give that a try first._________________Meh.

Tried yours again. It scanned successfully this time again, but connected to the wrong AP! APs found in order: decpepid13, jbooth, linksys, Apt, #103. It chose decrepid13 when it's order is jbooth then UIUCNet.

I have resolved this problem
However, my server is currently down so I'm unable to post the fixed script.

Line 162: iwconfig $IFACE up - my wireless (intel pro/2100) doesn't need to be up to scan for APs.

That was always in from faye's origonal script. I'll try taking it out on my machine and making sure it still works before removing it.

Quote:

General: there were almost no pauses with the script configuring things. I had a script I used to do this by-hand that worked. It takes about 10-15 seconds with the sleeps I have in it to work, but it brings up things correctly every time.

Could you tell me where you have your sleeps? If sleeping is required then I will put some customisable defaults in!
I've made the sleep before scan customisable as well.

Quote:

Line unsure: I edited the ath0 to wlan0 in the script... was one rogue one left.

I'll try to find where pauses are needed, but I'm at work at the moment which may make things more difficult. ;) We have wifi, but I won't be able to verify picking the right AP as there's only one in range.

I've been thinking some more about this and I'm not sure that a rc-script in etc is the right solution. It's better than where we were, for sure, but what you'd really like would be a daemon process that would keep scanning wifi networks if you lost the old one.

Like if you did suspend-to-disk, you'd want it to re-scan on boot, and I don't think it will with how things are done right now. Of course right now suspend-to-disk with wireless up (ndiswrapper) is better know as write-to-disk-so-you-can-crash-after-restore-on-network-use but hey.

Other script issues:

I don't think I want to set iface_wlan0 if I've got multiple networks I may swap between (one dhcp, one static ip). But if I don't set it, the script gets very unhappy due to checkconfig(). I can set it to dhcp and that works fine at work where we use dhcp, but I'm not sure that'll work at home. Setting it to dhcp is great at work, we'll see if that holds at home.

For what it's worth tho, the script works great at work! :-) *thumbs up!*

I've been thinking some more about this and I'm not sure that a rc-script in etc is the right solution. It's better than where we were, for sure, but what you'd really like would be a daemon process that would keep scanning wifi networks if you lost the old one.

Like if you did suspend-to-disk, you'd want it to re-scan on boot, and I don't think it will with how things are done right now. Of course right now suspend-to-disk with wireless up (ndiswrapper) is better know as write-to-disk-so-you-can-crash-after-restore-on-network-use but hey.

There are a few solutions for wired ethernet for this. I use ifplugd on my lappy which works great! Unplug cable and "net.eth0 stop" gets called. Plug it back in again and "net.eth0 start" gets called.

An rc-script is the correct solution for configuring wireless and networking. We just need a daemon for working out if a connection has been dropped to the AP and restarting the apprioprate net.xxx script.

Quote:

Other script issues:

I don't think I want to set iface_wlan0 if I've got multiple networks I may swap between (one dhcp, one static ip). But if I don't set it, the script gets very unhappy due to checkconfig(). I can set it to dhcp and that works fine at work where we use dhcp, but I'm not sure that'll work at home. Setting it to dhcp is great at work, we'll see if that holds at home.

The new script - the one you have caters for this.
You can set wireless_iface_Home="dhcp" and wireless_iface_Work="192.168.0.1 broadcast 0.0.0.255 netmask 255.255.255.0" and it will flip between the two quite happily.
You don't even need to set iface_wlan0 if it can detect the correct SSID

I've even implemented basic roaming when the driver doesn't support scanning. Just set wireless_essid_ath0="any" and off it trots!

Quote:

For what it's worth tho, the script works great at work! *thumbs up!*

Glad you like it
Hopefully the next version I post will work even better