You are not logged in.

#1 2005-08-28 03:57:02

oggb4mp3
Member
Registered: 2005-06-17
Posts: 77

Wireless Situation - clear info needed

I know there are several people working on a wireless setup for Arch, and I don't mean this to be in any way a criticism of the work being done on it to date, but I am very frustrated.

I have spent the evening researching how to get my wireless interface up and running, and have hacked a solution that got it working but just won't do for ongoing use, but it does work.  My problem is this: there is tons of info on the wiki and in the forums that is a half-started attempt at some kind of scripting system, and much of it is no longer valid.  Can somebody go in and clean some of this up so that stuff that doesn't work or is a half-completed early attempt doesn't confuse people.  I spent much of the night trying to decipher stuff that isn't even valid anymore.

I know the current setup is a work in progress, but does anybody have the time to spend a little time documenting rc.conf a little better so that it is more clear how to set up a wireless interface.  /etc/conf.d/wireless seems clear enough, but there is no instruction (that I could find aftrer extensive searching) on what to put in rc.conf to make it work.  I would like to make it work, but I would also like to test the system being put in place to help make it better, instead of just hacking my own solution that just works for me.  Even better, a page on the wiki to replace all the half-started ones that explains the design of the system currently being implemented, so even though it isn't done, it is clearly explained where it is going.

Can I also make a plea to anyone that posts a solution that they hack together, to please include a clear, concise instruction on how to use it.  There are several posts of scripts by users that proclaim it works for them with no instructions whatsoever on what to put in rc.conf or network-profile or conf.d, just a script with a declaration that it works.  I know how hard it to explain things that seem so self-evident, but pllease try to be a little more explicit about how you are doing things.

Before I get any newbie flames, I'll tell you that I am relatively new to Arch but I have been using Linux for over 5 years and am not a total dummy about networking and my wireless setup.  I know how to use iwconfig and ifconfig, but I'd like to understand the current state of affairs and help to test it, if I can only figure out how  :?

Offline

#2 2005-08-28 07:27:22

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

Re: Wireless Situation - clear info needed

Judd has made considerable improvements to wireless support in the official scripts.  The best ones are currently in testing.  Iphitus has made a patch that adds autodetection stuff - this is partially explained here:
http://bbs.archlinux.org/viewtopic.php? … highlight=

Otherwise all the info for using Judd's new initscripts can be found here:

http://www.archlinux.org/pipermail/arch … 04855.html

However, this is not all finished and wrapped up.  If you feel like creating a wiki page for this information then feel free.  The wireless situation is confused as you say.  Phrakture's scripts should still work fine.

Offline

#3 2005-08-28 15:57:28

oggb4mp3
Member
Registered: 2005-06-17
Posts: 77

Re: Wireless Situation - clear info needed

That second link fills in some of the missing pieces, thank you for that.  I actually didn't search the mailing list archives.  I spent most of my time in the wiki or forums.  It looks like I should join the mailing list too.

Usually I would be one of the first people to jump in and volunteer to write some documentation, and a wiki page on the definitive wireless-setup in Arch would be a good place to start, but my OSS plate is full for the next couple of weeks because of some commitments I have made to other projects.  If it isn't done by then, I'll take a crack at it.

I do realize (and am thankful) that there are some real improvements going on in this area, and when configured right, the existing soutions actually do work.  The problem is really a dearth of accurate documentation, which is actually contrary to what I have found, namely that there always seems to be a clear, concise well written document on how to deal with various issues.

Anyway, thanks for the info.  I will try to contribute in the future instead of just complaining, I just don't want to make another half-hearted attempt that also goes unfinished.

Offline

#4 2005-08-29 07:03:20

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Wireless Situation - clear info needed

dibblethewrecker wrote:

However, this is not all finished and wrapped up.  If you feel like creating a wiki page for this information then feel free.  The wireless situation is confused as you say.  Phrakture's scripts should still work fine.

For the records, I wrote those scripts so long ago it's not even funny.  I actually stopped using them a while back in favor of the official arch wireless stuff.

Offline

#5 2005-08-30 02:17:51

oggb4mp3
Member
Registered: 2005-06-17
Posts: 77

Re: Wireless Situation - clear info needed

Okay, here is the current situation:

My rc.conf has this in it:

#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   (prefix an interface in INTERFACES with a ! to disable it)
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
lo="lo 127.0.0.1"
eth0="dhcp"
INTERFACES=(lo eth0)

#
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   (prefix a route in ROUTES with a ! to disable it)
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)

#
# Network profiles
# For each profile declared, a profile directory must exist in
#   /etc/network-profiles
#
NET_PROFILES=(home)

I have a file named /etc/network-profiles/home with this in it:

INTERFACE="wifi0"
IFOPTS="dhcp"
ESSID="oggb4mp3"
MODE="Managed"

and the interface is not brought up on boot.  iwconfig works fine if I do 'iwconfig wifi0 mode managed essid oggb4mp3' and then I can dhcpcd wifi0 to get the interface running.  eth0 is being managed by ifplugd.

What am I doing wrong?

Offline

#6 2005-08-30 02:24:06

oggb4mp3
Member
Registered: 2005-06-17
Posts: 77

Re: Wireless Situation - clear info needed

BTW, I get a "failed" response during startup when the starting network profile home message is displayed during boot.

Offline

#7 2005-08-30 02:31:43

oggb4mp3
Member
Registered: 2005-06-17
Posts: 77

