TP-Link TL-WR842N/ND

Version/Model Release Date OpenWrt Version Supported Model Specific Notes
V4 2013 unsupportable Only 2M flash? http://www.tp-link.com.cn/product_298.html
V8.0 ? unsupportable Only 2M flash (25q16cs1g). SOC Qualcomm Atheros QCA9535. No USB
V9.1 ? unsupportable Only 1M flash (25q80cs1g). SOC Mediatek MT7628KN 1707-AJCJL EAPOW338 05AA66376H70002

The v9 device is significantly different and unable to support OpenWrt due to memory and flash constraints. See https://forum.openwrt.org/t/feeling-bad-about-tl-wr842n-v9-1-only-1m-flash/14896

Installation via factory web GUI is possible. Just rename the image file to something short before uploading (openwrt-19.07.2-ath79-generic-tplink_tl-wr842n-v3-squashfs-factory.bin to firmware.bin) → Install OpenWrt (generic explanation)

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 firmware 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. Install a tftp server, for windows you can download one from http://tftpd32.jounin.net/
Run the tftp server and browse for the directory that contains the above firmware image. If necessary 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.

Using the integrated tftp capability of the router.
First, enter failsafe mode:
I have a question here, why enter failsafe mode, if you are going Failsafe that's another route, all you have to do is whats next here is a example too http://forum.tp-link.com/showthread.php?81462-How-to-recovery-the-router-when-you-bricked-it 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:

mkdir /srv/tftpd
cd /srv/tftpd
wget http://www.tp-link.com/resources/software/TL-WR842ND_V2_130628.zip
unzip TL-WR842ND_V2_*.zip
mv wr842ndv2_en_3_14_2_up_boot(130628).bin wr842nv2_tp_recovery.bin

You might need a “stripped” firmware version (without “boot” in the name). See below for details and a download link. Start tftpd server:

systemctl start tftpd.socket
systemctl start tftpd.service

Router must be in recovery mode before starting tftpd server, otherwise it might have problems trying to bind to the PC network interface.
After some time you will see all LEDs flashing once followed by a normal restart of the router.

- Get OEM firmware file from https://www.tp-link.com/en/support/download/tl-wr842n/#Firmware or from mirror https://tplinkforum.pl/t/recovery-dla-routera-tp-link-tl-wr842n-v3/9310.
- Rename recovery firmware file to wr842nv3_tp_recovery.bin.
- Set up tftp server using IP 192.168.0.66.
- Load OEM firmware into router using TFTF client method.
- Login into router GUI on 192.168.0.1 with user admin and password admin.
- Under menu “System Tools” → “Firmware Upgrade” you can upload Openwrt well known working “factory.bin” image.

Using the integrated tftp capability of the router.

- Turn off the router. - Connect PC to one of the router LAN ports. - Set your PC IPv4 address to 192.168.0.225/24. - Run any TFTP server on the PC. - Put the recovery firmware on the root directory of TFTP server and name the file tp_recovery.bin - Start the router by pressing power button while holding the WPS/Reset button (or both WPS/Reset and WIFI buttons) - Router connects to your PC with IPv4 address 192.168.0.2, downloads the firmware, installs it and reboots. LEDs are flashing. Now you have OpenWrt installed. - Change your IPv4 PC address to something in 192.168.1.0/24 network or use DHCP to get an address from your OpenWrt router. - Done! You can login to your router via ssh.

Once you are connected via serial cable to router you will see this prompt

wasp>

Then type “printenv” to see environment variables:

wasp> printenv
bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:128k(u-boot),1024k(kernel),6912k(rootfs),64k(config),64k(art)
bootcmd=bootm 0x9f020000
bootdelay=1
baudrate=115200
ethaddr=0xba:0xbe:0xfa:0xce:0x08:0x41
ipaddr=192.168.1.111
serverip=192.168.1.100
dir=
bc=ap123
lu=tftp 0x81000000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize;cp.b $fileaddr 0x9f000000 $filesize
lf=tftp 0x81000000 ${dir}${bc}-squashfs&&erase 0x9f120000 +$filesize;cp.b $fileaddr 0x9f120000 $filesize
stdin=serial
stdout=serial
stderr=serial
ethact=eth0
wasp> setenv serverip <TFTP server IP>
wasp> setenv ipaddr <Temp IP address on my network>
wasp> tftpboot 0x80000000 openwrt-15.05-ar71xx-generic-tl-wr842n-v2-squashfs-factory.bin
done
Bytes transferred = 8126464 (7c0000 hex)

Note the hex value in brackets - “(7c0000 hex)”. If you get different value use your value in lines below, otherwise you may irreversibly brick your device.

wasp> erase 0x9f020000 +0x7c0000
wasp> cp.b 0x80000000 0x9f020000 0x7c0000
wasp> bootm 0x9f020000

Warning!
This section describes actions that might damage your device or firmware. Proceed with care!

