WHR-HP-G54 and SD card mod

03 September 2008 3 minutes

I just got a Buffalo wireless router WHR-HP-G54 a few days ago. It’s small, covers a good range (has a built-in internal amplifier), has decent memory 4MB ROM/16MB RAM and it can be modded to have an sd/mmc card for storage.

First thing was to load tomato (I got tired of dd-wrt’s QoS and wanted something different). Soon later I found out what this baby really wants is openwrt. So I gave her the WhiteRussian ;) Yesterday, I bought a 1GB MicroSD card (with an SD adapter) and bring the router into operation room. I’m not going through the process for it’s been described a lot on the web (dd-wrt’s wiki and openwrt’s wiki). This page shows you how to open the router, however you won’t have to slice and poke holes through the label, just peel it off and stick it back in afterward ;)

Here’s my pin layout:

SD#      GPIO#
--------------
1 CS       7
2 DI       6
3 VSS      - ground
4 VDD      - power
5 CLK      3
6 VSS2     - ground
7 DO       5

1st try: I decided to hardwire the cables into the MicroSD-to-SD adapter but it didn’t work. Probably the problem was with the soldering. Loading the mmc module gives this error in dmesg.

[INFO] mmc_hardware_init: initializing GPIOs
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles
[INFO] mmc_card_init: powering card on. sending 80 CLK
[INFO] mmc_card_init: 80 CLK sent in 44136 CPU cycles
[INFO] mmc_card_init: resetting card (CMD0)
[FATAL] mmc_card_init: invalid response from card: ff found, waiting for 01
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles
[INFO] mmc_card_init: powering card on. sending 80 CLK
[INFO] mmc_card_init: 80 CLK sent in 43306 CPU cycles
[INFO] mmc_card_init: resetting card (CMD0)
[FATAL] mmc_card_init: invalid response from card: ff found, waiting for 01
[ERROR] mmc_init: got an error calling mmc_card_init: 01
[ERROR] mmc_check_media: change detected but was not able to initialize new card: ffffffff

2nd try: The damn thing got short circuited, it won’t even power on! The problem was again from bad soldering on the MicroSD adapter (when will I learn?). Removed all the wires though, it powered on OK. Some discouraging comments from my wife made me give it up and went to bed.

3rd try: I searched and found an old USB SD reader from the closet. Used the soldering iron to remove the SD socket from the poor reader and restart my wiring and soldering. To my surprise it worked on the first attempt.

root@zrouter:~# dmesg |grep mmc
mmc: starting module with: SD_DI=0x40, SD_DO=0x20, SD_CLK=0x8, SD_CS=0x80
mmca: p1

…and tahdah

root@zrouter:~# df -h
Filesystem              Size Used Available Use% Mounted on
rootfs                  2.8M 2.8M        0  100% /
/dev/root               2.8M 2.8M        0  100% /
/dev/mmc/disc0/part1  955.7M 4.8M   902.3M    1% /mmc

Now I have a router with Cisco-grade firmware and 1GB of storage! If you ever want to try this mod then consider the following:

  • A good night sleep, you need it, I learned it the hard way
  • An SD reader socket. Don’t try hard-wiring, doesn’t worth it and it may ruin your card (that’s why I got a MicroSD and an adapter but still…)
  • Wires (6 of ‘em), you can strip the network cable but I found that they’re too hard, so I used ones inside an old PC.
  • A fine temperature-controlled precision soldering iron is highly recommended. I was such a cheap ass to get one so I used an old one. The thing was too hot (60W), too long, and the handle is not even heat-insulated (well it is but not that good). I almost lost a tiny resister because the solder was too hot. It worked but not without a fight.
  • Also, you should glue the wire (the tip that comes out from the solder point) to the board. The solder points are tiny and it won’t survive some gentle yankings :p

Oh, I almost forgot, here’s the final product (it’s not that well lit, I had to use a desk lamp):


Previous

mrxvt & xvnkb

I just found the almost-perfect tabbed terminal called mrxvt (previously called materm). It has tabs (with built-in widget so it doesn’t require gtk/qt crap), configurable keyboard shortcuts, and so much more. The only thing, well two things, that it sucks at is Unicode support and problem with XIM, which creates problem with xvnkb. Unicode? Well, that I can live without. In fact I can’t recall the last time I need to use Unicode in a terminal and in such case, urxvt & xterm are here.

Next

TomatoUSB + Optware + rrdtool + dygraphs = cool bandwidth monitor

I recently upgraded my Buffalo WHR-HP-G54 to an ASUS RT-N16 as I needed gigabit ethernet; and usb ports + wifi N are all welcoming upgrades to the aging buffalo. As an inevitability, I installed TomatoUSB and plugged in a 4GB USB stick. Now, TomatoUSB itself is a very good system with loads of features but you can extend even more by adding Optware. I will not go into the installation as there already is a very good guide to follow.