TL-MR3040 give new life, flash image to (tiny ar71xx-ath79)

Hi, I just found a couple of TL-MR3040 lying around on a drawer, it has OpenWRT 15 (custom for extroot) and LEDE 17

Context on hardware: TP-Link TL-MR3040 it's a 4/32mb battery backed wireless router with USB2.0 and a 3 position slide switch (change mode function)

4327_1 Screenshot from 2024-01-29 06-42-59 Screenshot from 2024-01-29 06-40-39

My plan is to dig if there is a way to give a new chance of living to these devices.
(Please, I understand that is an old 4/32mb device that just should be discarded as garbage)

Also this looks interesting too:

Judging the battery looks like last lot (hours powered on), but either the device has a current leak or the battery it's old tech because it's not capable of holding charge for a few days when it's powered off.

Everything I learn / achieve here my plan is to share it to the community as I did, but first I need to fill some blanks so I need help :pleading_face:

I want to try to flash to the most recent version possible that could allow me to have:

  • dhcp client on lan
  • wifi ap with dhcp server on wan
  • dropbear ssh
  • usb block device ext2/3 support to extroot to usb.
    All these to allow me to connect to the device via ssh with ease and do extroot.

basically my idea is to have it fully minimal to use it either as a:

  • To enter via the wifi ap and change the setting to connect to a existing network using it as wifi sta, and change the lan to have dhcp server (basically convert the device into a wifi to lan bridge to provide wifi capabilities to other device that only has ethernet)...

  • Be able to restore the setting either using the 3-mode switch or just using the reset button to come back to factory default setting detailed above.

  • And if I put an usb that contains openwrt on it, ext-root to it. (preferable to a fully featured openwrt version, even better if it's a newer one or the newest possible.

I have some knowledge and minor expertise on how to do part of these things, but still I have doubts about some things:

My questions are:

  • Which is the newest version recommended I could use for this minimal image?
  • How can I build this image (using which steps and what do I have to have in mind for this, eg with packages excluded or which configs, etc)
  • Can I somehow write an USB to act as extroot with fully featured version of that openwrt or a newer one ? how (only method I did in the past involves copying with tar the existing rom files)
  • I know a bit on how to put a file that will either run at firstboot or put script that will run on switch mode /reset button but would be great if I could also get help for this too.


LEDE 17.01.5 appears to be last supported version of OpenWrt for these devices.

That is indeed the end of the road for these devices and they should indeed be recycled, not 'just' because of the flash, but also because of the RAM which doesn't suffice either.

yes, I know about LEDE 17 already available images, and about the 4/32mb limitation... my question was more around getting something like:
"you could use OpenWrt 19, but 20 won't work flawlessly due to ram, and 21 even removing packages won't fit" ...
Also there is lot of people here with experience on building images or compiling for 4/32 so my question was more around that.
Also to see if someone had experience of having extroot to a different version, because I could put OpenWrt 15 with minimal config image.. and do extroot to full featured OpenWRT 19 maybe ?....

Thank you.

OpenWrt 21.02.x ath79 tiny LuCI would give you something like that.
there are 19.07 builds from the same user.

Interesting... I was reading there too that there is struggle to build images due to having to have fit Luci which is not possible anymore... I wonder if it could be a good idea to have a minimal web interface using a compiled C or just a bash script with a menu that allows to setup minimal configuration for these devices, something like an assistant for configuration.

  • Wifi Client mode DHCP server NAT in Ethernet
  • Wifi AP Mode with DHCP server NAT from Ethernet
    • (use this if want to convert all Ethernet ports in device to be just an Ethernet switch and the AP function will serve for alternative to access for config purposes)
  • Wifi AP Mode Ethernet bridged
  • etc.

I can even work on develop it if people are interested in the function.

it got an USB port, right ?

create an image with USB storage support, without webUI and webserver, for extroot, then install luci and uhttpd with extroot.

another interesting statement

Latest 22.03 branch uses nftables instead of iptables. Even when I removed most things, that could be missed, I'm about 316 kB short of compressed image space. I'm sorry to say it, but those 4MB devices will have to stay on OpenWRT 19 or 21.

src: OpenWrt 21.02.x ath79 tiny LuCI - #24 by Ashus

thanks, can I do extroot to a different version, do you know? how ?

you still need to fit a bare minimum into the 4mb flash, not sure it's doable.
trial and error.

isn't possible to have Eg Openwrt 15 to extroot flashed in the device and use a linux computer to write OpenWrt 19+ in an USB flash drive to boot ?

I'm asking that what you described here is what I already did time ago on this device with OpenWRT 15, I built a custom image with just extroot and then used an usb flashdrive and I extroot'ed to it to have OpenWrt 15 with Luci+etc...

so do it again, with a new(er) release ?

even if you solve the storage issue, you're still going to run out of memory, sooner than later.

yep, that's my plan, but I don't know which version to use, I wonder about this due to reading somewhere about concerns of stability or being too crappy version 15, maybe it worth to use 19, or 19 it just too much and 17 it's just fine, I don't know.

In this case I prioritize a bit of reliability for over stability, but importantly stability for over features.
(Eg could be that 17 could be more reliable than 15, 15 more stable, and both lack of features or capability of features by doing an extroot after in comparison to a newer version that could be both unreliable and unstable due to memory restrain.

maybe OpenWrt 15 it's just fine, I don't know.