Support for TL-WR840N Ver 6.0

Im using your build and things runs great!, thanks man I hope to see another update on this.
ps: mine is TL-WR840N V6.2

Hello all,

I'm new in the forum and newbie with OpenWrt.
I'd like to know if anyone have the factory.bin ready to upload to router wr840n V6 (BR).
As @gaspare explain, the wr840n V6 (BR) is a MEDIATEK MT7628NN, with 4M of flash and 32M of RAM.

Thanks

Thanks ! It's working very well on my TL-WR840N v6.2 with your binary.

I tried to compile it myself but the target device strangely doesn't show up on make menuconfig (there are no TL-WR840N targets available at all).

Also, file 02_network access is forbidden.

Hello,
You need 02_network in order for the router switch to work correct.
Add:

    tplink,tl-wr840n-v6|\
    tplink,tl-wr840n-v6.1|\
    tplink,tl-wr840n-v6.2|\

after tplink,tl-wr840n-v5|\

on both places.
If you want to compile alone you must add/patch all the files and remove a lot of stuff
because space is not enough.
I think you should select tiny targets.
If you clone latest git you must change wifi encryption type to be old one. (no space)

1 Like

any chance you have build with IPv6 removed?

If you do not want ipv6 just remove it via uci.

Hello!

Thanks for the very helpful guide!
I've managed to build OpenWRT 19.07 for v6.2 with your guide, however the leds don't work properly (only first led lighting up), is there any way to fix this? I've slightly modified the dts to make it build.

Edit: led problem fixed, used gpios from https://github.com/milankragujevic/openwrt-wr840n-v620-old/blob/master/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v6.dts

/dts-v1/;

#include "mt7628an.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "tplink,tl-wr840n-v6.2", "mediatek,mt7628an-soc";
	model = "TP-Link TL-WR840N v6.2";

	aliases {
		led-boot = &led_power_orange;
        led-failsafe = &led_power_green;
        led-running = &led_power_green;
        led-upgrade = &led_power_orange;
	};

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio1 38 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};

	/* LED used is dual-color,dual lead LED */
    leds {
        compatible = "gpio-leds";

        lan {
            label = "green:lan";
            gpios = <&gpio1 39 GPIO_ACTIVE_LOW>;
        };

        wlan {
            label = "green:wlan";
            gpios = <&gpio1 44 GPIO_ACTIVE_LOW>;
        };

        led_power_green: power {
            label = "green:power";
            gpios = <&gpio1 42 GPIO_ACTIVE_HIGH>;

        };

        led_power_orange: wan {
            label = "orange:wan";
            gpios = <&gpio1 40 GPIO_ACTIVE_HIGH>;
        };
    };
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "boot";
				reg = <0x0 0x10000>;
				read-only;
			};

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

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

&ehci {
	status = "disabled";
};

&ohci {
	status = "disabled";
};

&wmac {
	status = "okay";
	mtd-mac-address = <&factory 0xf100>;
};

&ethernet {
	mtd-mac-address = <&factory 0xf100>;
    mtd-mac-address-increment = <1>;
};

&esw {
    mediatek,portmap = <0x3e>;
};

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			ralink,group = "p1led_an", "p3led_an", "p4led_an", "wled_an", "perst", "wdt";
			ralink,function = "gpio";
		};
	};
};

Also, would it be fine to post the clone with your files via GitHub? Thanks in advance.

Hello,
Post the clone no problem ! Even if you have time create official patches. Thank you :slight_smile:

2 Likes

kindly share your build, im not familiar with compiling stuff, thanks

Will send in a few days or so, it's currently running with luci, SQM and zram, with IPv6 & PPPoE completely removed. It still tends to run out of memory with SQM turned on with around 10 DHCP leases on it, so ill need to tweak a few of sysctl/zram settings a bit.

2 Likes

fantastic, thank you so much mate, really appreciate it.

Feel free to try. Mine's currently running for 2 days now with SQM turned on, with about 4mb still free on ram.

sysupgrade: https://www.dropbox.com/s/185otrdv7rjph02/openwrt-ramips-mt76x8-tplink_tl-wr840n-v6.2-squashfs-sysupgrade.bin?dl=1
tftp-recovery: https://www.dropbox.com/s/dot2666znxltb1n/openwrt-ramips-mt76x8-tplink_tl-wr840n-v6.2-squashfs-tftp-recovery.bin?dl=1

2 Likes

thank you so much, i'll report later for the result

so far so good, no random reboot after 20hrs+ usage with 5+ clients

Hostname WR840N_V6.20
Model TP-Link TL-WR840N v6.2
Architecture MediaTek MT7628AN ver:1 eco:2
Firmware Version OpenWrt 19.07.7 r11306-c4a6851c72 / LuCI openwrt-19.07 branch git-21.044.30835-34e0d65
Kernel Version 4.14.221
Local Time 2021-05-04 09:52:25
Uptime 22h 38m 54s
Load Average 0.71, 0.81, 0.67

1 Like

That's nice. Weirdly enough mine occasionally does random reboots after flashing and not doing a power cycle. I'm still trying to make this somewhat actually useable (will post updates here), as the kernel logs keep warning me about running out of memory, which is still better than completely locking up until I power cycle it (based on my previous tests), though that shouldn't affect much on usability.

ah, fortunately mine working just fine and it's rock solid for 2days

FYI: im not using SQM since im limiting bw from router

Does the system logs say anything about page allocation failure?

how to view system log?

Status > System log

nothing found about page allocation failure

for complete log i put it in here https://pastebin.com/MpsvDEyR