Debricking a WNR3500L using NetBSD and a USB to serial + ttl converter cable

1 post / 0 new
IMHal
IMHal's picture
Debricking a WNR3500L using NetBSD and a USB to serial + ttl converter cable

The thread http://www.myopenrouter.com/article/36609/How-to-Debrick-Your-WNR3500Lv2... gives the procedure for doing what I'm describing here using Windows; it also includes the part # and a source for a cable that will allow you to hook up your PC to your router without frying either one - at least, that's been the case in my experience; hopefully, you'll have similarly good results ;)

NetBSD 5.x (the current release) includes native support fot the cable in the thread referenced above - it's a 3.3v USB to serial/TTL converter cable; the manufacturer is FTDI; the cable is available through "Mouser"; see "man ftdi".

The procedure is very simple: first, build minicomm (/usr/pkgsrc/comms/minicomm) - you could also try installing a pre-built binary if you're so inclined.

Plug the FTDI cable into the router as detailed in the Windows thread, and the other end of the
cable into the NetBSD host. Then, as user "root", set up minicom to use 115200/8/N/1 with no flow control, and port ttyU0, which is where NetBSD will put it unless you're using >1 USB to serial adapter, in which case, the FTDI cable will likely be assigned to /dev/ttyU1.

The reason for doing this as root is that root is the only user with access to /dev/ttyU0. You could try chmod-ing /dev/ttyU0, or just perform this procedure as root; for what it's worth, I'm personally reluctant to do much while logged in as root, and I did this while logged in as root. That's up to you, though.

Note that when you start minicom, start it with its "-o" switch:

minicom -o

or the program will send the router a modem initialization string.

Next, save the above settings and exit minicom; don't try and use it at this point: your new settings won't all be effective until the next time you start the program. At this point, regardless of how you have file permissions set, Minicomm will likely complain that it can't write to ".minirc.dfl", so, from a separate ssh session, another virtual console, etc.:

touch /root/.minirc.dfl
chmod 777 /root/.minirc.dfl

Restart minicomm (don't forget the "-o" switch) and verify that the serial port, baud rate, etc., are correct.

At this point, follow the instructions in the Windows thread r.e. typing ^C and tftp'ing firmware to the router.

Of course, you can also just use the serial connection: if you don't press ^C, you'll see the router's boot sequence take place, and ultimately, wind up at a shell prompt, where you can do anything you could do if you had connected to the router via ssh or telnet. You can learn some interesting details with respect to how the router functions by watching the boot sequence / boot messages.

I hope this is of some use to someone.