OpenWrt Forum Archive

Topic: TP-Link TL-WR841N(D) Extended Build [v3,v5,v7,v8,v9]

The content of this topic has been archived between 30 Mar 2018 and 27 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Try installing with –force-depends to ignore the dependencies (which don't seem to be relevant anyway, just some minor kernel version change).

It fails for lack of disk space, I believe:

root@openwrt:~# opkg install ppp-mod-pptp -force-depends
Installing ppp-mod-pptp (2.4.7-5) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/ppp-mod-pptp_2.4.7-5_ar71xx.ipk.
Installing kmod-pptp (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-pptp_3.18.11-1_ar71xx.ipk.
Installing kmod-gre (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-gre_3.18.11-1_ar71xx.ipk.
Installing kmod-iptunnel (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-iptunnel_3.18.11-1_ar71xx.ipk.
Installing kmod-mppe (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-mppe_3.18.11-1_ar71xx.ipk.
Installing kmod-crypto-sha1 (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-crypto-sha1_3.18.11-1_ar71xx.ipk.
Installing kmod-crypto-hash (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-crypto-hash_3.18.11-1_ar71xx.ipk.
Installing kmod-crypto-ecb (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-crypto-ecb_3.18.11-1_ar71xx.ipk.
Installing kmod-crypto-manager (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-crypto-manager_3.18.11-1_ar71xx.ipk.
Installing kmod-crypto-aead (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-crypto-aead_3.18.11-1_ar71xx.ipk.
Installing kmod-crypto-pcompress (3.18.11-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/kmod-crypto-pcompress_3.18.11-1_ar71xx.ipk.
Installing resolveip (2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/resolveip_2_ar71xx.ipk.
Configuring kmod-crypto-aead.
Configuring kmod-crypto-hash.
Configuring kmod-crypto-pcompress.
Configuring kmod-crypto-manager.
Configuring kmod-iptunnel.
Configuring kmod-gre.
Configuring resolveip.
Configuring kmod-pptp.
Configuring kmod-crypto-ecb.
Configuring kmod-crypto-sha1.
Configuring kmod-mppe.
1 module could not be probed
- ppp_mppe
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for ppp-mod-pptp:
 *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) *     kernel (= 3.18.11-1-317527fb328b694536ee00c07026c22c) * 
 * wfopen: /usr/lib/pppd/2.4.7/pptp.so: No space left on device.
 * wfopen: /etc/ppp/options.pptp: No space left on device.
 * pkg_write_filelist: Failed to open //usr/lib/opkg/info/ppp-mod-pptp.list: No space left on device.
 * opkg_install_pkg: Failed to extract data files for ppp-mod-pptp. Package debris may remain!
 * opkg_install_cmd: Cannot install package ppp-mod-pptp.
 * opkg_conf_write_status_files: Can't open status file //usr/lib/opkg/status: No space left on device.
root@openwrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                  384.0K    320.0K     64.0K  83% /
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    14.3M      1.0M     13.3M   7% /tmp
/dev/mtdblock3          384.0K    320.0K     64.0K  83% /overlay
overlayfs:/overlay      384.0K    320.0K     64.0K  83% /
tmpfs                   512.0K      4.0K    508.0K   1% /dev

Right, it complains about the lack of free space. Then only option is building your own image then.

Thanks for the answers amq.
Can you help me including pptp in the build_script so that it doesn't go over the free space?
(I tried PMing you but I think OpenWRT forums don't have that functionality)

(Last edited by marco_silva85 on 27 Apr 2015, 16:06)

Hello amq ,thank you for this great build for 841n.It's working really well.
Is it possible to add DnsCrypt?

Hi!

Do you have any idea how to modify the reset button?
My intention is to toggle WLAN manually using the WPS/RESET button on front panel.

According to (official) manual
(http://www.tp-link.com/resources/docume … 011002.pdf),
"[...] this button is used for both WPS and Reset function."

According to Wiki
https://wiki.openwrt.org/toh/tp-link/tl-wr841nd
it should be feasible to modify the button action.

Question:
How should I proceed with this?

Ideally I want the following button action:
1. Press and hold the WPS/RESET button (more than 5 seconds) until the
SYS LED becomes quick-flash from slow-flash. Then release the button and
wait the Router to reboot.
2. Press the WPS/RESET button to quickly toggle WLAN on/off.

THX

The next release will be Chaos Calmer stable.

I plan the following extra changes:
- add DNSCrypt
- compile with GCC 5.1

Thanks for this amq, I was able to install with no issues.

Only problem at this point may be that my wireless speed is a  bit slower than with stock. Maybe messing with QoS will help. Have you considered using sqm-scripts instead of qos?

Also, how about adding zram to help with the low memory?

roger_, I would recommend completely disabling QoS, unless you have a clear plan of how to use it and what will it bring. There isn't enough space for SQM. Ragarding low memory, have you experienced it (not taking the first boot into account)?

BTW, I'm thinking of leaving out QoS in the next release. It takes quite a lot of effort to find a space for it (like removing kernel debugging and USB support) and I suspect that not many people are benefiting from it. Those of you who are - don't be shy to have a say before the stable CC comes out.

(Last edited by amq on 13 Jun 2015, 21:25)

QoS wasn't active in my initial testing and my speeds seem to be stabilizing at around what they were before, so all is (probably) well. I'm compiling my own version now to see if I can fit SQM (which is really the whole point for me), but I didn't think it was much bigger than qos-scripts.

Personally I'd like to have SQM (or at least QoS) since I'm connecting this router to my modem. I think some people (at least me) would appreciate a build with it, perhaps at the expense of OpenVPN, if you were willing smile

My router's already hovering around ~15% available RAM and with only 32 MB this seems like the perfect use-case for zram, doesn't it?

BTW luci-app-watchcat is another useful package you might consider (reboots automatically if your net connection dies). It's about 5 KB.

(Last edited by roger_ on 13 Jun 2015, 21:36)

SQM will definitely fit without OpenVPN and PolarSSL/mbedTLS, but those are the reason why I created my build.

I'll test ZRAM and if it works well I'll include it.

(Last edited by amq on 13 Jun 2015, 21:45)

amq wrote:

I'll test ZRAM and if it works well I'll include it.

I've used ZRAM for years on other devices and never had issues, so it should be fine.

amq wrote:

SQM will definitely fit without OpenVPN and PolarSSL/mbedTLS, but those are the reason why I created my build.

No worries,  probably easier if I roll out my own.

BTW you can save more space by leaving out all the ppp stuff (+ ppp-mod-pppoe, luci-proto-ppp, etc.) if you don't need it.

EDIT: using the image builder (no reghack, minification, etc.) and

make image PROFILE=TLWR841  PACKAGES="luci luci-app-commands luci-app-watchcat zram-swap -ppp -ppp-mod-pppoe -luci-proto-ppp luci-app-sqm"

leaves  about 100 KB free, which is good enough for me smile

(Last edited by roger_ on 13 Jun 2015, 22:33)

AMQ, I look forward for your new build. keep the good work. VPN for me is also the reason I am using yours.
Thanks and Best Regards

Edit: I do not care about QoS, Security > QoS


TL-WR841N v9

(Last edited by 71033 on 14 Jun 2015, 17:45)

I wanted to thank you amq for creating this and labeling your thread so well.(Google made it easy to find)

I had bought a TL-WR841N (V9.3) for $20 and was excited to use it for an all in one VPN since I assumed ddwrt would work on it with VPN.

After I received it, I realized that a 4mb wasn't going to cut it. Luckily, searching for WRa841n+VPN got me here. I was able to change it to your firmware in a matter of minutes and have it up and running. Now the issues is trying to figure out how to configure the VPN; which hasb't gone as smoothly.

Anyone in here had success running this as a secondary router for a VPN? I currently have my primary sitting on a 192.168.0.1/24 acting as a DHCP server. And then I have the WR841n as a secondary router using 10.0.0.1/24 and have it also acting as a DHCP server for the Lan and Wireless(It works anything connected gets an ip and gets out). What I would like to do is have anything that connects through the lan or AP tunneled across my VPN service. I looked at the IPpredator config, but haven't had much luck. I wouldn't have asked but Seeing Ive smashed my head at the config for the last couple days I thought I'd see if any of you have had better luck.

When I get back home I will post my config file.

(Last edited by FluxSine on 17 Jun 2015, 22:48)

Sorry for the Nubie questions I need a little help!

I flash firmware

r45545 tl-wr841n-v9 factory bin

copy and pasted
http://paste.debian.net/168088/ SCRIPT

And I'm getting these error at the end

root@OpenWrt:~#
root@OpenWrt:~# generate_buildenv
-ash: git: not found
-ash: cd: can't cd to openwrt
root@OpenWrt:~/openwrt_build# dl_and_install_feeds
-ash: ./scripts/feeds: not found
-ash: ./scripts/feeds: not found
root@OpenWrt:~/openwrt_build# dl_and_update_config
-ash: make: not found
root@OpenWrt:~/openwrt_build# dl_and_apply_patches
wget: can't open 'package/libs/polarssl/patches/300-disable-record-splitting.patch': No such file or directory
root@OpenWrt:~/openwrt_build# optimize_luci
wget: can't execute 'openssl': No such file or directory
wget: error getting response: Connection reset by peer
wget: short write
-ash: unzip: not found
find: feeds/luci: No such file or directory
find: feeds/luci: No such file or directory
root@OpenWrt:~/openwrt_build# run_make

Help!

Thank you in an advance …

(Last edited by impersonator100 on 11 Jul 2015, 21:12)

Hello amq,

Thank you very much for this build. I installed it and everything just works perfectly.
There is one thing I miss (aside from the many which don't fit into the tiny ram)
and that is an sftp server to allow me to edit config files conveniently.

I tried opkg install openssh-sftp-server, which downloads a 36KB package, but after installing it,
I can't run it. Message, being "-ash: /usr/lib/sftp-server: not found"
Google suggests this is due to a missing library.

I would be very happy I you could tell me how to get it running, or if you just include it in the next build.
Thanks again for your efforts.

Does reghack work? I have tried on some other routers and it seams not to work, and even reghack author says it needs to be updated.

roger_ wrote:

I've used ZRAM for years on other devices and never had issues, so it should be fine.

Can you please explain how do you use ZRAM and what benefit do you see? I tried using zram but it burned out my usb flash drive after one week of usage.

Hi amq,

I just flashed my TPLINK WR841ND v7 router with the firmware you provided on dropbox.

I still cant see OpenVPN enabled on the device. When I goto Services tab there is no OpenVPN setting

Not sure what I am missing. Can you please assist? It still looks like the standard image without VPN. I tried the 30/30/30 trick but no luck.

Which one do i need to flash squashfs-factory.bin or squashfs-sysupgrade.bin.

And how do i run the openvpn from command line i have the client.ovpn how do i ensure all keys and ovpn files are restored ?

I specifically got this router especially for openVPN as it was damn cheap

I got the image flashed on WR841 and openvpn started from command line but cannot get internet connected i know there are some port forwarding to be done and firewall rules changed i tried several things and none seems working , can someone please post what they did do get

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 30:B5:C2:36:20:56
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::32b5:c2ff:fe36:2056/64 Scope:Link
          inet6 addr: fde9:70ea:d3bc::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1838 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1636 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:269021 (262.7 KiB)  TX bytes:894235 (873.2 KiB)

eth0      Link encap:Ethernet  HWaddr 30:B5:C2:36:20:56
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1817 errors:0 dropped:23 overruns:0 frame:0
          TX packets:1549 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:286557 (279.8 KiB)  TX bytes:877774 (857.2 KiB)
          Interrupt:5

eth1      Link encap:Ethernet  HWaddr 30:B5:C2:36:20:57
          inet6 addr: fe80::32b5:c2ff:fe36:2057/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5255 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1675 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:942865 (920.7 KiB)  TX bytes:305488 (298.3 KiB)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:84 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10450 (10.2 KiB)  TX bytes:10450 (10.2 KiB)

pppoe-wan Link encap:Point-to-Point Protocol
          inet addr:172.16.26.22  P-t-P:43.225.161.204  Mask:255.255.255.255
          inet6 addr: fe80::48e8:2cde:9a16:52de/10 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1480  Metric:1
          RX packets:1557 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1409 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:587978 (574.1 KiB)  TX bytes:265468 (259.2 KiB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.32.0.126  P-t-P:10.32.0.125  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:990 (990.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 30:B5:C2:36:20:56
          inet6 addr: fe80::32b5:c2ff:fe36:2056/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:343 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16465 (16.0 KiB)  TX bytes:46658 (45.5 KiB)

When running openvpn

Sat Aug 15 12:42:27 2015 /sbin/ifconfig tun0 10.32.0.126 pointopoint 10.32.0.125 mtu 1500
Sat Aug 15 12:42:27 2015 /sbin/route add -net 185.21.217.10 netmask 255.255.255.255 gw 43.225.161.204
Sat Aug 15 12:42:27 2015 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.32.0.125
Sat Aug 15 12:42:27 2015 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 10.32.0.125
Sat Aug 15 12:42:27 2015 /sbin/route add -net 10.32.0.1 netmask 255.255.255.255 gw 10.32.0.125
Sat Aug 15 12:42:27 2015 Initialization Sequence Completed

IF someone can tell more on what needs to be changed would be helpful

(Last edited by dinjo on 15 Aug 2015, 08:14)

I was able to resolve it by running below commands and adding 8.8.8.8 in my PC DNS

iptables -I FORWARD -i tun0 -o eth0 \
         -s 10.8.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED \
         -j ACCEPT
iptables -t nat -I POSTROUTING -o eth0 \
          -s 10.8.0.0/24 -j MASQUERADE

amq wrote:

The next release will be Chaos Calmer stable.

I plan the following extra changes:
- add DNSCrypt
- compile with GCC 5.1

Chaos Calmer 15.05 is out smile
Can you build update your images?

I've been using r45545 for months with no issues, congratulations.

Yay smile

2015-09-13
- Chaos Calmer 15.05 (r46849)
- Removed QoS
- Added dnscrypt-proxy
- Added ipset-dns
- Added luci-app-openvpn

If the OpenVPN page in Luci doesn't work:

mv /etc/config/openvpn /etc/config/openvpn.bak
touch /etc/config/openvpn

I am particularity excited about ipset-dns, it can be used to bypass the VPN based on a domain, not IPs (eg. netflix.com)

Hi,

This is a bit offtopic but do you mind sharing your VPN config? Also, are you using the official OpenVPN package or compiling a more recent version? Are you using the openssl version (or polarssl)?

I'm asking this because I'm running Chaos Calmer on a WDR4300 (which is a bit more powerful than the WR841N) and I only get 2MB/s over the VPN. And while doing so the router CPU goes to 100%.

Cheers!

Edit: Just re-read your first post and noticed the results were in Mbs. So the speeds you're seeing 12Mbs are actually a bit worse than what I'm getting (2MB/s = 16Mbps).

(Last edited by andre.beat on 13 Sep 2015, 22:28)