loading
I have a nice wireless router from TP-LINK, MR 3420. It is a typical WiFi router, the reasons I bought it were:
1. it has an USB port and
2. you can load OpenWRT on it.

So I got the device, I installed OpenWRT and somehow I managed to setup the wrong IPs. The result? I was locked outside - it was impossible to get in, typical 192.168.1.1 was not working neither buttons combinations as described in OpenWRT pages (failsafe mechanism is not working or not available for this router).

I asked also someone to try to "unlock" it, but no success. The last solution was to use the serial console recovery.

A few words about serial console recovery for OpenWRT: technically speaking each router has a serial port. This can be either
located on a connector on the PCBA (printed circuit board assembly - the electronic board with components), either are some separate pads on the PCBA and there some wires must be soldered in order to access the serial port.

Also it worth mentioning that the serial port on such devices is not RS232 serial port: serial port on routers is using electrical signals in the range 0V..+3V3 or 0V..+5V, RS232 is using signals -12V..+12V. So using RS232 to USB converters is not useful, we need a 3V3 or 5V logical level to USB converter.

My friend Google told me that there is a cheap way to build such a converter: use a data cable for mobile phones (some old models). Basically you can pay 5$ and get a nice data cable: at one end you have the phone connector, at the other a USB connector with a small PCBA which converts data to USB.

The purpose of this instructable is to describe how to build such cable for a serial console recovery for OpenWRT on TP-LINK MR4320 and  MOST IMPORTANT how to use it because I made the cable, I connected myself, it was working, but I had no clue how to perform the recovery, I am not familiar with Unix / Linux.

Tools needed:
-soldering tools
-screw drivers
-wire cutter
-cutter
-hot glue gun
-helping hands or a small vice


Materials needed
-hot glue
-data cable for mobile phones (type DKU-5 or CA-42)
-2,54mm header 4 pins (both male and female)
-PC with PuTTY

Let's start! 

Step 1: Cutting the Cable

Buy one USB to serial data cable (logical levels 3,3V or 5V) type DKU-5 or CA42. 
Cut the connector which goes to the mobile phone.
Open the USB plastic case in order to identify the wires: Tx (data transmit FROM computer TO device), Rx (data received FROM device TO computer) and GND.

Therefore Rx from the PCBA must go to serial Tx on the router, Tx from the PCBA must go to serial Rx on the router.
Also identify in advance the pins on the TP-LINK MR3420 router, you need to match the cable, you have to fit them.

Step 2: Soldering Connector on the Cable

As stated in the previous step, it must be identified the serial port location on the PCBA of the TP-LINK MR3420 in order to match the cable connector. Check the image with the serial port location. You can see location of SJ1 connector, a footprint for 2,54mm headers, 4 pins.

Based on that, the 4 pins female header was soldered at the end of the cable, also a 10k Ohm resistor was soldered (pull-up) between Tx of the cable and the GND pin. Hot glue was used to make a stiff assembly.

Since the USB plastic case of the cable was open, 2 solder joints were made on the USB metal case to improve it mechanically and electrically. 

Connections should match the "schematic" presented here.

Step 3: Soldering Header Connector on the Router

In order to connect the cable, a connector is need on the PCBA of the TP-LINK MR3420 router. Since the cable used a header 2,54mm female, on the router I used a 2,54mm male 4 pins header.

It is pretty straight forward the soldering process on the pads of SJ1, after that I checked the connection.

Step 4: Serial Cable and Driver Setup for Windows Operating System

So far so good: a USB cable is connected to the TP-LINK MR3420 router's serial port for serial console recovery.

USB cable goes to your computer, therefore a driver is needed. I have Windows 7 and it was cumbersome to find a driver for the cable. I cannot give a specific driver location on the Internet for download because my driver was not working on another similar cable, so better try finding on your own the driver you need. Sorry!

