OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Multiple Wireless Ap's, Configuring more than one access point
Shdwdrgn
post Oct 14 2005, 01:38 PM
Post #1





Group: Members
Posts: 92
Joined: 10-December 03
Member No.: 1,143



Is it possible under GPE 3.5.3 to configure more than one access point? Ideally I would like to enter the specific ssid's and WEP keys for my home and work AP's, plus allow conectivity to any open AP's which are broadcasting themselves.

Wireless.opts would conect to the first block that matched the discovered AP, but I haven't found a similar method of doing this under GPE. I see that wireless.opts is still present in GPE, so if there is no method for multiple conections already present, can someone tell me if the code to use wireless.opts is at least complete and functional?
Go to the top of the page
 
+Quote Post
Shdwdrgn
post Oct 18 2005, 01:55 PM
Post #2





Group: Members
Posts: 92
Joined: 10-December 03
Member No.: 1,143



I wanted to update this with my results in case anyone else wants to do something similar. This is not complete yet, but it is somewhat functional with known AP's. I currently have to reboot when I change AP's because iwconfig is not automatically releasing the previously-found connection, but I hope to fix that in time. Also be aware that you will of course not be able to use the GUI to configure your wireless network connection after making these changes.

OK on to the good stuff. The first file to modify is /etc/network/interface. You will need to comment out or remove the section that defines wlan0. Replace it with code similar to this:
CODE
mapping wlan0
       script /etc/network/findwifi.sh
       map home,*,*,00:11:22:33:44:55      home
       map work,*,*,AA:BB:CC:DD:EE:FF work
       map any,*,*,*                           any

iface home inet dhcp
       wireless_mode managed
       wireless_essid home_ssid
       wireless_key off
       wireless_channel 11
iface work inet dhcp
       wireless_mode managed
       wireless_essid work
       wireless_key open key 0000-0000-0000-0000-0000-0000-00 [1] key [1]
       wireless_channel 6
iface any inet dhcp
       wireless_essid any
       wireless_mode managed

Note that on the 'map' lines you will want to put in the MAC address of your AP's. You can find this from the command line with iwconfig. If you do not have a connection to your AP, type in "iwconfig wlan0 essid your_ssid_here". Once you have a current connection to your AP, type "iwconfig wlan0", and look for the line with the text "Access Point:". The text after this is your MAC address.

The next step is to create the script findwifi.sh. This should be placed in /etc/network/.
CODE
#!/bin/sh

iface="$1"
ifconfig $iface up

cat /etc/network/interfaces | grep "map " | while read x INFO NAME
do

SSID=`echo $INFO | cut -d, -f1`
if [ "$SSID" = "*" ]; then SSID=any; fi
MAC=`echo $INFO | cut -d, -f4`

iwconfig $iface essid $SSID 2>/dev/null
sleep 1
NEWMAC=`iwconfig wlan0 2>/dev/null | grep "Access Point" | sed -n -e 's/.*Point: /\1/p'`
if [ $NEWMAC = $MAC ]; then
       echo $NAME
       exit 0
fi

done

Remember to chmod 755 then file after you create it. This script tries out each SSID identified in the interfaces file, in order, and returns the name of the first match. If you want to manually run this file, include the interface name on the command line like such: ./findwifi.sh wlan0

I still need to get the script to drop the old ssid so it can cleanly search for a new AP whenever you insert your wifi card. Also I want to use "iwfind wlan0 scanning" to attempt to locate an open wifi if one of the primary defined AP's are not detected. And finally, I would like to find a way to re-run this script any time the connection is lost so that wireless connectivity can be seamlessly maintained when roaming. (If anyone has suggestions on detecting when wifi is lost, let me know?)
Go to the top of the page
 
+Quote Post
Shdwdrgn
post Oct 19 2005, 08:37 PM
Post #3





Group: Members
Posts: 92
Joined: 10-December 03
Member No.: 1,143



Looks like I found my problem with not dropping the old SSID when roaming. I had been making some changes in /etc/pcmcia/network and added code to support udhcpc. So udhcpc ended up getting called a second time, and when I removed the wifi card, that second instance was locking out changes in wlan0. Seems to be working fine for me now, so on an unmodified install there should be no problems.

Note it does not rescan when the wifi signal is lost, but the script above will correctly search for configured AP's every time the wireless card is inserted, without having to reboot.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 9th July 2014 - 10:14 PM