How do I configure wpa_supplicant to try all hidden SSIDs in quick succession?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I configure wpa_supplicant to try all hidden SSIDs in quick succession?
I have wpa_supplicant working fine in a number of locations, each of which uses (amongst other things) hidden SSIDs.
When wpa_supplicant.conf has just the one network={..} definition for a location, or if that definition is the first one in the .conf file, then association and dhcp allocation works really well and quickly.
But if the wrong network definition is used (say, I forgot to change the .conf file when I moved to another location), the network connection will time out before wpa_supplicant has tried the correct definition.
I know each of the locations has good APs, as association is normally very quick.
I have to use ap_scan=2 to get wpa_supplicant to probe for the location AP. How do I get wpa_supplicant to just try for (say) less than 5 seconds, before trying the next network definition in wpa_supplicant.conf.
This is on Slackware 11.0, using a 2.6 kernel, and an IPW2200 wireless driver (all of which seem to work fine).
Skimming through the manuals for wpa_supplicant, wpa_supplicant.conf and wpa_cli I don't immediately see a way of actually doing it 'within' wpa_supplicant. In this case I'd just write a script that generates the appropiate settings for the next network in wpa_supplicant.conf and restarts wpa_supplicant until it's connected.
But if the wrong network definition is used (say, I forgot to change the .conf file when I moved to another location), the network connection will time out before wpa_supplicant has tried the correct definition.
Why would you have to change .conf files? You can list multiple networks in the same .conf file without a problem. You can also prioritize them a bit by using a priority line in each network section. Here is an example:
Hangdo42: <nods> Yes, I've tried using the "priority=.." setting. The problem is that because at least two of the networks use hidden SSIDs, I can't get the driver to scan for possible networks (using the ap_scan=0 global option). I have to use ap_scan=2. The sample configuration file has a comment which says:
"Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not
using this priority to select the order for scanning. Instead, they try the
networks in the order that used in the configuration file."
And indeed, that is exactly what does happen.
So, if I'm working in the 'second' network location, wpa_supplicant tries the 'first' location first, but dhcp time-out occurs before wpa_supplicant tries the next ('second') location. That's why I was wondering if there is any way to get wpa_supplicant to move to the next network more quickly.
marsm: Yes, that's the same conclusion I reached for now. That, and perhaps see if I can find anything in the code itself.
So, if I'm working in the 'second' network location, wpa_supplicant tries the 'first' location first, but dhcp time-out occurs before wpa_supplicant tries the next ('second') location. That's why I was wondering if there is any way to get wpa_supplicant to move to the next network more quickly.
An alternative way of looking at the problem would be to get dhcpcd to run later in the process, after the configuration has happened. You could either put some insane amount of time delay between when wpa_supplicant is started and when dhcpcd is started or your could just run dhcpcd manually so you know that the wireless card is configured properly before an IP address is requested.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.