Fully Hacked WRT54G

I apologize in advance for the poor quality of the pictures. The camera claims to have a macro mode, but in reality, I don’t think it does anything other than return the lens to the widest of angles.

Do not try this at home! I voided the a warranty on a brand new WRT54G to do these hacks. You should not try these things unless you are prepared to wind up with a broken router. If you try to copy anything I’ve done here, and the end result is even the slightest bit undesirable, it is not my fault. You have been warned.

Standard Disclaimer

THE INFORMATION IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE INFORMATION ON THIS PAGE OR THE USE OR OTHER RELATED PAGES AND LINKS.

Tech support

Sadly, I am not tech support. I know I’ll get emails about this asking for advice and stuff. I do try to answer all emails I get, but I do get lots from all my various projects on allaboutjake.com and wryspy.com However, please don’t be offended if I fail to reply or opt to not reply to a ‘tech support’ type question. If you need support, I recommend the LinksysInfo forum.

If you wish to converse intelligently about new potential hacks or improvements on these, then by all means, I am willing to listen.

Prerequisites

You’ll want a better firmware than the ones provided by Linksys. There are many options, but I recommend and use DD-WRT. DD-WRT has built in support for mounting MMC cards, and works great with this hack.

Note also that there are many versions of this router. Mine is a v3 router. The GPIO locations change for each hardware revision. Be sure to check your hardware revision.

I recommend checking out the Wikipedia page to find out what version you have. If your router is version 7.0, then you’re out of luck for running DD-WRT (or any other firmware non-OEM, at the current time). However, if you have v5 or v6, you can get rid of the VxWorks firmware and run a special version of DD-WRT.

I do not have any information on GPIO locations for SD card compatibility with routers other than the v3 one I own.

Downloads & Links

Some useful links and downloads related to this page

  • SD Card stuff for EaglePCB – including a “good enough” part libary and a schematic and board for a breakout board. This is for the SD slots sold by SparkFun (see below)
  • Futurlec – bought some parts from them for the serial port hack.
  • SparkFun – bought the SD slot from them. They also sell unassebled and assembled breakout board kits.
  • One port hack – includes links to parts on Futurlec’s website for the one-port hack… useful for the two part hack as well.
  • Dual port hack – again, instructions for the two-port hack like the one done here.
  • The SD Card Hack – The original authors of the SD card hack.
  • The GPIO utility by (I think) mbm. Great for finding/testing GPIO solder points.
  • Floppy cable SD Socket hack – if you want to go the cheaper route.

Possible future improvements

I am planning a latch board with tristate outputs for the amber LED so that when the SD card is in use (chip select is low) then the LED latches in the previous state. The idea is that you’d be able to still control the amber LED when the SD card is not in use. I haven’t thought this through fully yet.

Photos and notes

2nd Generation Serial Port Hack Here you see my 2nd generation serial port hack. The original plans can be found here. The one port hack site has links to Futurlec, which is where I bought some of the parts.
2nd Generation Serial Port Hack (different angle)

Generation 2 was fully surface mount, with no holes drilled in the PCB. If you have the skill, I recommend it highly, as it saves lots of time. I opted to use a MAX232A, and some standard ceramic capacitors. They weren’t really surface mount parts, but I improvised fairly successfully. Again, the same “apply solder two pads”, “position part”, and “touch pin with soldiering iron” method was fairly successful for me.
2nd Generation Serial Port Hack PCB
This is a image of my 232 board (2nd generation). You’ll noticed I used the through-hole part for the max232, but when I soldered it, I just bent the pins of the IC under and soldered it surface mount. Those other SMT pads you see are for the capacitors, and the small ones on the lower right are for the ribbon cable.
2nd Generation Serial Port Hack (different angle 2) Another view of the serial port hack. Testing the ports is easy. /dev/tty/0 is the console port. Hook it to a computer running a serial terminal, and with the right port settings you should get a console. /dev/tty/1 is the second port. In this design (and the original dual port hack page mentioned earlier) it is a DB-9 male “host type” port. So, I used a null modem cable to test it. I ran “cat /dev/tts/1 > /dev/tts/1” on the console, which sets up a nice little loopback. Hook up your serial console and set it to 9800,N,8,1 (different from the console’s baud rate). Type a few characters and press enter and ‘cat’ will send them right back to the port. I got an echo after pressing enter, so I consider it working.
2nd Generation Serial Port Hack (different angle 3) The serial port board is attached to the WRT54G’s main board by velcro. This is nice because the you need to take it off in order to remove the lid completely.
SD Card PCB and Slot SD Card PCB

