You are not logged in.

#1 2007-06-02 08:24:14

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

[networking] announcing autowifi

I already announced this on arch-dev-public yesterday, but I think there may be some interested users here that don't read there. Here is a copy of the original post:

arch-dev-public wrote:

With my new laptop and working wireless, I am now able to announce the "autowifi" scripts I wrote a few weeks ago.

Requirements:
- wpa_supplicant
- wifi driver that is supported by wpa_supplicant
- dhclient

Features:
- Automatically select the best network (done by wpa_supplicant) and configure it according to configuration files (done by autowifi)
- wifi configuration via wpa_supplicant.conf
- dhcp,static or "custom" network configuration via /etc/autowifi/networks/
- default configuration for unknown networks (if a network is not configured, the default behaviour is using dhcp)
- same configuration for networks whose essid matches a regex
- once configured, it works completely without user interaction, but it _can_ be controlled by wpa_gui (or any other wpa_supplicant client), so that you can access networks without changing wpa_supplicant.conf.

I am still unsure whether and how this can be integrated into James' netcfg, that's a question that I'd rather let him answer.

That said, autowifi is VERY simple. It doesn't reinvent the wheel by using wpa_supplicant for selecting networks - parsing iwlist outputs doesn't work very well, does it? As all wifi drivers will be moved to mac80211 in the near future, wpa_supplicant-support will not be a restriction anymore.

I tested it on iwl3945 and rt2x00-git. The latter has problems scanning and shows very few networks, therefore didn't work very well. I couldn't test it with iwl3945 in an environment with many wireless networks yet, but I trust it works better.

HOWTO:
- Install the package from http://www.archlinux.org/~thomas/autowifi-svn/ or from svn at http://projects.archlinux.org/svn/autowifi/
- Create /etc/wpa_supplicant.conf and configure all your networks (you can configure anything here, open, WEP, WPA-PSK, WPA-EAP and so on).
- Read /etc/autowifi/regex and map ESSIDs to profile names if necessary.
- Read /etc/autowifi/networks/example and configure /etc/autowifi/networks/default and /etc/autowifi/networks/profilename if necessary. If you only use dhcp on all networks, no configuration is necessary here.
- Adjust the interface and config file name in /etc/conf.d/autowifi properly.
- /etc/rc.d/autowifi start (can of course be done via rc.conf)

Possible bugs: In my first test, dhcp wouldn't work when I changed networks, maybe I need to delete the dhclient lease file.

Any feedback is welcome
Thomas

Last edited by brain0 (2007-06-02 08:25:21)

Offline

#2 2007-06-02 09:21:23

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: [networking] announcing autowifi

How does this sit with the work that James has been doing on revamping the network scripts?

Offline

#3 2007-06-02 10:11:41

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [networking] announcing autowifi

Right now it works standalone. Right now it's a proof-of-concept implementation, but still very useful already. James and me are discussing the integration possibilities into netcfg on arch-dev-public, see the link at the top of my first posting. If you want to comment on that discussion, just email one of us and we'll forward it to the list.

Offline

#4 2007-06-27 19:44:10

remur
Member
Registered: 2007-01-10
Posts: 15

Re: [networking] announcing autowifi

Anything new on this one ?
The documentation is still pretty uhm, limited, any chance to get this into an [extra] package and some useful documentation into the wiki ?

Because I think this would make archlinux one of the top distros for wlans, none of the popular distros connect to the most senseful network at startup with that many options (static routing, many wpa possibilities etc)

Offline

#5 2007-06-27 21:15:15

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: [networking] announcing autowifi

Does this script support wep and unencrypted networks?


Use the Source, Luke!

Offline

#6 2007-06-27 21:29:35

pecan
Member
Registered: 2007-04-06
Posts: 93

Re: [networking] announcing autowifi

So your saying with this script if I had arch installed on my laptop it would automatically connect to any open networks like my university?

Offline

#7 2007-06-28 08:01:22

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: [networking] announcing autowifi

I myself wrote a similar script using wpa_sup and ifplugd, because I always found flakey to reinvent the wheel and scan in scripts, then fire wpa_sup (and use some tricks to synchronously wait for it, and so on) then ifconfig|dhcp, when wpa_sup+ifplugd just wonderfully does that asynchronously. unfortunately, I seem to have lost it, since I now use networkmanager.

roberth: I think yes, since it supports anything wpa_supplicant supports.

brain0,

Possible bugs: In my first test, dhcp wouldn't work when I changed networks, maybe I need to delete the dhclient lease file.

just send a SIG to dhclient (dunno which one, see man page), and it will get a new lease. I had this problem in my script, and this is how I solved it.


To know recursion, you must first know recursion.

Offline

#8 2007-08-22 13:52:34

lnzju
Member
Registered: 2006-02-20
Posts: 30

Re: [networking] announcing autowifi

I'm using it now, but I don't know how to modify my /etc/wpa_supplicant.conf

[nicholas@LNZJU ~]$ iwlist wlan0 scanning|more
wlan0     Scan completed :
          Cell 01 - Address: 00:15:E9:84:39:C2
                    ESSID:"baidu-PTM2"
                    Protocol:IEEE 802.11g
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality:25/100  Signal level:-80 dBm  Noise level:-96 dBm
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
                              48 Mb/s; 54 Mb/s
                    Extra:bcn_int=100
                    Extra:atim=0

I have a key with 26 hex numbers。


I come from the past to save the future....

Offline

#9 2007-08-28 19:51:24

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [networking] announcing autowifi

It works (WPA at school and WEP at home)!  Pretty cool!
...had to learn the whole wpa_supplicant thing but I think I'm OK now wink
I noticed that the scripts are a bit finicky when it comes to the placement of autowifi in the daemon array in rc.conf - it seems to work best when placed as close to the beginning as possible (right now I have it just after syslong-ng and network) - when I had it just before slim it didn't return any visible error messages but I had to restart the daemon by hand before it actually connected to the wireless. 
Thanks brain0!

Offline

#10 2007-09-05 18:20:35

Pilo
Member
Registered: 2007-08-11
Posts: 5

Re: [networking] announcing autowifi

I have been looking around for this functionality for a while and this is PERFECT.

Honestly I could not be happier, I have it set up for my WPA network at home, my WPA network at school, and it even works brilliantly with another network at school that requires you to jump through all sorts of hoops (connect to an open network and then start a vpn client to get connected, autowifi even starts the vpn client automatically by using autowifi_connect() function for this network)

All in all I just want to say thanks for your work it makes my wireless network hopping seamless.

Offline

#11 2007-09-26 17:56:52

tardo
Member
Registered: 2006-07-15
Posts: 526

Re: [networking] announcing autowifi

Hmm, I can't seem to get to this work on my school network (WEP, hidden SSID). It just won't associate, or it associates but can't get a dhcp lease. I'm using iwl3945.

network={
        ssid="schoolessid"
        key_mgmt=NONE
        scan_ssid=1
        wep_key0=SOMEHEXKEY
        wep_tx_keyidx=0
}

any idea what i'm doing wrong? is this a problem with autowifi or with the iwl drivers itself?

edit: for the record, command line using iwconfig works fine.

Last edited by tardo (2007-09-26 18:12:41)

Offline

Board footer

Powered by FluxBB