flashing buffalo router from mac os x

I bought the highly spoken of (scroll down here) Buffalo WHR-G125, which is cheap and flashed it’s software so I can use dd-wrt. I did this from a mac following the directions, but in the end I had a tough time getting the timing right. So this posting’s purpose is to explain how to get the timing right.

I used two tricks. The first is to use expect to script tftp. The second is ignore the instructions (which say to launch the upload when the lights on the router indicate that the single LAN Ethernet your using to connect to it is now active). Instead I wait until the Mac’s brings up it’s interface.

My expect script looked like this:

#!/usr/bin/expect -f
set  timeout 3000
spawn “tftp”
expect “tftp> “; send “binary\n”;
expect “tftp> “; send “rexmt 1\n”;
expect “tftp> “; send “connect 192.168.11.1\n”;
expect “tftp> “; send “put dd-wrt.v24_std_whr-g125.bin\n”;
expect “tftp> “; send “quit\n”;

You use this command to run that.

 % expect flash_it  

That’s pretty straight forward and expect is installed on the mac if you have unix tools, which your likely to if your flashing routers in your spare time. You invoke it like so:

It’s easy to see when the Mac bring up the network connection to the router. When you set things up following the instructions you configured the your network to talk to the router. Open that system preferences up again and stare at the TCP/IP page. You can monitor that page to see the connection to the router come up; first the Ethernet is sensed and a moment latter the IP address is configured; it’s at that point you hit return on the command above.

Leave a Reply

Your email address will not be published. Required fields are marked *