Re: Wireless Situation - clear info needed

Also, should I be able to specify more than one interface in the network profile.

Offline

#8 2005-08-30 03:09:22

oggb4mp3
Member
Registered: 2005-06-17
Posts: 77

Re: Wireless Situation - clear info needed

Okay, I think I have it sort of working.  The profile config on the wiki really isn't right anymore.  You don't need a directory named for the profile, you need a file named for the profile, and I used the template as part of the new initscripts, instead of the example on the wiki.

I now am setup like this: wired interface eth0 managed by ifplugd and wifi interface eth1 (it's an airo thing) managed by the profile.  The only problem is, if I plug in and unplug the wored interface, ifplugd wipes out the default route for both interfaces, not just the one it is managing.  Also, I'd like to be able to set a metirc variable (an ifconfig option) on the wired interface, so when it is active, it is always used, even if both interfaces are up.  Any idea if this can be done through rc.conf?

Offline

#9 2005-08-30 15:23:50

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Wireless Situation - clear info needed

oggb4mp3 wrote:

Also, should I be able to specify more than one interface in the network profile.

But that would overcomplicate things.  It's much easier just to copy the profile and change the interface.... so you have a "home_wired" and "home_wifi" profile.

Offline

#10 2005-08-31 23:24:25

phydeaux
Member
Registered: 2005-06-13
Posts: 68

Re: Wireless Situation - clear info needed

I'm not sure if this is the right place for this but I don't know of a better place.

I was looking at these scripts again and I like them better then phrak's scripts (mostly I like the profiles for wired networks too).  The new scripts don't seem to have any support for wpa_supplicant though.  I guess that isn't a surprise since there isn't an official package for it.  Any how I've decided to switch over to the new scripts and I wrote a little patch to put wpa support into it .  I lifted the part that detects wether wpa_supplicant was able to connect right out of phrak's script, I hope he doesn't mind, this was a quick job and I didn't want to reinvent the wheel.  Anyway the diff is against the new /usr/bin/netcfg script, the string WPAOPTS needs to be added to the profile with any extra arguments for starting wpa_supplicant.  It will use /etc/wpa_supplicant.conf for the wpa configuration.  That file is supposed to support multiple network definitions but I haven't tested that.  I've only given this a quick test at home with my wired and wireless profile and it seems to work fine for both.  I'd like to see the final version of the wireless script have some form of wpa support if some one could mention this to the higher powers I'd appreciate it.

andy

--- netcfg    2005-07-01 02:22:32.000000000 +0000
+++ /usr/bin/netcfg    2005-08-31 19:13:45.000000000 +0000
@@ -41,13 +41,16 @@
     . $STATE_DIR/$INTERFACE
 
     stat_busy "Shutting down interface: $INTERFACE"
-
+    
     # bring down the default route (gateway)
     [ "$GATEWAY" ] && route del default gw $GATEWAY
 
     # bring down the interface
     ifconfig $INTERFACE down
 
+    # shutdown wpa_supplicant, if its running
+    [ "$WPAOPTS" ] && wpa_cli terminate >/dev/null 2>&1
+    
     rm -f $STATE_DIR/$INTERFACE
 
     stat_done
@@ -93,7 +96,31 @@
         iwconfig $WIFI_INTERFACE $IWOPTS
         [ $? -ne 0 ] && stat_fail && return
     fi
-
+  
+    # Start wpa_supplicant, in necessary
+    if [ "$WPAOPTS" ]; then
+        ifconfig $WIFI_INTERFACE up
+        wpa_supplicant -wB -i $WIFI_INTERFACE -c /etc/wpa_supplicant.conf $WPAOPTS
+        # I lifted most of this next block from phracture's wireless script on 
+        # the    wiki http://wiki.archlinux.org/index.php/Wireless_Bootup_Script
+
+        #####
+        #I don´t know how we could determine if wpa_supplicant is ready...
+        sleep 2
+        let i=0
+        while ! /usr/bin/wpa_cli status | grep "wpa_state=COMPLETED" >/dev/null 2>&1; do
+            if [ $i -gt 10 ]; then
+              wpa_cli terminate >/dev/null 2>&1
+              #ifconfig $WIFI_INTERFACE down
+                stat_fail && return 
+            fi
+            sleep 2
+          let i++
+        done
+        ######
+        
+    fi                                                                                                                                                                                
+    
     if [ "$IFOPTS" = "dhcp" -o "$IFOPTS" = "DHCP" ]; then
         dhcpcd $DHCPCD_ARGS $INTERFACE
         [ $? -ne 0 ] && stat_fail && return

Offline

#11 2005-09-01 15:33:17

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Wireless Situation - clear info needed

Of course I don't mind 8)
I actually thing most of the WPA stuff can be contributed to someone else.

Please post this in the bug tracker (as a feature request) so Judd sees it.

Offline

#12 2005-09-25 19:31:14

phydeaux
Member
Registered: 2005-06-13
Posts: 68

Re: Wireless Situation - clear info needed

I found a bug in this.. I'll change the diff later I guess since I need to get another copy of the stock netcfg file to generate it..

anyhow to fix it add WPAOPTS to the list of variables that are being unset near the beginning of the start_profile function.  Its on line 89.

If you don't unset that variable there and you use the menu then the script will try to start wpa_supplicant for any interface provided its defined in atleast one profile.

Thats what I get for the quick testing job I did on it when I originally posted this.

andy

Offline

Board footer

Powered by FluxBB