TL-wr841n v14 image (bounty?)

So i had already bought 20 of the tl-wr841n v14 before starting with openwrt.
The next 20 were archers and xioami 4a giga, which work great with openwrt (and my vlans).

I tried several days to get the v14 to work. It is such a strange beast. Accepted as commit, but after 19.07.
Then i hear that there was a time when people managed to build images, though none of the ones i downloaded worked.

But now i think it is so difficult that is has become impossible for mortals (me) and the task would really need a developer.
Since i have to many i would be happy to pay a small bounty for a working image Just the dumbest ap with ip4 and vlans.

Torsten

You chose... poorly.

The v14 is selectable in the 21.02 imagebuilder. You'll need to cut a lot of stuff out to fit in the 4M flash. Using imagebuilder is not intended to require any coding.

Also though I haven't tried it there are online imagebuilders.

Another thing to consider would be swapping the flash chip to 8M and running a v13 image. It would have only half the RAM of a real v13, but that doesn't affect the image. You'll likely still need to take stuff out or disable it at runtime to keep from running out of RAM.

Get serial console working on one of the units you're bound to need it at some point.

I would second this. No programming skills needed for using the image builder. Maybe it helps if you know a little bit bash and have used a makefile before....
Start with stripping down the obvious parts you do not need for an dump AP. Like pppoe, dnsmasq, firewall, odhcpd, if all this doesn't help you can compile your own image by even strip more stuff of the base image. Iirc there are some guides how to strip down the under 4mb.

Since you both misunderstood me, i may have been unclear.
I tried 3 days, one (solid one) was with image builder.
2 more with menuconfig. Stripping everything i know. And more.
To get an image i had to remove so much (in menuconfig) that the image did not boot. I'm talking cutting into busybox in a major way and leaving nothing on top level.

So the misunderstanding may be that i mean it needs a developers touch, but not for programming, instead to know what can be left out. With knowledge beyond what can be read in the wiki or forums (which i did, extensively)

Also, for anyone else reading this, i would really appreciate help (not general advice) from people that have experience with this particular device. Me thinks it is quite a peculiar case.

Oh, and @mk24 , open judgement about my choices is not how adults that don't know each other usually communicate. If you wanted to know how i came to my (valid) choice, just ask.

Do you have a list on hand what you removed while using the image-builder? Maybe we find what was to much that your image did not booted.
Same goes for the .config of the build system.

Edit: Did you tried to build or compile with 19.07 or with 21.02 or current snapshot?

With the image builder i followed 4/32 reduction instructions, as per wiki page on that topic. That never produced a binary.

Compiling i just remember picking up a few configs from the forums. None produced a binary.
Then i starting slashing and it would still not compile. Until at some point i took out too much of busybox (all other candidates were gone) and that didn't boot. So i gave up and tossed the whole thing.

19.07 can not be compiled, as the commit for v14 never got back-ported (another good developer task).
I also tried compiling at the commit (which i found somewhere in the forum) but the feeds did not work (and i did not know how to work around that). The original commiter obviously got it to compile at the time but i don't know how to now. (another good candidate for a developers touch)

All in all it is a very weird edge case. I have seen other 4/32 devices with snapshot links, but v14 does not have anymore (even forms still link to non-existing snapshot downloads, so they must have existed)

so I've build around sept 2020 some images for another forum member that had an US hw version - i'm unsure if any changes were between the unit I had back hten - EU and his but it didn't work for him.
Anyhow this is all I have for this "beast" - outdated of course and without latest CVE patches:
some patches applies to 17.01 branch:
https://maurerr.github.io/lede-17.01.ng-mt7628/lede-ramips-mt7628-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin
https://maurerr.github.io/lede-17.01.ng-mt7628/lede-ramips-mt7628-tplink_tl-wr841n-v14-squashfs-tftp-recovery.bin
18.09 code from 09.2020
https://www.dropbox.com/s/5l48lmjapz6jvsp/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin?dl=1
https://www.dropbox.com/s/9a0wrysxampxddn/openwrt-dnscrypt-mt76x8-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin?dl=1 (dns over https included)
https://www.dropbox.com/s/9a0wrysxampxddn/openwrt-dnscrypt-mt76x8-tplink_tl-wr841n-v14-squashfs-sysupgrade.bin?dl=1 (dnscrypt v1 included)

what does your routers need or will do? like i said, pppoe is a good candidate and/or firewall etc etc. but without the requirements its hard to make any good suggestions what can and should be striped.

That was a line from a movie. It was not intended to be personal. I apologize for it.

Version 21 brought a large increase in binary size by including libwolfssl (1.08 MB uncompressed) by default. The two packages that depend on libwolfssl are wpad-basic-wolfssl and libustream-wolfssl (which is used by uclient-fetch, also known as wget). Remove all of those, substituting wpad-mini with no SSL --which drops WPA3 functionality. hostapd-basic may be even smaller if you will never be needing wifi client capability. Also remove opkg if you haven't already. This is in addition to the usual removals of LuCI, everything related to ppp, and everything related to IPV6.

