Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172766 - force net.ath0 to use a certain channel
Summary: force net.ath0 to use a certain channel
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-30 09:31 UTC by Daevid Vincent
Modified: 2007-03-31 07:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daevid Vincent 2007-03-30 09:31:12 UTC
I have an atheros (mad-wifi) internal mini-pci 802.11 a/b/g card in my Dell 
i8200 notebook running Gentoo. I also have an Engenius hostap 802.11b 
card/antenna in my Gentoo server. What is frustrating, is that it's a 
crap-shoot when my ath0 will (or won't) start properly. I have no control 
over what channel (either numeric like 6, or alpha such as b vs. g) to 
connect to my AP ("MATRIX").

Please tell me there is some way to tweak my /etc/conf.d/wireless (or anything 
for that matter), so that I can tell it, "hey, when connecting to 'MATRIX', 
always use 802.11b and/or a certain channel range (presumably in the 'b' 
range)".

Furthermore, it would REALLY be great if I could do something whereby, if I 
have net.eth0 (i.e. CAT5 cable) then don't start net.ath0, else try net.ath0. 
Right now I have net.ath0 disabled by default because I hate when it starts 
up when I'm plugged in at work, as my traffic seems to go over the "slower" 
ath0 rather than the faster eth0 port. ?! I have ifplugd installed, but I 
don't think it can manage this kind of (seemingly obvious and intelligent) 
decision.

Reproducible: Sometimes

Steps to Reproduce:
/etc/init.d/net.ath0 start
Actual Results:  

locutus ~ # /etc/init.d/net.ath0 start
 * Starting ath0
 *   Configuring wireless network for ath0
 *     ath0 connected to ESSID "MATRIX" at 00:00:00:00:00:00
 *     in managed mode on channel 52 (WEP disabled)
 *   Configuration not set for ath0 - assuming DHCP
 *   Bringing up ath0
 *     dhcp
 *       Running dhcpcd ...
Error, timed out waiting for a valid DHCP server response                                                                                              
[ !! ]
locutus ~ # /etc/init.d/net.ath0 start
 * Starting ath0
 *   Configuring wireless network for ath0
 *     ath0 connected to ESSID "MATRIX" at 00:00:00:00:00:00
 *     in managed mode on channel 7 (WEP disabled)
 *   Configuration not set for ath0 - assuming DHCP
 *   Bringing up ath0
 *     dhcp
 *       Running dhcpcd ...
Error, timed out waiting for a valid DHCP server response                                                                                              
[ !! ]
locutus ~ # /etc/init.d/net.ath0 start
 * Starting ath0
 *   Configuring wireless network for ath0
 *     ath0 connected to ESSID "MATRIX" at 00:02:6F:09:B2:B4
 *     in managed mode on channel 6 (WEP disabled)
 *   Configuration not set for ath0 - assuming DHCP
 *   Bringing up ath0
 *     dhcp
 *       Running dhcpcd ...                                                                                                                            
[ ok ]
 *       ath0 received address 10.10.10.69/24
locutus ~ #

Expected Results:  
Either the 'scanner' part needs to realize that "MATRIX" is only a 'b' radio and therefore stop trying to connect on 'g', ultimately timing out and causing frustration and a russian-roulette game of trying to start ath0 over and over till one of the times it works, or let me specify this manually. Ideally the more automatic, the better.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-03-30 09:38:21 UTC
This is not a support forum, we have forums.gentoo.org and #gentoo for this. You apparently didn't have a look at /etc/conf.d/wireless example, there's an example how to set your channel there. 

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4
Comment 2 Daevid Vincent 2007-03-30 21:32:06 UTC
I didn't ask for support per se. This is a feature/bug request. I agree it was worded poorly for an official request, however I simply copied the email I sent to the Gentoo list as it seemed to be intuitive in what I was asking for.

I assume your example refers to:

# We use channel 3 if you don't specify one (adhoc mode)
channel_eth0="9"

That isn't going to work for a CLIENT. It's going to force my a/b/g card to ALWAYS use a certain channel on a given interface. That's nearly useless. So you suggest I set it to "6", and therefore ALL my connections from then on will be limited to that channel?

What I'm suggesting, is something more like:

channel_MATRIX="6"

Again, my notebook (CLIENT) is having the trouble connecting to my (hostap) Gentoo server as it seems to pick some random [abg] channel. Since the notebook is 'a/b/g' and the server is 'b' only, that's where the issue becomes. Not an uncommon setup I suspect.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-03-30 22:05:43 UTC
Once again, please stop using bugzilla as a support channel, it's not a proper place. If you client in unable to even find the AP, then how on earth do you want to set anything based on AP's ESSID?

The card will scan APs using any of a/b/g in managed mode; if it doesn't, then it's definitely not a baselayout bug. If you need to set the mode manually, see the fine manual (iwpriv ath0 mode 0/1/2/3 sets mode to auto/a/b/g respectively, see the wireless.example file on how to use this in baselayout config).
Comment 4 Daevid Vincent 2007-03-31 00:21:48 UTC
Did you even READ what I was asking for? You're so quick to dismiss me. I'm not completely stupid. I "get" what you're saying, you just happen to be wrong, and there is no _easy_ solution with the tools available to me.

Dude. The client eventually finds the AP. It is just a random crap-shoot until it does because the client is trying some random channel each time i type "net.ath0 start". Why is this so hard for you to comprehend.

Notice in my first example, I tried THREE times in rapid succession to connect to "MATRIX". notice how it used channel '52', then '7', then finally a b channel of '6'. The net.ath0 script needs to be smarter in it should cycle through channels till it finds a MAC and then go. Notice also how the MAC was all 00 until it found a useable channel.

All I know is that when I'm in WindowsXP or Mac OSX, I have no problem connecting to the AP. Those OS's "just work". In Linux, I have to dick with all these configurations, and it still doesn't work reliably.

I'll try to refrain from being as curt and rude as you have been, but this script is "broken". It may "WORKSFORME" from a GURU standpoint such as yourself, but as a general Linux/Gentoo user, it is broken. [a] I shouldn't have to be dicking with scripts to get basic things like WiFi to connect to an AP. [b] if I must compensate for your lack of polish, then at least let me fix your problems by forcing my client to choose a proper channel or a/b/g (no iwpriv cryptic incantation and indepth knowledge required. Just a simple "flag" like the ESSID or KEY is).

so "channel_MATRIX = 6" is one solution as it allows me to configure a single SSID on my client, a better one is "channel_MATRIX = b" whereby I know that MATRIX is an 802.11b WAP therefore don't waste my time scanning 52 and 7, just jump to an 802.11b channel. The ideal solution is as I've suggested above. (you can do that mapping behind the scenes to 'iwpriv' or whatever other crazy commands are needed -- I shouldn't have to be bothered)

BTW, this was put in baselayout because that's where bugzilla suggested it goes when I don't know who to assign this to.

If you don't want to add this FEATURE (that being a configuration setting to associate an a/b/g setting or channel setting PER ESSID), then leave it as open for someone else to implement. Just because something "WORKSFORYOU" does not invalidate my request.

Your last suggestion of "iwpriv ath0 mode 2" seems like a possible HACK solution, but still doesn't address that *I* shouldn't have to do this as a "dumb user". The script need to be smarter, not the user. If the script can't figure out that it got no MAC and no connection on an ESSID that it clearly discovered, then *IT* needs to figure out why and correct itself.

It's sad that some of you Linux people are so arrogant. I've used Linux since Slackware on my Amiga when it came on 14 disks -- that's pushing 15 years my friend. That doesn't mean I want to ice-skate uphill to use my OS. It needs to "just work" or it is doomed to stay as a niche OS -- and you're not helping the cause with your elitist attitude.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-03-31 07:06:56 UTC
Sigh...

You need to actually *find* the AP first; *then* you can be setting stuff based on AP's ESSID or MAC address. As you apparently have issues with scanning the APs, sorry but there's nothing this baselayout script could fix for you. If you know that you are using B or whatever that you can use iwpriv_scan_pre_ath0() to make it faster, once again read the darned example file already. 

It's a *driver* issues, not a baselayout one. Take this upstream [1] and you can rant there how dumb their driver is and how wonderful the Windows one is and how much smarter and faster it should be. 

You can force net.ath0 to use a certain channel, or restrict it to certain mode just fine, and that's what you've been requesting. Making the driver smarter is not baselayout's task, and not a Gentoo bug at all. *After* the AP is at least found, you can do your ESSID magic (provided that the driver and/or wireless-tools permits to do such stuff at that point).

Finally, there's net-misc/networkmanager for people that can't be bothered with using baselayout to manage their network connections.

[1] http://madwifi.org/wiki/TicketSubmissionGuidelines