|
|
|
|
|
|
Home PageContact MeMAC OS XLinuxLinux Servers Fedora Core 4Linux Servers - CentOSLinux Servers Fedora Core 5Linux Servers Fedora Core 7Linux Servers Fedora 8OpenWRTNSLU2LinuxClusterHardware Hacking ProjectsSpeaker Building ProjectsElectronics ProjectsOther Sites |
![]() Status
IntroductionI felt it was time for the car to have wireless. A little research revealed that AT&T DSL customers could add AT&T wifi for only $1.99. There seemed to be plenty of locations to choose from. With a solid excuse I'm off to building. I haven't ddecied if I want to permanently mount it in the car. I may keep it as a mobile unit. There are times when I would like to use it in someone elses car or run on batteries. Here's a quick diagram of how I have everything setup.
|-------------------------------|
EXT ANT =====| WRT54G |
| (wifi configured as WAN port) |
|-------------------------------|
|
| LAN
|
|-------------------------------|
| WAP11 |====== ANT
| (configured as access point |
|-------------------------------|
Linkssy WAP11There is nothing special about the WAP11. The WAP11 is configred as an AP for the clients in and around the car. Linksys WRT54GThe WRT54G has OpenWRT installed on it. The big change is that the wifi gets set to client mode. The wifi port then is configured to replace the WAN port. The LAN with its firewall and NAT remain unchanged. The WAP11 plugs into one of the lan ports. Software SetupWRT54GI'm not going to cover installing OpenWRT. Please visit http://www.openwrt.org. Once you have OpenWRT installed continue on. Next there are some packages to install. If you have other packages to install this would be a good time to do it. Now we want to set the wireless for client mode. I based my config on this howto http://wiki.openwrt.org/ClientModeHowto?highlight=%28HowTo%29. The mode I chose was routed client mode. Please read the howto for more in depth info. Type the following commands to set everything up. Next there are some scripts and web pages to create. This will make it easy to look for and join wireles networks. Most of the scripts are not formatted. There isn't a lot of memory in the WRT54G. Extra spaces to make it look pretty just eats up memory. Rename the web interface page. Now a new index.html page needs to be created. Enter the following for /www/index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11$ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> <center> <h2>Magoo-Car Hotspot</h2> <br> <a href="/cgi-bin/wireless.cgi">WIFI SCANNER</a> <br> <a href="/webif.html">Web Interface</a> </center> </body> </html> Paste the following into /www/cgi-bin/wireless.cgi #!/bin/sh cat <<EOF Content-type: text/html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> <center> <h2>Magoo-Car Hotspot</h2> EOF echo -n "<p>Date: "; date echo "</p>" echo "<h3>Current Connection</h3>" echo "<pre>" wl status echo "</pre>" echo "<table border='1'>" iwlist eth1 scanning | microperl /sbin/wmonitor.pl cat <<EOF </table> </center> </body> </html> EOF Paste the follwoing into /www/cgi-bin/joinwifi.cgi
#!/bin/sh
cat <<EOF
Content-type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<center>
<h2>Magoo-Car Hotspot</h2>
<pre>
EOF
echo -n "Date: "; date
echo "Connecting to network"
echo "QUERY_STRING: $QUERY_STRING"
eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}')
myid=`httpd -d $id`
echo "ESSID=$myid"
mych=`httpd -d $ch`
echo "CHANNEL=$mych"
echo
ifdown wan
nvram set wl0_ssid=$myid
nvram set wl0_channel=$mych
ifup wan
/sbin/wifi
cat <<EOF
</pre>
</center>
</body>
</html>
EOF
These files need to be made executable. The following script was based on a script I found on the openwrt website. Paste the following into /sbin/wmonitor.pl
open(INP,'-') or die "Couldn't read from STD input!\n";
my $line="";
my $essid="";
my $channel="";
my $signal="";
my $noise="";
my $snr="";
print "<tr><td><b>Channel</b></td><td><b>Signal</b></td><td><b>Noise</b></td>";
print "<td><b>SNR</b></td><td><b>TYPE</b></td><td><b>ESSID</b></td></tr>\n";
while ($line=<INP>) {
if ($line=~m/ESSID:"(.*)"/) {
$essid=$1;
} elsif ($line=~m/Channel:(\d+)/) {
$channel=$1;
} elsif ($line=~m/Quality.*Signal level:-(\d+) .*Noise level:-(\d+)/) {
$signal=$1;
$noise=$2;
$snr=$2-$1;
$chkap="-";
if ($essid eq "attwifi") {
$chkap="*";
}
print "<tr><td>$channel</td><td>-$signal</td>";
print "<td>-$noise</td><td>-$snr</td><td>$chkap</td>";
print "<td><a href=\"/cgi-bin/joinwifi.cgi?id=$essid&ch=$channel\">$essid</a></td></tr>\n";
}
}
WAP11Well the WAP11 is pretty easy. Just configure the AP the way you like. If there is another AP you want to use then use it. Hardware SetupI wanted a package that could easily worked with. The WRT54G, WAP11, and mounting plate are secured with each other. Feeding The Devices The Power They NeedThe car will have a max voltage of 13.8 volts. The WRT54G can use this voltage without any issues. On the other hand the WAP requires 5 volts to run. I chose to use a LM7805. You can buy a DC to DC converter if you wish. The 7805 regulator will dissipate around 5 watts. A heatsink is required I cut the ends off the power adaptors. 6 inches of wire is good. I used a small project box for the regulator, wiring, and power indicator. ConclusionThis has been a usefull project. This setup has many more uses. Experiment and have fun. Comments |