If you select v13 you will get a binary-- which you can't run, but you can see the size of the sysupgrade file to check how close it is to fitting in 4 MB flash to build the same thing for v14. I think it will need to be smaller than 4MiB minus eight 64 KiB blocks that are used for other things (bootloader 2, factory partition 1 and five free to build a jffs2 filesystem).

1 Like

@maurer Thanks for chipping in. Did i find these binaries in some other thread already? (those bricked my device)
I am curious (before trying) how you obtained/compiled v14 code for 17/18 version of openwrt. As the v14 commit was after 19.07.
(I'll try and follow mk24 now and see again if there is still a chance to build this "beast")

@mk24 Sure, which movie?

So i am setting up the compile again. Good idea with the v13 hack to check. Unedited i start at 4.719.421 bytes.
Both tp-link official firmware and were around 4.2500.00
I'll start cutting. But some questions come up:

tbc

V14's tftp won't allow v13 images - hex editing it might work though
As for my binaries I've applied the patches to my tree see github.com/maurerr/openwrt

Good news: without ssl imagebuilder can build an image. Even better, luci fits in. (EDIT: this image does not retain data, see below)
Not so good: that means no encrypted wifi, kind of a deal breaker for me. But the device can be used as a simple vlan switch, which for the 10 euro is ok.

@maurer lede (17) and opwenwrt (18) did not boot.

I tried again to build with menuconfig and got nowhere (ok because i like the imagebuilder).
With using v13 trick i could get to within 10k, but not closer :frowning:

Adding back wpad-mini or wpad-basic or hostapd-basic all support WPA2 (but not WPA3) and do not require a SSL library.

On the other hand, the build you made still includes a lot of packages that are only needed for wifi (iw, iwinfo, cfg80211, kmod-mt76, etc.) which could be removed when using the router in a wired only role.

indeed removing luci and adding wpad-mini produces an image

 make image PROFILE=tplink_tl-wr841n-v14 PACKAGES="-ppp -ppp-mod-pppoe -uclient-fetch -kmod-ip6tables -ip6tables -odhcpd-ipv6only -libip6tc2 -wpad-basic-wolfssl -kmod-ppp -kmod-pppoe -kmod-pppox -opkg -libwolfssl -firewall -kmod-ipv6 -odhcp6c -libustream-wolfssl -odhcpd -iptables  -dnsmasq -urngd  wpad-mini"

https://anonfiles.com/v1K931Mfxb/openwrt-21.02.2-ramips-mt76x8-tplink_tl-wr841n-v14_zip

@maurer I can confirm that. Unfortunately the device does not hold information (even just a password) with an image like that.
That was probably the case with my first image too.

@mk24 Removing those wifi modules makes the device usable (ie it holds its info), thanks

Just for completeness, here is my command line:
make -j17 image PROFILE=tplink_tl-wr841n-v14 PACKAGES="-ppp -ppp-mod-pppoe -uclient-fetch -kmod-ip6tables -ip6tables -odhcpd-ipv6only -libip6tc2 -wpad-basic-wolfssl -kmod-ppp -kmod-pppoe -kmod-pppox -opkg -libwolfssl -firewall -kmod-ipv6 -odhcp6c -libustream-wolfssl -odhcpd -iptables luci-base uhttpd -dnsmasq -urngd luci-theme-bootstrap luci-mod-admin-full -iw -iwinfo -cfg80211 -kmod-mt76-core -kmod-mt7603 -cfg80211"

The sysupgrade is 3474221 bytes, pretty good.

Possibly (maybe?) the open wifi can be made to work. But i am not working without GUI anymore.
For me this makes a 10e device a vlan managed switch (40e) and even it only has 100Mb, for my IOT network this is ok. I'll use stock firmware on the AP's (behind the vlan switch) and conclude this experiment.
Thanks everyone

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

so I've manage to build a 3.5MB image with the help of @Ashus 's config for ath79 tiny
maybe @rubydesign you have some time to test it https://anonfiles.com/Nfx5T9M3x0/openwrt-ramips-mt76x8-tplink_tl-wr841n-v14_zip (remember you need to flash both files - first via tftp then from openwrt web/cli upgrade)

@maurer I did flash just to see if this really could be done. Alas, it does not boot :frowning:

I tftf'd the kernel over, even made sure with wireshark that it got there, but then only flashing leds, no response. Maybe you can link your config to see what could be the issue.
I'll try again if you want, i mean it would be a bit of a miracle.

PS: i don't fully understand this initial tftp and then sysupgrade, but it is what i did with my own images, even the ones i said are not keeping data.

sure here's the config file http://paste.debian.net/1233566/
and I've realized I've put CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=1024 same as ath79 instead of CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256 for mt76x8
anyway here is another attempt with 256 "https://anonfiles.com/BbufW5Mcxd" and https://anonfiles.com/z0u5WfM5x1