Building OpenWrt for TP-Link WR840N(EU) v6.20 (Instructions)

Building OpenWrt for TP-Link WR840N(EU) v6.20 (Instructions)

Comments 30

DISCLAIMER: These instructions are provided in good faith, but the author does not guarantee the outcome, and is not responsible for any damage to you, your device, or anything else. The instructions were tested, but your mileage may vary.

Notice: This will build the image without LuCI, which is not supported because of the low RAM and Flash on this model. For more details see: this page.

You can log in to the router from a LAN port using ssh [email protected] with no password. Set a password with passwd root.

sudo apt update
sudo apt upgrade -y
sudo apt install -y build-essential libncurses5-dev python unzip python3-distutils
git clone https://github.com/milankragujevic/openwrt-wr840n-v620 openwrt/
cd openwrt

./scripts/feeds update -a
./scripts/feeds install -a

make menuconfig

Select MediaTek Ralink MIPS as Target System, MT76x8 based boards as Subtarget and TL-WR840N v6.20 as Target Profile. Choose Save then press Enter twice. Then select Exit.

To build, run these commands (replace 4 with the number of cores/threads on your computer. )

make download -j4
make -j4

In case of problems, remove -j4 and re-run make.

The output file is in ./bin/targets/ramips/mt76x8.

1
❤️
0
👍
0
😲
0
😢
0
😠
1

Comments (30)

Please be civil when commenting. Think before writing, don't spam, self promote, bully, harass or harm anyone. Please read the Comment Policy before posting. Comments are moderated.
See all 30 comments

ivan pena

ivan pena

Could you share the imagebuilder for wr840n v6.20(EU)?

or the SDK preferably

Thanks

Reply · 1 month ago · #813

Milan Kragujević

...replying to ivan pena

Milan Kragujević Admin

Hi Ivan,

Sadly, no, as I don't have time to setup the environment again for this.

If I ever do build the imagebuilder, I'll leave a comment here and you'll get an email notification.

Regards,
Milan

Reply · 4 weeks ago · #816

Rajaboina pavan kumar

Rajaboina pavan kumar

I tried Building Firmware for Tp link Tl-WR840N v6.20 in Ubuntu and Kali Linux from above Instructions, But upon reaching “make menuconfig” command I cannot find wr840n v6.20 (not even wr840n v6) in config file. If anybody in this group had sucess with firmware Build please share me. Thanks in advance

Reply · 11 months ago · #444

Ronald Rivera

Ronald Rivera

Thanks Milan. That's works, I use a docker ubuntu image to build OpenWrt and use tftpd to lunch the firmware.

Reply · 1 year ago · #390

Alexandr

Alexandr

What OS did you use to build the image?

Reply · 1 year ago · #379

Testbud

Testbud

Is this patched with original Meditek original 7628 drivers for stability speed and performance?

Reply · 1 year ago · #378

zicon

zicon

Hi. I have restored the original firmware from tftpd, but I cannot log in to the router using SSH because it requires a password. What is the default password, how can I recover it? Is your ready firmware OpenWrt for WR840N (EU) v6.20 somewhere available in the bin file?

Reply · 1 year ago · #376

bagus

bagus

Error like this sir :(
plan to compile for my v6

[email protected]:~/Downloads/openwrt-wr840n-v620$ make -j 5

WARNING: Makefile 'package/feeds/packages/apache/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/telephony/asterisk-16.x/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/bcm27xx-eeprom/Makefile' has a dependency on 'bcm27xx-userland', which does not exist

WARNING: Makefile 'package/feeds/packages/frr/Makefile' has a dependency on 'more', which does not exist

WARNING: Makefile 'package/feeds/packages/gnunet/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/gnunet/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/gnunet/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/jose/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/telephony/kamailio-5.x/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/telephony/kamailio-5.x/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/libsearpc/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/network/utils/nftables/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/python3/Makefile' has a dependency on 'ca-certs', which does not exist

WARNING: Makefile 'package/feeds/packages/samba4/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/seafile-ccnet/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/seafile-server/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/seafile-server/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/sqm-scripts/Makefile' has a dependency on 'kmod-sched-cake-oot', which does not exist

WARNING: Makefile 'package/feeds/packages/stubby/Makefile' has a dependency on 'ca-certs', which does not exist

WARNING: Makefile 'package/feeds/packages/ulogd/Makefile' has a dependency on 'jansson', which does not exist

WARNING: Makefile 'package/feeds/packages/yara/Makefile' has a dependency on 'jansson', which does not exist

make[1] world

make[2] tools/compile

make[2] package/cleanup

make[3] -C tools/flock compile

make[3] -C tools/xz compile

make[3] -C tools/sed compile

make[3] -C tools/patch compile

make[3] -C tools/tar compile

make[3] -C tools/m4 compile

make[3] -C tools/pkg-config compile

make[3] -C tools/expat compile

make[3] -C tools/patch-image compile

make[3] -C tools/sstrip compile

make[3] -C tools/scons compile

make[3] -C tools/mtools compile

make[3] -C tools/lzma compile

make[3] -C tools/zip compile

make[3] -C tools/autoconf compile

make[3] -C tools/libressl compile

make[3] -C tools/automake compile

make[3] -C tools/missing-macros compile

make[3] -C tools/cmake compile

make[3] -C tools/libtool compile

make[3] -C tools/mkimage compile

make[3] -C tools/dosfstools compile

make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on

make: *** [/home/bagus/Downloads/openwrt-wr840n-v620/include/toplevel.mk:218: world] Error 1

Reply · 1 year ago · #374

mthoodlum

mthoodlum

Lots of errors related to jansson not existing.

Reply · 1 year ago · #352

Flo

Flo

Dear Milan, thanks for the howto, it worked perfectly. One thing, on the try to install Luci from the terminal, once inside the router, it gives me a dependencies conflict about the kernel version, and can't install. Looks like building openwrt from a snapshot is quite volatile. How to set up a stable build version ( instead of a snapshot version? If possible, what I need to modify? Thnx for your patience.

Reply · 1 year ago · #348

Milan Kragujevic

...replying to Flo

Milan Kragujevic Admin

Hi Flo,

you would have to manually cherry-pick my changes and make the same changes in a release branch.

You can see my changes in the repo on Github, see commits by @milankragujevic.

I'll try to reintegrate newest snapshot changes into my fork, so that you can compile it right now. I don't have time right now to make the changes in a release branch, especially since I don't have the router model anymore, but I can at least help you get it working right away.

Check back on the github page to see if I have merged the commits, then retry.

Sorry I couldn't be of more help.

Regards,
Milan

Reply · 1 year ago · #349

Andy Syam

Andy Syam

hi I tried to make it in LEDE, what files do I need for wr840n v6, I mean what files do I need to get for wr840 v6?

Reply · 1 year ago · #215

Milan Kragujevic

...replying to Andy Syam

Milan Kragujevic Admin

Hi, LEDE is 2-3 years old at this point, there is absolutely no reason to use such an old version of the software, it has merged back into OpenWRT in 2018. Also, it will not work on V6.20, and I do not give support for V6 in any case on this post. There have been many changes to ramips between LEDE 17.01 and OpenWRT 19.07. I do not recommend doing that, and I do not provide any support. No further discussion on this topic will be had.

Reply · 1 year ago · #216

Andy Syam

...replying to Milan Kragujevic

Andy Syam

thank you for replying, there are more questions for you, can I implement this on OpenWrt 19.07 and what do I need to copy to OpenWrt 19.07? I want to make ROM support 16MB flash

Reply · 1 year ago · #217

Milan Kragujevic

...replying to Andy Syam

Milan Kragujevic Admin

You can find more info here: https://forum.openwrt.org/t...

I can't help you with upgrading the ROM chip. Also, don't forget to backup the old chip in whole before upgrading!

Reply · 1 year ago · #218

Andy Syam

...replying to Milan Kragujevic

Andy Syam

it looks like it's not for v.6.20 but for v6.0 and in your repo the ramips.sh file doesn't exist and will cause a brick router

Reply · 1 year ago · #220

Milan Kragujevic

...replying to Andy Syam

Milan Kragujevic Admin

Both of your statements are incorrect. Well, semi-incorrect.

1. It is for v6.20, this commit: https://github.com/milankra... changed the name from v620 to v6 because there was an issue with the build system with "v620". The code stayed the same, it could have said "v99" and it would still work, that is just a cosmetic thing. In any case I know which device I wrote it for and which device it works with.
2. ramips.sh has been deleted and is obsolete since July 3rd 2019. Here's the related commit by Adrian: https://github.com/openwrt/...
3. Nothing can brick a TP-Link router, the worst case is you restore to original ROM with TFTP. In any case, if the build is done properly, it will work.

Next time check your claims before wasting 10 minutes of my time.

Reply · 1 year ago · #221

Andy Syam

...replying to Milan Kragujevic

Andy Syam

it's different between Atheros and Mediatek how to upgrade ROM

Reply · 1 year ago · #219

Milan Kragujevic

...replying to Andy Syam

Milan Kragujevic Admin

Well obviously, yes. I am not obliged to and in any case don't provide support for anything, especially not replacing the ROM chip. The link for Atheros I sent is just an example, if someone is willing to go to such lengths as replacing a ROM chip, they are absolutely assumed to have the knowledge to do so. Any failure to properly research, or implement the "upgrade" is fault of themselves only.

Just buy another router if you need >4MB Flash, it's easier.

Reply · 1 year ago · #222

gobi

gobi

can I connect the router to wpa2-enterprise AP, after flashing this? (WISP or Range extender mode, doesn't matter). In default firmware there's no possibility to chose PEAP authentication

Reply · 1 year ago · #201

Dmitry

Dmitry

Hello. Installed in v6.20 8 mb flash. What needs to be changed in the config files for compiling firmware for 8 mb flash?

Reply · 1 year ago · #175

Milan Kragujevic

...replying to Dmitry

Milan Kragujevic Admin

That is not a supported configuration, and I cannot help you.

Reply · 1 year ago · #176

Stas Kr

Stas Kr

So V6 is equal V6.20?

Reply · 1 year ago · #173

Milan Kragujevic

...replying to Stas Kr

Milan Kragujevic Admin

In my fork of the repository YES. However, DO NOT flash original firmware from v6.20 on v6 or vice versa. They are different subtly, but OpenWRT does not have problems with that. Also TFTP recovery process for v6.20 and v6 is different (v6.20 is new process, v6 is old process; the same as all TP-Links from years before).

Reply · 1 year ago · #174

Stas Kr

Stas Kr

Hi. In menuconfig Target Profile I see only TL-WR840N v6 not V6.2. Can You explain me why?

Reply · 1 year ago · #171

Milan Kragujevic

...replying to Stas Kr

Milan Kragujevic Admin

Yes. There is a problem with the build system if I call the file v6.20, so I have shortened the name. It should still work if everything you do is correct. If you fail, you can always restore with TFTP, here's a guide: https://milankragujevic.com...

Reply · 1 year ago · #172

Stas Kr

Stas Kr

Hi. In menuconfig Target Profile I see only TL-WR840N v6 not V6.20. Can You explain me why?

Reply · 1 year ago · #170

Romi Syahputra

Romi Syahputra

please creat video

Reply · 1 year ago · #168

Milan Kragujevic

...replying to Romi Syahputra

Milan Kragujevic Admin

No.

Reply · 1 year ago · #169


Scroll to top