Users needed to test Wi-Fi stability on Linksys WRT3200ACM & WRT32X on OpenWrt 21.02

Ahh perfect, that should be easy. I'll try and build an image tonight with this for my WRT3200ACM.

As an alternative method, from your buildroot:

wget -O package/kernel/mwlwifi/patches/002-pcieFix.patch https://github.com/kaloz/mwlwifi/pull/401/commits/4adce307574cb9e7a3e439d1e97a4376f4987cbd.patch
make package/kernel/mwlwifi/{clean,compile}
2 Likes

The patch didn't help me when I enabled wpa2/wpa3 mixed with 802.11w optional in wrt3200acm. Different errors (log spam) than earlier, but no connectivity. :frowning:

Yeah the patch is for a specific error message that was seen in the log.

Looking forward to testing too as I use a WRT32X running Master snapshot. Think OpenWrt project will need to switch the repo for the comit because it seems mwlwifi is abandoned. Let's get this fix into master snapshots asap so I can test it too, I don't compile my own builds :slight_smile:

I have tried this on my WRT32X at 21.02.0-rc3. 2.4GHz band works fine for now. However, 5GHz band is unusable. The connection is very unstable, it keeps cutting off in a matter of seconds.

Time to try the master snapshot.

Okay my custom build results are in for WRT3200ACM

2.4 ghz worked fine.
5Ghz was a mess. Clients wouldn’t connect when I used channels 149 or 153. Only worked if I used 36. But performance was significantly worse. IPerf showed around 145M instead of the usual ~500M.

All of this was on WPA2.

I’m flashing back to my custom build with default firmware.

I will revert the pull request, because I haven't considered that the new check breaks the driver. It works interestingly on WRT32X. But it should not work.

The reason:
Each command is constructed with memset, which sets also the result code to 0. But the result code 0 is also HOSTCMD_RESULT_OK. So the wait routine always passes, also when the command to the chip isn't successfully executed.

I will work on a new modification.

PLEASE don't use this pull request any more.

1 Like

Please close the PR in the Kaloz repo...
(you should be able to do that as you are the PR author)

Done (Closed).

1 Like

Is there something wrong with the official images for OpenWrt 21.02.0?

Because I only changed the code to:

static int pcie_wait_complete(struct mwl_priv *priv, unsigned short cmd)
{
	unsigned int curr_iteration = MAX_WAIT_FW_COMPLETE_ITERATIONS;
	unsigned short int_code = 0;
	unsigned short int_result = 0;
	struct hostcmd_header *cmd_hdr = NULL;

	do {
		int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[0]));
		usleep_range(1000, 2000);
	} while ((int_code != cmd) && (--curr_iteration) && !priv->rmmod);

	if (curr_iteration == 0) {
		cmd_hdr = (struct hostcmd_header *)&priv->pcmd_buf[0];
		int_result = le16_to_cpu(cmd_hdr->result);
		wiphy_err(priv->hw->wiphy, "cmd 0x%04x=%s timed out\n",
			  cmd, mwl_fwcmd_get_cmd_string(cmd));
		wiphy_err(priv->hw->wiphy, "return code: 0x%04x\n", int_result);
		return -EIO;
	}

	if (priv->chip_type != MWL8997)
		usleep_range(3000, 5000);

	return 0;
}

...to get the correct result. But WiFi seems to be stable (2.4 and 5GHz) on my WRT32X.

Built OpenWrt with:

git clone https://github.com/openwrt/openwrt.git
git checkout v21.02.0
cd openwrt

I have updated the source for the mwlwifi driver to my fork from the GitHub repo only for testing:

PKG_SOURCE_URL:=https://github.com/krjdev/mwlwifi
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-09-17
PKG_SOURCE_VERSION:=db04752dda585685cdc91d0e49bcf183bcd885d2

Additional I removed...

PKG_MIRROR_HASH:=0eda0e774a87e58e611d6436350e1cf2be3de50fddde334909a07a15b0c9862b

...in the Makefile and renamed the patch directory to patch.tmp under package/kernel/mwlwifi

./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make clean download world

Please can somebody test this too?

EDIT:
With the official images WiFi doesn't work on my WRT32X.

Also to avoid my GitHub fork for the driver is, to change the Makefile from package/kernel/mwlwifi to
the latest commit from kaloz.

