Sunday, October 07, 2012

Bricked TRENDnet TEW-651BR


Despite carefully following the directions for performing a firmware update on my TRENDnet TEW-651BR, I recently found myself with a non-responsive (aka "bricked") router.  It wasn't handing out IP addresses and when I manually configured my computer to use an IP in the TEW-651BR's default 192.168.10.* range I was still unable to get any response.

Feeling defeated, I submitted a support ticket to TRENDnet and then setup an old computer to temporarily serve as a wireless router while I waited for a response from support.  TRENDnet tech support replied in about a day, but unfortunately they were unable to offer any assistance beyond a lengthy (scripted) response which could be summarized as, "reset the router and try the firmware update again". 

Searching the interwebs failed to turn up a solution, so I figured I'd wing it.  Although most of my experience is with desktop application development, I do have some development experience on embedded systems as well.  And I know from my brief time in that realm that some devices (including routers from other manufacturers) can be recovered using a TFTP upload of the firmware even if they're otherwise non-functioning.

So with nothing to lose, I decided to give it a whirl.  I setup my computer to tftp the firmware to the router's default IP (192.168.10.1):

tftp -i 192.168.10.1 firmware.bin

I plugged the router in and as soon as I saw the lights start, I hit enter.  Instead of emitting an error, tftp showed a progress bar and a few moments later the router rebooted itself.  Keeping my fingers crossed, I reconfigured my computer to use DHCP and attempted to connect to the router's management web page.  After what felt like an eternity, the browser refreshed with the familiar TRENDnet logon screen and I was back in business.

It has been just over two months now and I'm happy to report my TRENDnet TEW-651BR is still working nicely.

Update (June 2013)

My original post included instructions based on TFTP under Linux.  If you don't have access to a Linux machine, TFTP is available on Windows and MacOS too.  Unfortunately the command syntax is slightly different on each platform.  I'll try to outline the steps below for using TFTP on each of these platforms.

Windows

I believe a TFTP client was installed by default under WinXP if TCP/IP was installed.  Under Windows Vista and Win7, the TFTP client is not installed by default and some extra steps are required to install it.  I suspect a similar process must be followed in Win8.

First navigate to the Control Panel-> Programs->Turn Windows Features on or off



Scroll through the list and find the 'TFTP client'.  It'll be unchecked as in the screen shot below.  Check the box next to TFTP client and click "OK".  It may take a couple minutes while windows installs this component.


Once installed, you should be able to run TFTP from a command prompt.  The Windows version of TFTP requires slightly different syntax (highlighted in red below).

tftp -i 192.168.10.1 PUT firmware.bin

There are also many, free graphical TFTP clients available for Windows.  A quick search should turn up one or more of these tools.  Just make sure you transfer the firmware in binary mode!

MacOS

The TFTP client provided with MacOS only runs in an interactive mode.  This makes it harder to hit the small window in which the TFTP server is listening.  Consider using an alternative TFTP client like MacPorts tftp-hpa port instead of the built-in TFTP client.

To upload the firmware you'll need to first launch TFTP from the directory which contains firmware.bin

tftp -i 192.168.10.1

Then from the tftp> prompt you'll need to issue the following commands:

tftp> verbose
tftp> put firmware.bin
tftp> quit

The 'verbose' command simply tells TFTP to provide more information about what it's doing.  This can be issued as soon as TFTP is started.  The 'put' command should be issued at the point when the lights start on the router.

Like Windows, there are third party TFTP clients available for the Mac. Users in other forums have experienced some difficulty using the built-in TFTP client so you might consider using a third party client instead.

Other Tips

The window of time that the router's TFTP server is listening is very short, maybe as little as 1-2 seconds from the time the router is powered on.  If you miss this window, TFTP will just sit trying to connect and eventually time out.

When TFTP connects and the file is uploaded you should see status something like:

Transfer successful: 8388608 bytes in 2 second(s), 4194304 bytes/s

If you don't see any status from TFTP after about 30 seconds and the router doesn't reboot itself within a minute or two, then you've likely missed the window and will  need to try again.

For additional info on how to recover a bricked router, I'd recommend looking at DD-WRT's excellent Recover From a Bad Flash wiki page.  There are tips for multiple makes & models of routers and much of what is written there can be used with stock firmware just as readily as DD-WRT.  (Note:  At the time of writing, DD-WRT is not compatible with the TEW-651BR, so don't even try!)