This page contains information about my work on the Linksys WRT54G, WRT54GS, and ASUS Wl-500g routers. This includes various software and scripts written to work with the OpenWRT linux distribution for the series, as well as hardware mods and other information.
Here are compiled versions of the ppdev.o module and lpif binary, available for download and use with the experimental version of OpenWRT and an ASUS WL-500g.
The autoinet script scans for access points and begins connecting to each one found, looking for one with internet access. If the access point has internet access, it stays connected, and you are able to connect through it using NAT. Tested only on the Linksys WRT54G/WRT54GS.
wrt-autoinet.sh (v0.1)
Copy the script to your device into the directory /usr/sbin and make it executable by running the following command:
chmod +x /usr/sbin/wrt-autoinet.sh
If you would like the device to be dedicated to running this script, you can have it run at boot by running the following commands:
rm /etc/init.d/S99done cp /rom/etc/init.d/S99done /etc/init.d/S99done echo "/usr/sbin/wrt-autoinet.sh" >> /etc/init.d/S99done
If you are not using a standard OpenWRT installation, you may have to modify some of the executable configuration variables found at the beginning of the script. Simply check the configuration variables and run the script. When an internet connection is available, the DMZ LED will light.
If the network blocks ping replies, the script will not detect that the WRT has internet access and will continue to cycle through the available access points. The issue does not seem to be resolvable with any of the utilities that come with OpenWRT, as the BusyBox utilities that can be used to test for other types of connectivity (eg. wget) do not have reasonable timeouts.
From: Mark Goldberg <WRT AT 99e99 DOT com> To: sephail@sephail.net Subject: WRT autoscanner <snip> I'm trying to get your autoscanner running and I have a curious problem that I can't seem to figure out. I actually had it running properly first shot on a WRT that was all kinds of messy configed from hacking away at trying to do a bunch of other stuff - I half expected it not to work because there were several non-standard settings in the nvram. Well it did work with no mods. Then (stupid me) I decided to clean the wrt up to prevent future problems from the mess that I had left behind. I am starting with a fresh setup - (ftfp a fresh openwrt WR RC3 ; failsafe boot and "firstboot" to recreate partitions, erased NVRAM and started fresh.) And now the script and router hangs when bringing back up eth1 during the script initialization. At that point the router stops functioning. I can bring eth1 down and up again manually without a problem. I also trued increasing the sleep time to no avail. I can do anything else with the router, like run kismet, manually do WL stuff - I'm even sending this email through the router since I've reached my rj-45 swap-out threshold for the day ;) <snip> Seems that the firewall startup script has to be removed. Makes sense...not quite sure why that causes the script to hang when bringing eth1 back up, but it does. Also I found that I had to make the following nvram settings to get the thing to work - doesn't work right out of the box - (without these changes the router couldn't get past your ping test to discover Internet - I'm guessing it is the wl0_mode=sta and/or wifi_proto=dhcp that was key - but that is just a guess without taking the time to go back and look at your script (or the stock nvram settings)to see if it does it....you know when you get to this point sometimes you stop asking questions and just become releved to move on!) lan_ifname=vlan0 wifi_ifname=eth1 wl0_mode=sta wifi_proto=dhcp You may want to stick the instruction to delete the firewall and make the appropriate nvram setting on your page to save some other unfortunate bonehead the head-bangin'! Thanks so much for the script. It really is a hell of a good, clean script. -Mark
An RS-232 <-> TTL level shifter is necessary to practically debug various hardware, such as the WRT54G. Below is a picture of the converter I made out of a project box, binding posts, DB9 female connector, PCB, capacitors, and wire available from RadioShack, as well as a MAX232 IC available from DigiKey. The MAX232 data sheet will give you specs on how to use the IC.
Below is the pinout for JP1 on the WRT54G(S) boards:
| Pin | Designation | Pin | Designation |
|---|---|---|---|
| 1 | Vcc (+3.3V) | 2 | Vcc (+3.3V) |
| 3 | TX (COM2) | 4 | TX (COM1) |
| 5 | RX (COM2) | 6 | RX (COM1) |
| 9 | Vss (0v) | 10 | Vss (0v) |
Last update: 2005-12-10