Try uninstalling wpad-openssl and use regular wpad / wpad-basic
I compiled my own build with wpad and also applied DFS-free radio patch from httpstorm openwrt repo (https://github.com/httpstorm/openwrt/commit/677fef0ffb9971993d1cc11c10469bf777a26771)
After I installed the build everything were smoothly for about a day. Then I decided to try and use wpa3. As soon as I uninstalled wpad and installed wpad-openssl I started to experience the same issues as described here.

P.S. I'm on 3200ACM

I’ve used wpad-basic-wolfssl (the default) on both an official 21.02 image, a custom 21.02 build, and on master with my WRT3200acm

All of them exhibit the random WiFi hangs on my iPhone, generally noticeable within 48 hours of uptime.

So curious to see if you encounter issues after longer periods of uptime, or if the DFS patch is magically the fix.

Edit: and I’m not talking about using WPA3. I dont think we’ll ever get to a point of being able to use it properly on these devices.

1 Like

What do you mean by hangs? is it short hangs like 10 seconds and then it's just go away or does your iphone cannot load websites through wifi at all at some point and you have to reboot your router \ reconnect to wifi?

It’s the same issue described by a number of users on this thread, but the iPhone connects to WiFi but can’t load any data. Even trying to access Luci doesn’t work.

Toggling the WiFi (reconnecting) on my phone does fix the issue.

I had that when I uninstalled wpad and instaleld wpad-openssl. When I reverted back to wpad issue was gone. Although I cannot confirm what makes connection stable is it just wpad or wpad + dfs patch

I’ve experienced it on both wpad-basic-wolfssl and wpad-openssl.

That's different versions that I've tried
I have no isses with https://openwrt.org/packages/pkgdata/wpad and https://openwrt.org/packages/pkgdata/wpad-basic

The versions you're referring to have ssl, mine don't

bth both wolfssl and openssl versions of wpad package have the same abnormal behavior which makes me think there something wrong going on between the encryption library and wifi modem driver

Interesting. I'll try an "ssl free" wpad, like wpad-basic and report back.

Edit: Installed wpad-basic (not openssl/wolfssl) just a few minutes ago. We'll see how things go over the next 24 hours. Unfortunately I'll be out of town for the next few days so I won't be able to get long term results until next weekend.

1 Like

Welp that didn't take long - had wifi hanging issues 3 times in quick succession in the span of 5 minutes while I was actively using my iPhone.

You can clearly see it called out in the logs too, under "deauthenticated due to inactivity":

Mon Sep 20 03:59:03 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: disassociated
Mon Sep 20 03:59:03 2021 kern.debug kernel: [ 5294.809513] ieee80211 phy0: staid 1 deleted
Mon Sep 20 03:59:04 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Sep 20 03:59:06 2021 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED a8:10:87:6e:c1:33
Mon Sep 20 03:59:06 2021 kern.debug kernel: [ 5297.815430] ieee80211 phy1: staid 2 deleted
Mon Sep 20 03:59:08 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: associated (aid 1)
Mon Sep 20 03:59:08 2021 daemon.notice hostapd: wlan0: AP-STA-CONNECTED 9a:3e:94:9f:f1:4c
Mon Sep 20 03:59:08 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c WPA: pairwise key handshake completed (RSN)
Mon Sep 20 03:59:08 2021 daemon.notice hostapd: wlan0: EAPOL-4WAY-HS-COMPLETED 9a:3e:94:9f:f1:4c
...
Mon Sep 20 04:01:07 2021 kern.debug kernel: [ 5418.400109] ieee80211 phy1: staid 2 deleted
Mon Sep 20 04:01:52 2021 daemon.notice hostapd: wlan0: AP-STA-DISCONNECTED 9a:3e:94:9f:f1:4c
Mon Sep 20 04:01:52 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: disassociated
Mon Sep 20 04:01:52 2021 kern.debug kernel: [ 5464.346283] ieee80211 phy0: staid 1 deleted
Mon Sep 20 04:01:53 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Sep 20 04:01:56 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: associated (aid 1)
Mon Sep 20 04:01:56 2021 daemon.notice hostapd: wlan0: AP-STA-CONNECTED 9a:3e:94:9f:f1:4c
Mon Sep 20 04:01:56 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c WPA: pairwise key handshake completed (RSN)
Mon Sep 20 04:01:56 2021 daemon.notice hostapd: wlan0: EAPOL-4WAY-HS-COMPLETED 9a:3e:94:9f:f1:4c
...
Mon Sep 20 04:03:06 2021 kern.debug kernel: [ 5537.943764] ieee80211 phy1: staid 2 deleted
Mon Sep 20 04:03:37 2021 daemon.notice hostapd: wlan0: AP-STA-DISCONNECTED 9a:3e:94:9f:f1:4c
Mon Sep 20 04:03:37 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: disassociated
Mon Sep 20 04:03:37 2021 kern.debug kernel: [ 5568.732830] ieee80211 phy0: staid 1 deleted
Mon Sep 20 04:03:38 2021 daemon.info hostapd: wlan0: STA 9a:3e:94:9f:f1:4c IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)

So it appears that using wpad-basic (no openssl/wolfssl) did not fix the issue.