Support for TL-WR840N Ver 6.0

I am using latest openwrt. I compiled and flashed successfully openwrt-ramips-mt76x8-tl-wr840n-v6-squashfs-tftp-recovery.bin but i have no ping and nothing works at all.
I am connected with serial console and i see the kernel and linux information. I can login via that console type etc... ifconfig gives me everything okay but there is no RX traffic on eth0.
What could be the reason for this ? I see no errors or anything...Seems like device switch is not working correctly or is something different like address / eeprom ?

Ok i fixed it. You need to touch two more files:
target/linux/ramips/base-files/etc/board.d/02_network and target/linux/ramips/base-files/lib/
You must add tl-wr840n-v6 in both files.
This activates the chip switch. Now everything works as expected.
Btw you can make version 14 working using same tips.

The big problem is that once you flash with openwrt there is no way you can return back the original firmware.
I tried sysupgrade/tftp with no success. I tried modify binary files like cutting etc.... but nothing helps.

Any one can provide the final working. bin file for for Tp-Link 840ND V6
@sanitariu plz help me i have 20 pcs and need to flash to open wrt mode

Before installing any OpenWrt firmware on the v6, you should be aware that there are usability restrictions to be expected due to low flash and RAM (only 4MB flash / 32MB RAM). See for details.

For OpenWrt firmware, see above:



Return to stock firmware:

Stripping the header (needed to return to stock firmware):


Version 6.0 is easy. You must touch 4-5 files and compile. There is enough space even for Luci + ipv6. My final images are:
3670726 Jan 8 16:09 openwrt-ramips-mt76x8-tl-wr840n-v6-squashfs-sysupgrade.bin
4063232 Jan 8 16:09 openwrt-ramips-mt76x8-tl-wr840n-v6-squashfs-tftp-recovery.bin
Router is almost the same as version 5.
You must touch the following 2 files:
Add here your model search for 840 and add after v5 ... v6
Copy ./target/linux/ramips/dts/TL-WR840NV5.dts to ./target/linux/ramips/dts/TL-WR840NV6.dts and edit inside. Just change v5 to v6.
Edit this:

        memory@0 {
                device_type = "memory";
                reg = <0x0 0x2000000>;

Router has 32MB memory. On version 5 it was 64MB. China stuff :slight_smile:
Partiotion in the file must be:

                        partition@0 {
                                label = "boot";
                                reg = <0x0 0x10000>;

                        partition@10000 {
                                compatible = "tplink,firmware";
                                label = "firmware";
                                reg = <0x10000 0x3d0000>;

                        factory: partition@3f0000 {
                                label = "factory";
                                reg = <0x3f0000 0x10000>;

&wmac {
        status = "okay";
        mtd-mac-address = <&factory 0xf100>;
        mediatek,mtd-eeprom = <&factory 0x10000>;

&ethernet {
        mtd-mac-address = <&factory 0xf100>;
        mediatek,portmap = "wllll";

Next edit: ./target/linux/ramips/image/ and add your model like this:

define Device/tl-wr840n-v6
  DTS := TL-WR840NV6
  IMAGE_SIZE := 3968k
  DEVICE_TITLE := TP-Link TL-WR840N v6
  TPLINK_HWID := 0x08400006
  IMAGE/tftp-recovery.bin := pad-extra 64k | $$(IMAGE/factory.bin)
TARGET_DEVICES += tl-wr840n-v6

This makes it working very good. Still i do not know how to make orange led working.
I checked pinout scheme but it does not work. May be i miss something

Also i did changes and make tp-link version 6.2 working too. But on version 6.2 we have 3 leds. I need help making the leds working.

Working on version 14 and almost ready. Need help for leds.

Also if anyone wants to make patches and include support in main openwrt may contact me.

All these versions you can flash direct from original tp-link software.

I still can not make working flash to return from openwrt to original on versions 6,6.2,14


tmomas you are right there is not much free space.
The design of jffs2 about space is the following line:

if (c->flash_size < 5*c->sector_size) {

This means that if you have lower than 5 free block jffs will not create free space partition. So after you make some setup like wifi or passwords they will be lost on router restart.
If I am not wrong one block is 32K. So i decided i do not need so much free space and changed that 5 to 3.
The modifications are in files:

This gives me 96K free space. This is enough for me for many things :slight_smile:

I still need help for led pins to make the working correct on version 6.2

@sanitariu please proved image link free to download they are asking for money.. or you need payment for this

No i do not want money or anything. My image is heavy modified also with other stuff and i can not share it :frowning: I explained all steps i did. If i have enough time tomorrow i will make image.
What router you have exactly ? Look backside. What you need luci ? Ipv6 ?

Looking at openwrt/include/ reveals

JFFS2_BLOCKSIZE ?= 64k 128k


TARGET_FILESYSTEMS := $(fs-types-y)

FS_64K := $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-64k
FS_128K := $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-128k
FS_256K := $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-256k

so you might want to check the 32k assumption.

I agree that with 3 erase blocks available that minimal configuration can be performed. At least as far as I understand jffs, one always needs one "free" erase block, so a three-block configuration can only handle two blocks' of content before it becomes unusable for write.

1 Like

@sanitariu i have Tp-Link 840N(EU) Ver 6. i need with only luci. no need for ipv6 i din't need. i want to use it as a AP not anything else.
@sanitariu you share all steps i know but i am not a tec guy so that i can perform all steps. please make sysupgrade image for me.

Ok i did 2 images. One is for tftp other is sysupgrade and should work direct from original.
I used OpenWrt SNAPSHOT, r9014-ef1efa756e. Luci and removed ipv6.
There is 92K free space. I can make working ipv6 too but need more time.
Where i can share files ?

1 Like

bundle of thanks dear @sanitariu. plz share with google drive. dropbox. or we transfer...

This is for tp-link 840 version 6
Note: After flashing you can not go back to original firmware.


@sanitariu thanks alot wilk try soon and feedback. thanks

@sanitariu thank the image provided is working perfect
thanks alot.

@sanitariu is there any toturial for making own hardware version specific build.

You can start by reading this thread again.

i flashed the router and working fine but getting a problem whenever i flashed it get ip from my pfsense server and shows ip in dhcp leases but i am unable to access through showed ip. so i need to go to router physically and have to connect the router to laptop directly to configure. IMG_20190113_163942

This is not linux support. Maybe you need to redirect ports etc i do not know.....
And actually i do not like pfsense at all :slight_smile: It makes much stupids.

1 Like