With the TL-WR842N/ND router, there is a catch: the stock firmware is obtained from the OEM: http://www.tplink.com/en/support/download/?model=TL-WR842ND * in case the file name of this firmware file does not contain the word “boot” in it, you can simply revert back to original firmware * in case the file name of this firmware file does contain the word “boot” in it, you need to cut off parts of the image file before flashing it:

The following method applies for the V1, V2, V3(EU) and V5(RU) since the bootloader is the same size.

An example of an image file with the word “boot” in it is wr842ndv1_en_3_12_25_up_boot(130322).bin.

Cut the first 0x20200 (that is 131,584 = 257*512) Bytes from original firmware:

dd if=orig.bin of=tplink.bin skip=257 bs=512

You should transfer the firmware image to the /tmp folder and revert back to original firmware (if available you can flash the firmware via the web interface as well):

Via the safer method using sysupgrade:

sysupgrade /tmp/tplink.bin

Or you use the mtd method:

mtd -r write /tmp/tplink.bin firmware

It is also possible to revert to the stock firmware using the method with tftp described in “recovery”. (You still need the firmware image without the boot part).

OEM TP-Link firmware for the TL-WR842N/ND with the boot part removed to revert to the original OEM firmware: * TL-WR842ND V1 TL-WR842ND-V1-stripped.zip * TL-WR842ND V2 TL-WR842ND-V2-stripped.zip

Model TL-WR842ND TL-WR842N(EU) TL-WR842N(RU)
Version v1 v2 v3 v5
Architecture: MIPS 24Kc V7.4 MIPS 74Kc V4.12 MIPS 24Kc MIPS 24KEc V5.5
Manufacturer: Atheros Qualcomm Atheros MediaTek
Bootloader: U-Boot U-Boot?
System-On-Chip: Atheros AR7241 Atheros AR9341 Qualcomm Atheros QCA9531-BL3A MediaTek MT7628NN
CPU Speed: 400 MHz 535 MHz 650 MHz 580 MHz
Flash chip: Spansion S25FL064P (FL064PIF) Winbond 25Q64FV or Spansion S25FL064 Winbond 25Q128CS16 SPI 25Q64CS16
Flash size: 8 MiB 16 MiB 8 MiB
RAM chip: A3S56D40FTP -G5 Winbond W9425G6JH-5 Zentel A3R12E40CBF-8E Zentel A3R12E40DBF-8E
RAM size: 32 MiB 64 MiB 64 MiB
Wireless Atheros AR9287-bl1a Atheros AR9341 Qualcomm Atheros QCA9531 MediaTek MT7628NN
Antenae(s) 2 removables 2 non-removable 2 non-removable
Ethernet: 4 LAN, 1 WAN 10/100
USB: 1 x 2.0
Serial: Yes

This is only tested on a V2 device.

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.

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:

TP-Link WR842ND Visual Flash Layout OpenWrt 12.09
Offset 0 128 1071 2944 8128
x64KiB Blocks 2 14. ... 29. ... 81 1
TP-Link WR842ND Flash Layout OpenWrt 12.09
Layer0 m25p80 spi0.0: s25sl064a 8192KiB
Layer1 mtd0 u-boot 128KiB mtd5 firmware 8000KiB mtd4 art 64KiB
Layer2 mtd1 kernel 943KiB mtd2 rootfs 7057KiB
mountpoint /
filesystem mini_fo
Layer3 mtd3 rootfs_data 5184KiB
Size in KiB 128KiB 943KiB 1873KiB 5184KiB 64KiB
Name u-boot kernel rootfs_data art
mountpoint none none /rom /overlay none
filesystem none none SquashFS JFFS2 none

ART = Atheros Radio Test - it contains mac addresses and calibration data for the wifi (EEPROM). If it is missing or corrupt, ath9k won't come up anymore.

Here is a LibreOffice Calc ODS for better understanding: http://ubuntuone.com/5eT1OJweXjF6aa3lMciaLw .

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

AR7241 rev 1 (TL-WR842ND v1):

GPIO Common Name Usage
6 USB Power set to 0 to turn off the usb port, 1 to turn on

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. TP-Link TL-WR842N back of case

Serial connector

WR842ND-V1-serialTP-Link TL-WR842N Serial Connectortl-wr842n_v3_serial.jpgtl-wr842n_ru_v5.jpg
TL-WR842ND v1.0 Serial-InterfaceTL-WR842ND v2.1 Serial-InterfaceTL-WR842N(RU) v3 Serial-InterfaceTL-WR842N(RU) v5

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):

The right settings for accessing the serial console are as follows:

Bits per second: 115200
Data bits: 8
Stop bits: 1
Parity: None
Flow control: None

Password to get into uboot prompt is tpl
Password to get root login is 5up

For TL-WR842n v.3 serial console/ssh access
Login: root Password: sohoadmin

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...

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2024/04/29 22:04
  • by jalakas