The cable is a classic USB to serial using PL2303 chipset from Prolific (annoying name - I lost time, it wasn't prolific at all). After finding the right drivers for the cable, the cable was a serial port.

It maybe that the price (5$) put some troubles on my way and maybe the chip was not genuine, who knows? In the end it was working fine.

Step 5: Serial Connection on Windows

Connect the cable to the MR3420 router.
Power the router.
Download PuTTY from the Internet (just google for PuTTY). Open the application and do the setup as in the screen shot.
Hit "Open" button.

Now you should see a black screen, hit Enter key a few times to make sure you have the root prompt. Ignore garbage characters comming out from the high quality cable just made :)

Step 6: Serial Recovery Console in Use

So I am connected to the router. Here was my problem: what to do in order to gain my access rights back? Where to modify? What to modify? I was not able to find a step by step description.Eventually a friend advised me and here I am. 

Since I don't know too much Unix. / Linux, a barbarian method was used in order to regain my access rights: restore to factory defaults. Simple, isn't it? Not too smart, but worked. Write following commands in order to reset to factory defaults:

firstboot && reboot

After that, the router will reboot and you have to use PuTTY again, this time use Telnet to connect to the router to 192.168.1.1 . Give following commands to setup root password (write it somewhere in order to have it in case you forget it, if you don't want to reset again to factory defaults...):

passwd

From this moment on, telnet is not accessible anymore, use PuTTY and SSH or web interface (via Internet browser - see images) to connect to the router, user name is root and password is the one given via telnet and the one you wrote it down. Do you remember it? :)
<p>fantastic guidelines.</p>
<p>The network configuration in OpenWrt is stored in /etc/config/network and is divided into interface configurations. Each interface configuration either refers directly to an ethernet/wifi interface (eth0, wl0, ..) or to a bridge containing multiple interfaces. It looks like this:</p><p> config interface &quot;lan&quot; <br> option ifname &quot;eth0&quot; <br> option proto &quot;static&quot; <br> option ipaddr &quot;192.168.1.1&quot; <br> option netmask &quot;255.255.255.0&quot; <br> option gateway &quot;192.168.1.254&quot; <br> option dns &quot;192.168.1.254&quot;</p><p>You must use : vi command which is an basic editor , so the command is :</p><p>#vi /etc/config/network</p><p>then you use arrow to go to the desired info you want to change ,press i on keyboard to insert and then modify the IP . After that you press on you keyboard in this order following : &quot;ESC&quot; , &quot;:&quot; , &quot;wq&quot; &quot;Enter&quot;</p><p>This way all modification are saved.</p><p>Then you issue : #/etc/init.d/network restart and now the OpenWrt router will have the IP you just modify earlier.</p><p>Make sens for all that use OpenWrt to read the WIKI from openwrt.org .</p><p>There you can find all info including unbrick your router , flashing your router , setup of your router.</p>
<p>When I posted this Instructable, 2 years ago, I just begun the OpenWRT trip. Now I realize that Open WRT is quite complicated for a new comer. I think sometimes it is needed punctual information about solving a problem, it took me days to solve such simple topic. WiKi is good if you know what are you looking for and where to look for :) Thanks for your observation! </p>
wow, I can;t believe it was so hard to undo this mistake!
Maybe there is another way, I hope, but I didn't find it at that moment - I am not very experienced on this Linux embedded world. Since I struggled a lot, I considered fine to tell to others how to do it to save their time <br>The thing is that the reset button is not implemented to perform a reset to factory defaults on TP-LINK MR3420, that will be the most convenient way, you will not need to build any cable and your warranty is not broken.

About This Instructable

43,948views

18favorites

License:

Bio: I like making things, trying to utilize my hands and my brain. There is no limit!
More by CatalinRO:Garden hose adapter for IBC tote Modify a Dell Laptop Power Supply (PA-10) Micro USB Lithium charger for cilindrical Lithium baterry 
Add instructable to: