{"id":18858031,"url":"https://github.com/kvbc/openwrt-tlwr841nv14","last_synced_at":"2025-09-03T17:32:47.197Z","repository":{"id":251366056,"uuid":"837198925","full_name":"kvbc/openwrt-tlwr841nv14","owner":"kvbc","description":"Guide detailing instructions for installing OpenWRT firmware (w/ optional SQM) on, building a custom OpenWRT firmware image for, configuring and factory firmware recovery for TP-Link WR841N(D) v14 on a Windows machine.  ","archived":false,"fork":false,"pushed_at":"2024-09-30T05:01:19.000Z","size":16222,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T04:09:22.684Z","etag":null,"topics":["guide","openwrt","tl-wr841n","tl-wr841nd","tp-link","tp-link-wr841n","tp-link-wr841nd"],"latest_commit_sha":null,"homepage":"https://openwrt.org/toh/tp-link/tl-wr841nd","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kvbc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-02T12:27:19.000Z","updated_at":"2024-10-25T17:48:14.000Z","dependencies_parsed_at":"2024-08-02T14:37:20.298Z","dependency_job_id":null,"html_url":"https://github.com/kvbc/openwrt-tlwr841nv14","commit_stats":null,"previous_names":["kvbc/openwrt-tlwr841nv14"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvbc%2Fopenwrt-tlwr841nv14","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvbc%2Fopenwrt-tlwr841nv14/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvbc%2Fopenwrt-tlwr841nv14/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvbc%2Fopenwrt-tlwr841nv14/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvbc","download_url":"https://codeload.github.com/kvbc/openwrt-tlwr841nv14/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231907804,"owners_count":18444185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["guide","openwrt","tl-wr841n","tl-wr841nd","tp-link","tp-link-wr841n","tp-link-wr841nd"],"created_at":"2024-11-08T04:09:37.600Z","updated_at":"2025-09-03T17:32:47.183Z","avatar_url":"https://github.com/kvbc.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# TP-Link WR841N(D) v14 OpenWRT Windows Guide\n\nThis guide details instructions for installing OpenWRT firmware (w/ optional SQM) on, building a custom OpenWRT firmware image for, configuring and factory firmware recovery for TP-Link WR841N(D) v14 on a Windows machine.  \nThis guide can be somewhat followed with a Linux machine, but does **not** cover the TFTP recovery process on Linux.\n\nIf you're looking to buy this model solely for OpenWRT, I can wholeheartedly **NOT** recommend it outside of educational/experimental purposes.\n\n\u003c!-- Full back image: https://static.tp-link.com/TL-WR841N_EU_14.0_03_normal_1524475432652f.jpg --\u003e\n\nFront | Back\n:---: | :--:\n![](https://static.tp-link.com/TL-WR841N_EU_14.0_01_normal_1524475416205s.jpg) | ![](img/router-back-panel.PNG)\n\n## Resources\n\n- See [OpenWRT forum topic on this guide](https://forum.openwrt.org/t/tp-link-wr841n-d-v14-installation-custom-image-configuration-and-factory-firmware-recovery-guide/206030)\n- See [OpenWRT on SQM](https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm)\n- See [OpenWRT device page](https://openwrt.org/toh/tp-link/tl-wr841nd)\n- See [Wikipedia on Bufferbloat](https://en.wikipedia.org/wiki/bufferbloat)\n- See [OpenWRT on enabling Wi-Fi](https://openwrt.org/docs/guide-quick-start/basic_wifi)\n- See [OpenWRT on Wi-Fi configuration](https://openwrt.org/docs/guide-user/network/wifi/basic)\n- See [OpenWRT on SQM configuration](https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm_configuration)\n\n## Installing OpenWRT firmware into the router\n\nThis very specific model is not officially supported by OpenWRT.  \nOn top of that, it's one of the so called *4/32* (4MB Flash, 32MB RAM) devices, which are very limiting in terms of both space and performance, and generally not supported/maintained anymore.  \nThis can potentially result in unwanted instability and you bricking your router. See [OpenWRT 4/32 warning](https://openwrt.org/supported_devices/432_warning).\n\nWhat if you *really* want OpenWRT installed on this router?  \nIf you're just looking to get all the basic packages (w/ optional SQM), look at the available OpenWRT firmware disk images from the `files` directory under this repository.  \nOtherwise, if you want a custom configuration and/or additional packaged installed, as this specific hardware version (v14) is not officially supported, there's no pre-built OpenWRT firmware disk images available to download.  \nMeaning, you will have to build your own image from scratch, using the old OpenWRT imagebuilder with all possible space saving measures.  \n\n### Building the OpenWRT firmware disk image\n\nIt is required to build the image in a Linux environment.  \n(It's said to be possible in WSL, but I could not get it to work and it's not officially supported by OpenWRT).  \nIf you're on a linux PC, you're lucky. Otherwise, you have to download a VM.  \n\n#### Linux Distro\n\nAs for the linux distribution, I will be using Fedora. Any other linux distro should work as well.  \nIt's important to use a distro version from 2022 (same release date as OpenWRT v19.07), as any older or newer versions may fail the building process (I learned it the hard way).  \nI will be using version 33 ([Download](https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/33/Workstation/)), released 2021\n\n#### VM\n\nIn this guide, I will be using [Oracle VirtualBox](https://www.virtualbox.org/).  \nAfter successfully installing both VirtualBox and your linux distro, open VirtualBox and create a new VM.\n\n![](img/vm-new.PNG)\n\nAfter doing that, make sure to set the type to `Linux` and select the appropriate version.\n\n![](img/vm-new-1.PNG)\n\nNext, set your preferred RAM. Minimum of 4GB is recommended.  \nCreate a new VDI virtual hard disk.  \n**Make sure that the disk size is at least 32GB**. I'm not exactly sure how much is necessary at minimum, but I know for a fact that 16GB, yet alone the default 8GB, is not enough...\n\n![](img/vm-new-2.PNG)\n\nNow that the machine has been created, navigate to its settings.  \nSet `General \u003e Advanced \u003e Shared Clipboard` to `Bidirectional`. This will help a ton.  \n\n![](img/vm-settings-1.PNG)\n\nFor the ease of use and faster compilation speeds, it is also recommended to, if possible, increase the number of CPUs.  \nNavigate to `System \u003e Processor \u003e Processor(s)`\n\n![](img/vm-settings-3.PNG)\n\nNext, increase the amount of Video Memory to at least **64MB** for fluidity.  \nNavigate to `Display \u003e Screen \u003e Video Memory`\n\n![](img/vm-settings-4.PNG)\n\nMake sure your network adapter is attached to *NAT*.\n\n![](img/vm-settings-5.PNG)\n\nNext, you must create a shared folder to later transfer firmware disk images between your host PC and the VM.\n\n![](img/vm-settings-6.PNG)\n\nName it `openwrt` and set it to automatically mount on boot.\n\n![](img/vm-settings-7.PNG)\n\nThat's all for the settings.  \nNext, assign your downloaded distro image to the optical drive.  \n\n![](img/vm-cd.PNG)\n\nNow start the machine.  \n\nIn case of Fedora, after the booting process you should be prompted to install the system into the hard drive.  \nDo that and make sure to remove the `.iso` image from the optical drive once it's done installing.  \nBoot up the machine once again.\n\n#### Installing build system prerequisites\n\nOn Fedora, run:\n\n```\nsudo dnf --setopt install_weak_deps=False --skip-broken install \\\nbash-completion bzip2 gcc gcc-c++ git make ncurses-devel patch \\\nrsync tar unzip wget which diffutils python2 perl-base \\\nperl-Data-Dumper perl-File-Compare perl-File-Copy perl-FindBin \\\nperl-IPC-Cmd perl-JSON-PP perl-Thread-Queue perl-Time-Piece \\\ngawk gettext zlib-devel openssl-devel libxslt \\\n@c-development @development-tools @development-libs zlib-static perl\n```\n\nSee [OpenWRT build system setup](https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem) for other distros.\n\n#### Installing the repository\n\nNow we must download the OpenWRT repository from github.  \nNewer versions of OpenWRT are not viable for 4/32 devices.  \nThe latest possible version we can use is v19.07 (2022).  \nSee [OpenWRT on 4/32 devices](https://openwrt.org/supported_devices/openwrt_on_432_devices).  \nThe v19.07 repo, however, does not provide official support for v14 hardware as well.  \nAs explained in the [device page](https://openwrt.org/toh/tp-link/tl-wr841nd) under section \"Supported Versions\", we must apply a very specific patch to an 19.07.9 repo to add v14 hardware support.\n- Patch: https://openwrt.org/_media/media/tplink/tl-wr841/19.07-wr841nv14-wr840nv62.zip\n- Commit: https://github.com/openwrt/openwrt/pull/1577 (minimal .config provided)  \n*Everything is possible only thanks to this guy*\n\nOpen your terminal and execute the following commands:\n\n```\ngit clone https://github.com/openwrt/openwrt --branch v19.07.9\nwget https://openwrt.org/_media/media/tplink/tl-wr841/19.07-wr841nv14-wr840nv62.zip\nunzip 19.07-wr841nv14-wr840nv62.zip\ngit apply 19.07-wr841nv14-wr840nv6.2.patch\n```\n\nNow navigate to the the `openwrt` directory with `cd openwrt`\n\n#### Initializing the repository\n\n1. Run `./scripts/feeds update -a` to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default\n2. Run `./scripts/feeds install -a` to install symlinks for all obtained packages into package/feeds/\n\n#### Configuring the build\n\nRun `make menuconfig` in order to enter the configuration menu.\n\nSelect:\n- **Target System**: MediaTek Ralink MIPS\n- **Subtarget**: MT76x8 based boards\n- **Target Profile**: TP-Link TL-WR841N v14\n\nSelect additional packages to install as you wish.  \nYou cannot later install packages with opkg, as you're going to be using a custom-built image.  \nPackages must be built into the image.\n\nIn order to mark additional packages for installation, we must first make enough space for them.  \nSaving space is all about:\n- Disabling as many unwanted packages, kernel modules and settings as you can.\n- Building kernel modules into the image\n- Modifying build configuration variables\n\nIn many cases, you must sacrifice some performance for the sake of flash size.  \nI myself could not really do any of the above, as it resulted in the router not working at all (see [General Problems](#general-problems)).  \nBut if you want to give it a try or get to know more about the topic, check out the following guide: https://openwrt.org/docs/guide-user/additional-software/saving_space\n\n#### Building\n\nThe building process requires internet connection.\n\nIn order to start the build, navigate to the `openwrt` directory and run `make`.  \nIf any errors pop up (let's hope not), rerun the build with the `make -j1 V=sc` command in order to see the error messages.  \nIf you think you have fixed the error, run the build process again without the verbosity (i.e. just `make`).  \nConsole logging can slow down the build process.\n\n### Transferring the built OpenWRT image into the host PC\n\nAfter the built process has finished (which for me took a couple of hours), you can find the built OpenWRT image at `bin/targets/ramips/mt76x8/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14-squashfs-tftp-recovery.bin` under your `openwrt` directory.\n\nNow copy the image to the shared folder.\n```\ncp bin/targets/ramips/mt76x8/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14-squashfs-tftp-recovery.bin /media/sf_openwrt/tl-wr841n-v14-openwrt.bin\n```\n\nYou can close the Virtual Machine and access the built image by navigating to the shared folder in your host PC.\n\n### Installing the OpenWRT firmware onto the router\n\nWith recent versions of this model, you cannot upgrade to third-party firmware from the tp-link web interface.  \nYou must do it through TFTP. Install the [tftpd64](https://pjo2.github.io/tftpd64/) TFTP server.\n\nCreate a new folder and copy the built OpenWRT image into it.  \nRename the image to `tp_recovery.bin`\n\nNext, change your IP address to `192.168.0.66/24`.  \nThis can be achieved by opening up `Control Panel \u003e Network and Internet \u003e Network and Sharing Center \u003e Change adapter settings \u003e Double-click your selected adapter \u003e Properties \u003e IPv4`.  \nLater, after the installing process is finished, you can change the IP address back to automatic (DHCP).\n\nNow you can open up the installed TFTP server, tftpd64.  \nChange the current directory to the freshly creater folder with the built OpenWRT image by clicking *Browse*.\n\n![](img/tftpd64-1.PNG)\n\nNavigate to *Log Viewer* and make sure your server interface is set to your `192.168.0.66` interface.\n\nNow unplug the power connector from your router. Then hold the reset button and, while still holding the button, plug in the power connector and continue holding the reset button until you see the `tp_recovery.bin` file transfer complete in the *tftpd64* log viewer.\n\nYou can now close the *tftpd64* software and change your IP address back to automatic (DHCP).  \nYour router should be up-and-running in upto a minute time.  \nEnjoy your bufferbloat-free experience!\n\n## Configuring the router through SSH\n\nAfter you see the router solid light up the internet LED, you can now access it through SSH.  \nTo do so, run the following command in the *Windows Command Line*:\n```\nssh root@192.168.1.1\n```\n\nNow, you have full root access to your router and can do whatever you want.\n\nHere's an example script that I run on every reboot to initialize SQM and wireless routing.\n\n```sh\n# Wireless\nuci set wireless.radio0.country='PL'\nuci set wireless.radio0.disabled='0'\nuci set wireless.default_radio0.ssid='TP-Link_E013'\nuci set wireless.default_radio0.wmm='1' # allows 802.11n\nuci commit wireless\nwifi reload\n\n# Firewall\nuci set firewall.@defaults[0].flow_offloading='0'\nuci set firewall.@defaults[0].flow_offloading_hw='0'\nuci commit firewall\nservice firewall restart\n\n# SQM\nuci set sqm.eth1.enabled='1'\nuci set sqm.eth1.interface='eth0.2' # WAN\nuci set sqm.eth1.download='5000'\nuci set sqm.eth1.upload='2000'\nuci set sqm.eth1.qdisc='cake'\nuci set sqm.eth1.script='piece_of_cake.qos'\nuci set sqm.eth1.linklayer='ethernet'\nuci commit sqm\nservice sqm restart\n```\n\nDue to my low internet speeds and constant load (lots of devices), I prefer SQM (without flow offloading, as it doesn't work well together).  \nMy network statistics:\n```\ntp-link:\n- speedtest    : 18ms, dl 2.54Mbps, ul 2.81Mbps\n- bufferbloat  : unloaded 70ms, loaded: dl 2.32Mbps +636ms, ul 995Kbps +138ms =\u003e (F)\n- in-game ping : 45-60ms\n\nopenwrt (clean):\n- speedtest    : 16ms, dl 3.12Mbps, ul 2.19Mbps\n- bufferbloat  : unloaded 18ms, loaded: dl 2.83Mbps +936ms, ul 2.85Mbps +187ms =\u003e (F)\n- in-game ping : 30-35ms\n- wifi         : 32ms, dl 3.31Mbps, ul ?\n\nopenwrt (sw\u0026hw offloading):\n- speedtest    : 16ms, dl 3.80Mbps, ul 3.17Mbps\n- bufferbloat  : unloaded 40ms, loaded: dl 3.36Mbps +550ms, ul 2.84Mbps ?ms =\u003e (F)\n- in-game ping : 30-35ms\n- wifi         : 180ms, dl 2.57Mbps, ul ?\n\nopenwrt (sw\u0026hw offloading, sqm):\n- speedtest    : 16ms, dl 4.32Mbps, ul 2.10Mbps\n- bufferbloat  : unloaded 36ms, loaded: dl 2.99Mbps +427ms, ul 1.31Mbps +49ms =\u003e (F)\n- in-game ping : 50-60ms\n- wifi         : 29ms, dl 2.61Mbps, ul ?\n\nopenwrt (sqm):\n- speedtest    : 18ms, dl 3.46Mbps, ul 1.48Mbps\n- bufferbloat  : unloaded 43ms, loaded: dl 3.03Mbps +297ms, ul 1.92Mbps +78ms =\u003e (D)\n- in-game ping : 30-35ms\n- wifi         : 21ms, dl 2.11Mbps, ul ?\n```\n\n## General Problems\n\nIn my case, OpenWRT doesn't save any configuration files (or any files really for that matter) after rebooting.  \nAll changes made to all the files are gone, as if I ran a factory-reset and everything was saved in RAM.\n\nDuring the building process, it is advised by OpenWRT to run everything without root access.  \nDespite that, with every command, I've gotten *access denied* errors.  \nThis led me to run every command with `sudo`.  \nThe Makefile didn't let that slide and threw an error to not use root privilages.  \nIn order to ignore that error and grant all access permissions to the `openwrt` directory, you can run\n```bash\nexport FORCE_UNSAFE_CONFIGURE=1\nchmod -R 777 openwrt\n```  \n\nDisabling the firewall service with either `fw3 stop`, `service firewall stop` or `opkg remove firewall` results in no internet connection (even without SQM enabled)?\n\nCould not get the space-optimized build to work:\n- See [files/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14-squashfs-tftp-recovery-sqm-optimized.bin](files/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14-squashfs-tftp-recovery-sqm-optimized.bin)\n- See [OpenWRT on saving space](https://openwrt.org/docs/guide-user/additional-software/saving_space)\n- The final built image did not seem to get any lighter in size?\n\n## Restoring back to factory firmware\n\nRestoring back to factory firmware should be as easy as downloading the latest firmware image from [the official tp-link website](https://www.tp-link.com/no/support/download/tl-wr841n/#Firmware) and going through the exact same process as installing OpenWRT firmware into the router through TFTP.  \nBut it is not, as you must obtain a stripped (not boot) factory firmware image.  \nIn order to do that, you can either strip it yourself, or download one from the `files` directory under this repository (only PL versions available, not really legal but should work).\n\nTo strip it yourself, download the factory boot firmware image from tp-link and move it into the shared VM folder.  \nName the image `boot.bin` and run your linux VM to execute the following command in the terminal:\n```\ncd /media/sf_openwrt\ndd if=boot.bin of=stripped.bin skip=1 bs=512\n```\nNow you can close the VM.\n\nFollow the same instructions as with installing an OpenWRT image, instead using the stripped `stripped.bin` image located in your shared folder.  \nAt the end of this process, your router should be back to its factory firmware, with all its glory!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvbc%2Fopenwrt-tlwr841nv14","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvbc%2Fopenwrt-tlwr841nv14","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvbc%2Fopenwrt-tlwr841nv14/lists"}