LAN-port mapping

Note: On (EU) version seems to be 1-4, 2-3, 3-2, 4-1, best check before connecting a cable and using cable detection (on luci>network>switch).

chassis port

internal-port

WAN (blue)

CPU: eth0

1 (yellow)

Switch eth1; Port 2

2 (yellow)

Switch eth1; Port 3

3 (yellow)

Switch eth1; Port 4

4 (yellow)

Switch eth1; Port 1

Note: the default lan interace (VLAN 1) is preconfigured to use eth0 physical interface (cpu untagged in switch configuration). If you want to use more than one VLAN connected to CPU, then CPU port must be tagged. In this case you need to change lan interface from eth0 to eth0.1 (for VLAN id = 1). If using luci, remember to do both changes (switch and lan) before applying any of them.

Flash Layout

Please read the article Flash.Layout for a better understanding. It contains a couple of explanations. Then let's have a quick view at flash layout of this particular device:

GPIOs

→ port.GPIO
The AR9341 v3 platform used in the TL-WR842ND provides 23 GPIOs. Some of them are used by the router for status LEDs, buttons and to communicate with the RTL8366RB. The table below shows the results of some investigation:

GPIO

Common Name

Usage

4

USB Power

set to 0 to turn off the usb port, 1 to turn on

Photos

Opening the Case

Loosen the screws under the two rubber foots at the back of the device before (forcefully) pulling the upper and lower shelfs apart.

Serial connector

TL-WR842ND v1.0 Serial-Interface

TL-WR842ND v2.1 Serial-Interface

TL-WR842N(RU) v3 Serial-Interface

Serial

Pinout

1

2

3

4

V1

V2.1

TX

RX

GND

VCC

SJ1

JP1

Pin 1 is clearly marked on the board.

To get the serial connection work reliably, you may have to connect a 10k pullup resistor between the TX and the 3.3V pin (same problem as described in TL-MR3420). For some users the V2.1 models did not need this pullup resistor.

The TX pin is connected via a 10k resistor to ground and via a 100nF capacitor to the serial output of the SoC. This gives a 2.5Vpp swing centered on ground. While this may work with some serial adapters, it is on the low side for most. An advantage of this connection scheme is that it protects the serial output to some degree.

For WR-842N v3, to activate serial interface, you need to solder two resistors (or jumpers) according this photo (marked as red circles):

Recovery (v1)

Using the integrated tftp capability of the router.

First, enter failsafe mode:

Remove the power plug from the router.
Press and hold the WPS/RESET button.
Insert the power plug without releasing the RESET button, wait a moment for the USB LED to begin to blink.
Release the RESET button

No LED besides the one for USB (and maybe for attached ethernet ports) should be lit.

The device now uses the IP 192.168.1.86. It repeatedly tries to download a file named: wr842ndv1_tp_recovery.bin from a tftpd server with the IP 192.168.1.66.

The following steps will serve an openwrt fimrware image to the device:

Download an appropriate firmware file from TP-LINK site.
You might need a "stripped" firmware version (without "boot" in the name). See bottom of this page for details and a download link.
Rename the file, so it matches the name required by the router: wr842ndv1_tp_recovery.bin

Configure your PC lan adapter ip address to IP 192.168.1.66 and connect your computer to one of the LAN ports of the router.

Run the tftp server and browse for the directory that contains the above firmware image. If necesary allow the connection of the server through your PCs firewall, once configured, shutdown the tftp server program, you will launch it again later.

If you connect your pc directly to a lan port on the router, be sure to put the router into failsafe mode FIRST (press reset button and plug power cable release reset button after 3 second), and then launch the tftp server, otherwise it might have problems trying to bind to the PC network interface.

Right after you launch the tftp server, a couple of blank messages will appear into the log window of the tftp server, this is normal, the third or fourth message will indicate that the process of file transfer is in progress.

After some time you will see all LEDs flashing once followed by a normal restart of the router

Now you can install the openwrt factory image of your liking, via the vendor firmware upgrade web page of the router.

You could try to flash directly using this method, an openwrt factory image (for this model obviously) to the router, for me it did not work, maybe you have better luck.

Remove the power plug from the router.
Press and hold the WPS/RESET button.
Insert the power plug without releasing the WPS/RESET button, wait a moment for the Lock LED to come on solid.
Release the WPS/RESET button

Connect pc to one of the router LAN ports.

Device

IP

router ip

192.168.0.86

set your pc ip

192.168.0.66

Set pc ip:

ifconfig eth0:1 192.168.0.66/24 up

Router repeatedly tries to download wr842nv2_tp_recovery.bin from a tftpd server running on 192.168.0.66.

Install tftpd server:

pacman -S tftp-hpa

Download TP-LINK firmware to tftp root and rename it to wr842nv2_tp_recovery.bin:

Power

General

This device has two main power regulators, one 12V→3V3 for the CPU, memory, wireless and one 12V→5V for USB.

Main 3V3 Power

This is delivered by a switching regulator with up to 2A at 3V3 output. Power is drawn from external input over one 1A Schottky diode (SS14), with a voltage drop of max .45V at 1A. It should be perfectly safe to draw an additional 100-200mA for your own additions from 3V3.

USB Power

USB power is derived from the 12V input over two SS14 Schottky diodes, the one also feeding the 3V3 regulator and an additional one. The output regulator is capable of delivering up to 1.5A, but there is a USB current switch/limiter that limits output current to 1A (and goes into 50% duty-cycle on/off in addition after about 200ms on short-circuit).

It should be fine to draw something like 700mA long-term from 5V USB and up to a bit less than 1A briefly. This is enough to spin-up and power most external 2.5" USB HDDs. You can try it out. The worst that can happen is that it does not work. The USB power-switch is fully protected and the regulator has reserves, as it uses an external PNP power transistor and has its own over-current protection at 1.1A.

I did run it at 750mA current draw from USB for half an hour without the regulator getting too warm. What I measured was 10C below the main SoC. The external 12V/1A PSU should also be fine with these loads. Still, if anything blows up in your face, or your house burns down, I am not responsible…