The parts for my SD card hack. Purchased the SD slot from SparkFun for about $4.00. They also sell a PCB for them as well, for $10 ($20 fully assembled). I opted to print my own PCB, which is shown here. I left the PCB Etch Resist on the text to keep it black. You can see my board layout here also. I’ve since modified the design to include the chassis ground in the GND pins. For the purposes of this hack, we’re not using the WP switch, so it doesn’t really matter.
Assembled SD Card Slot Fully assembled SD slot. Basic method was as follows: added a tiny bit of solder to each pad and removed the excess with solder braid. Then positioned the socket. Touched each pad with the iron to seat it will in the solder. The write protect switch was especially tricky, but doable with a fine tip and a steady hand. Pin 9 is also takes some care.
SD Card Slot Assembled, with Card Finished SD slot with card inserted.
GPIO5 on a v3 Router This is supposed to show the location of GPIO5 on a v3 router. Thanks to the camera, its not so descriptive.
GPIO5 is possibly at the point marked RA10? Only slightly better. I believe the pad is marked “RA10” but don’t hold me to that. I found the pin through trial and error. The GPIO utility from OpenWRT (by mbm if I am not mistaken) was very helpful. This in combination with a small sh script was enough to output a square wave on GPIO 5. Then some probing with my o-scope eventually found the right spot. Since you’re not trying this yourself, I don’t have to suggest that you double check the solder point yourself with a volt meter or scope. (You better double check your solder points with a volt meter or scope)
v3 LEDs, GPIO 2-4 v3 hardware has two LEDs and a button on the front. The LEDs are GPIO 2 and 3. The button is GPIO 4. You’ll need GPIOs 3 & 4 for the SD hack. I soldered to the right side (when looking at the front of the router) of the amber LED for my tap for GPIO 3.
GPIO4 from the bottom On the back, I soldered to the inner pin of the button to get my tap for GPIO 4. Don’t make a mistake and solder to the standoffs, as they’re probably only grounded.
Plastic SD Card Reader Mount This shows a small piece of mystery plastic (probably polycabonate or plexi) that I milled to hold my card reader. Also you see the serial port hack again.
Plastic SD Card Reader Mount The mounting bracket is 90-minute epoxied to the top. A slot was cut with the dremel to expose the card to the outside.
Assembled and mounted card reader

This is a shot of the assembled card reader. two screws tapped into the mounting bracket hold the SD card reader in place.

Assembled and mounted card reader 2 Another shot of the same.
Assembled router with card inserted The fully assembled router with a card inserted.
LEDs lit while using SD Card You’ll notice that the amber LED is on when the MMC card is enabled. This is because GPIO3 is used, which also lights the LED. Disabling the MMC card does not extinguish the light either. You’ll need to use the gpio tool to do that. Here is an updated table based on the one at the the original SD card page:
Pin Direction v2.2 Name v3.0 name SD Card Name
GPIO 0 (Output) WLAN LED unknown n/a
GPIO 1 Output POWER LED POWER LED n/a
GPIO 2 Output ADM_EECS WHITE LED n/a
GPIO 3 Output ADM_EESK AMBER LED CLK
GPIO 4 Input ADM_EEDO FRONT BUTTON DO
GPIO 5 Output ADM_EEDI unknown? robo_reset? DI
GPIO 6 Input Reset button reset? n/a
GPIO 7 Output DMZ LED DMZ LED CS

Other Cool Stuff To Do with Your WRT54G

You might want to setup an SSH server or if you don’t have a really good use for the ttys1, you could use it for a temperature sensor. (Actually, looks like this could be used for just about any 1-wire device, not just a temperature sensor). I’ve also seen people add cooling fans, these things get hot I guess (considering the temperature sensor hack as well.) I don’t overclock mine too much so that it doesn’t overheat.