Unbricking your router with a Raspberry Pi en

By Gtoniser on Sunday 24 February 2013 15:15 - Comments (6)
Category: Raspberri Pi, Views: 8.300

So one of my friends wanted to install a new firmware on his router (a Netgear WNR3500Lv2). Unfortunately he downloaded a wrong version and thus his router refused to boot. Bricked.

Now there are some tutorials on the internet on how to unbrick this router, one involves a USB-TTL cable and one uses a method which short circuits 2 pins on the mainboard.
The second method helped me out when I bricked my router, the Netgear WNR3500Lv1 (note the v1), but the v2 has a different chip layout and we could not find the right chip on his model.

The first method seems a bit less dangerous, but requires a USB-TTL cable, which I don't happen to have. What I do have is a Raspberry Pi, which has a serial port connection.
Getting started
- Raspberry Pi running Raspbian
- Some cables
- Broken WNR3500Lv2

I'm connecting to my RPi via SSH.
To be able to use the serial port we first need to disable the console login that the RPi automatically starts up on the serial port when booting.

This is done by commenting out the following line in /etc/inittab
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Now after rebooting the RPi, we can use the serial port for our own purposes.
Connecting the RPi to the router
The Raspberry Pi serial ports are on GPIO 14 and 15:
http://lavalink.com/wp-content/uploads/2012/04/raspberry-pi-serial_sm-241x300.jpg(source: lavalink.com)

We connect these ports to the RX and TX on the router (make sure the router is turned off!). We also connect the GND.
From left to right: GND, RX, TX


I am using a breadboard here in between, you can ignore this and all the wires on it, the only reason I used it is because I didn't have any Female-Female cables. Connecting the RPi directly to the router is how it works.
Restoring the firmware
Now to get the serial interface working we use minicom. Install it first on the RPi with
sudo apt-get install minicom

Then run minicom on the serial port of the RPi
sudo minicom -b 115200 -o -D /dev/ttyAMA0

We are now connected directly to the router with our Raspberry Pi. Feeling like a hacker already?

Now power on the router while holding Ctrl + C in the terminal window:

When this is done just execute the command

to start the tftp deamon.

Now what I did was connecting a laptop to the router with a static IP address (since I was using my main PC to control the Pi) so that we can reach the router on
When this is done we can download the original firmware for the WNR3500Lv2 and push this to the router with tftp
tftp -i put FIRMWARE_FILE

After this the router rebooted and I could access the admin interface on in my browser.

If you want to try this for yourself, the following guides can be helpful:
SSH connection to your RPi
Using the RPi serial port
http://www.myopenrouter.c...USB-TTL-Cable-on-Windows/ (step 9 and further explain how to put the firmware on the router)
http://www.myopenrouter.c...-A-Serial-Cable-on-Linux/ (explains how to use this method on linux, you could use this to push the firmware from your RPi)