Only 32MB of RAM, still works for simple tasks

Nothing spectacular, but I wanted to share that even devices low on RAM (32MB) still work for simple tasks.

In this case there were a few TP-Link 1043nd v1 I had lying around (https://openwrt.org/toh/tp-link/tl-wr1043nd) with only 32MB of RAM.

In my setup one was configured to operate as WDS-client, bridged to LAN ports for a server that has no WiFi.

Since RAM is scarce it makes sense to remove unneeded things:

#!/bin/bash

BUILDER="https://downloads.openwrt.org/releases/21.02.3/targets/ath79/generic/openwrt-imagebuilder-21.02.3-ath79-generic.Linux-x86_64.tar.xz"

# download image builder
if [ ! -f "${BUILDER##*/}" ]; then
	wget "$BUILDER"
	tar xJvf "${BUILDER##*/}"
fi

cd openwrt-*/

# list all targets for this image builder, consider 'make help' as well
#make info

# clean previous images
make clean

# Packages are added if no prefix is given, '-packagename' does not integrate/removes a package
make image  PROFILE="tplink_tl-wr1043nd-v1" \
           PACKAGES="-firewall -kmod-ip6tables -kmod-ipt-conntrack \
                     -kmod-ipt-core -kmod-ipt-nat -kmod-ipt-offload kmod-mac80211 kmod-nf-conntrack -kmod-nf-conntrack6 -kmod-nf-flow -kmod-nf-ipt \
                     -kmod-nf-ipt6 -kmod-nf-nat -kmod-nf-reject -kmod-nf-reject6 -kmod-ppp -kmod-pppoe -kmod-pppox -ppp -luci-proto-ppp -luci-proto-ipv6 -luci-app-firewall \
                     -ppp -ppp-mod-pppoe \
                     -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only \
                     -odhcpd \
                     -iptables \
                     -opkg \
                     zram-swap \
                     uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-mod-admin-full luci-theme-bootstrap \
                     -wpad-basic-wolfssl wpad-wolfssl \
                     luci-app-statistics collectd-mod-ping collectd-mod-wireless collectd-mod-uptime \
                     pingcheck htop"

exit 0

To test the setup the server ran an iperf3 session for a day:

while true; do iperf3 -c 192.168.1.123 -t90; sleep 1; iperf3 -c 192.168.1.123 -R -t90; sleep 1; done

And the device managed to handle that quite Ok (I stopped at ~21:00):

TL;DR: Don't expect wonders, such hardware is still old. Even devices with 32MB can be used for simple tasks. Use SystemBuilder to free/compress RAM. No need to throw the hardware away yet.

Edit:
After configuring/diagnosing/testing it makes sense to disable uhttpd and collectd to free RAM and mitigate OOM issues. Enter console and issue the commands:

/etc/init.d/collectd stop
/etc/init.d/luci_statistics stop
/etc/init.d/uhttpd stop

/etc/init.d/collectd disable
/etc/init.d/luci_statistics disable
/etc/init.d/uhttpd disable

If you like to have LuCI running temporarily, just start it from the console with /etc/init.d/uhttpd start

3 Likes

especially devices with ath9k radio,they are a legend

The early draft-n ath9k wireless silicon of the tl-wr1043nd v1 however is far from legendary.

1 Like

The legends are about the brave souls that used those chips and lived to tell the story :wink:

2 Likes

From what I read MGLRU might even make it better in not too distant future.

i m not talking about the specific chipset on this device, some other tplinks i have, are not so bad compared to other chipset/driver of this days.

https://openwrt.org/docs/guide-user/installation/sysupgrade.cli#low_memory_workaroundstmp_is_too_small_to_hold_the_downloaded_file has some good info on freeing up RAM.

You can also take out the symlinks for these if not needed. I freed up ~5mb with these and wireless drivers on a device.
ppp
pppoe
nf-log6
nf-reject6