OpenWrt WRT3200ACM + WRT32X Builds

TL;DR - Builds§

Installable/downgradable modules, usable on stock OpenWrt image.§

Recommended Download the kmod-* packages from here: https://github.com/adworacz/openwrt-linksys-wireless/tree/main/releases/21.02.1

Feel free to verify the checksums using the checksum file: sha256sum -c sha256sums

Install each package using a command like: opkg install --force-downgrade kmod-mac80211*

Note: It may be required to remove the old kmod packages first, see note here.

Once all packages are installed, reboot.

arinc9's Builds§

Not recommended

arinc9 from the OpenWrt forums has started maintaining his own builds with this fix.

See: https://forum.openwrt.org/t/openwrt-21-02-for-linksys-wrt3200acm-wrt32x-with-the-wireless-cut-out-issue-fixed/111852

r16325-88151b8303 aka '21.02.1'§

Not recommended

This should be a 100% 21.02.1 compatible build, including kernel module (kmod) package support. While the modules are actually binary compatible with the 21.02.1 kernel, build hashing for the associated packages prevents installation from the official repos. In theory, it should be possible to force different kernel module installation using opkg install --force-depends <package>.

Known Issues:

  1. Kernel modules are superficially not compatible with the official 21.02.1 repos/image due to build hashing.

https://openwrt.austindw.com/linksys-wrt/working-wireless/r16325/

r16335-4b0f87729c§

Not recommended

Known Issues:

  1. This is not perfectly compatible with the 21.02.1 image as it was built from a slightly different commit and is using a newer Linux kernel. This means that kmod packages can't be installed from the 21.02.1 repository and the kmod-mac80211 package can't be installed on existing 21.02.1 installs. This will be fixed in a new build.

https://openwrt.austindw.com/linksys-wrt/working-wireless/r16335/

Context§

As of OpenWrt's official 21.02 builds, WRT3200ACM and WRT32X routers have a known issue that cause "wireless cutouts" for some clients (usually iOS devices, but some Androids have been reported as well.)

A wireless cutout is identified by the client device being connected to wifi, but no traffic flows. It's not even possible to ping the router or access the Luci web interface. Sites just hang while trying to load.

After a lot of work, myself and another community member WildByDesign (who massively helped with testing, huge thank you) managed to narrow down the specific commit between 19.07 and 21.02 that caused the issue.

That commit was ed2015c38617ed6624471e77f27fbb0c58c8c660

commit ed2015c38617ed6624471e77f27fbb0c58c8c660 (HEAD)
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Sat Jun 20 23:11:17 2020 +0200

    mac80211: Update to version 5.8-rc2-1

    The following patches:
    * 972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch
    * 973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch
    are replaced by this commit in the upstream kernel:
    * 3db24065c2c8 ("ath10k: enable VHT160 and VHT80+80 modes")

    The following patches were applied upstream:
    * 001-rt2800-enable-MFP-support-unconditionally.patch
    * 090-wireless-Use-linux-stddef.h-instead-of-stddef.h.patch

    The rtw88 driver is now split into multiple kernel modules, just put it
    all into one OpenWrt kernel package.

    rtl8812au-ct was patched to compile against the mac80211 from kernel
    5.8, but not runtime tested.

    Add a patch which fixes ath10k on IPQ40XX, this patch was send upstream
    and fixes a crash when loading ath10k on this SoC.

    Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq40xx/ map-ac2200]
    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

This means that the jump from mac80211 5.7.5 (introduced at the commit just before this one) to 5.8+ introduced a compatibility bug between the mwlwifi mac80211 driver and the mac80211 kernel subsystem. Which commit in 5.8, and how mwlwifi can be updated to fix its compatiblity, I do not know...

A community member has a shot in th dark idea of what update in mac80211 5.8 might have been the issue, but we don't know for sure at this point.

In order to keep these devices working, I've taken steps (prompted by the same community member) to create a compatible image for the WRT3200ACM and WRT32X that combines the 21.02 branch with mac80211 5.7.5.

And I'll be damned, it seems to have worked.

DIY Instructions§

In order to replicate this work, you need to do a few basic things with a fresh checkout of the OpenWrt git project.

This assumes you've setup your build environment, per the OpenWrt build wiki instructions

Instructions updated based on cotequeiroz's work here, which are easier to replicate and don't require special patches.

# Checkout OpenWrt, specifically the v21.02.1 branch.
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout v21.02.1

# Do the directory surgery that replaces the current mac80211 setup with the old 5.7.5 setup.
rm -rf package/kernel/{mac80211,ath10k-ct,mt76,rtl8812au-ct}
git checkout d1100c76b33ff68c6db0f5fa31a26532bdbb15c4 -- package/kernel/{mac80211,ath10k-ct,mt76,rtl8812au-ct}
rm -f package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch

./scripts/feeds update -a -f && ./scripts/feeds install -a -f
# Batman-adv is incompatible with this change, and it isn't worth patching.
./scripts/feeds uninstall batman-adv

# Get the official 21.02.1 build config
wget 'https://downloads.openwrt.org/releases/21.02.1/targets/mvebu/cortexa9/config.buildinfo'
cp config.buildinfo .config

# Make everything.
make defconfig
make -j8 download && make -j8 BUILD_LOG=1

Under the bin/targets/mvebu/cortexa9/ directory, you should have a standard set of OpenWrt images and some packages.

You can install from there.

Podman/Docker Instructions§

I managed to piece together a Dockerfile that replicates the exact setup used by the OpenWrt build fleet.

I've been able to use said Dockerfile with rootless Podman to build assets locally while avoiding many of the package build errors that happened on my Archlinux install. Archlinux uses much newer build dependencies, which inhibits perfect compatibility with the same environment that OpenWrt uses for all public builds.

Using the Dockerfile mitigates that, and prevents clogging one's system with build dependencies.

Note: It should be possible to do this with Docker itself. I just use Podman and could benefit from the use of the --userns=keep-id parameter to match permissions between host and container while letting me build with a non-root user inside the container.

If you figure out how to run the same commands with Docker, let me know and I'll update this post.

You can checkout all of the necessary files at this GitHub Repo: https://github.com/adworacz/openwrt-linksys-wireless

Feel free to open and modify either file as you see fit.

A quick start:

git clone https://github.com/adworacz/openwrt-linksys-wireless
cd openwrt-linksys-wireless

# Build the container using Podman
podman build -t openwrt-builder .

# Run the container, which should build official images and
# automatically extract the necessary kmod packages into the 'release' directory.
podman run -it --userns=keep-id -v $PWD:/pwd openwrt-builder

# If you want to use your freshly built image, instead of downgrading artifacts,
# simply get the image from underneath the `openwrt/bin/targets/mvebu/cortexa9/` directory.

# Enjoy!