MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.76k stars 494 forks source link

USB WiFi (TP-Link Archer T2U PLUS) adapter not working on Odroid N2+ since recent kernel upgrade #7151

Open kartikynwa opened 1 month ago

kartikynwa commented 1 month ago

Creating a bug report/issue

Required Information

Additional Information (if applicable)

Steps to reproduce

  1. Have an Odroid N2+ with DietPi 9.5. Use an Archer T2U Plus USB wifi adapter with it.
  2. It works out of the box.
  3. Upgrade to DietPi 9.6 and upgrade the linux-{current,stb}-* packages alongside it.
  4. The wifi adapter is not functional anymore.

Expected behaviour

It should work.

Actual behaviour

I cannot use iwd to connect to a wifi network with the USB adapter. Specifically, the adapter appears in the outputs of commands like ip link, iwctl station list. But it does not detect any wifi networks. I have tested the adapter with a Windows laptop and can confirm that it still works. This happened after I upgraded linux-{current,stb}-* through apt and then rebooted which makes me think this is related to this kernel upgrade.

Extra details

Discussion regarding this took place here: https://github.com/MichaIng/DietPi/issues/7138#issuecomment-2221119916

I am seeing this error output in dmesg. It is also dumped in the terminal at boot. I cannot make sense of it so I can't confidently say if this is relevant. I have only been accessing the machine over SSH over the past few months. Now I am seeing this error but I am also now accessing the machine directly so I can't say if this was occurring before and it is only now that I am seeing it:

PXL_20240710_185752179~2

Output for ip link:

3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2312 qdisc mq state UP mode DORMANT group default qlen 1000         link/ether 98:48:27:9c:e8:4d brd ff:ff:ff:ff:ff:ff

Output for ip a:

3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2312 qdisc mq state UP group default qlen 1000                      link/ether 98:48:27:9c:e8:4d brd ff:ff:ff:ff:ff:ff      inet6 fe80::9a48:27ff:fe9c:e84d/64 scope link              valid_lft forever preferred_lft forever

Output for iw dev wlan0 info:

Interface wlan0
        ifindex 3
        wdev 0x1
        addr 98:48:27:9c:e8:4d
        type managed
        wiphy 0
        channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
        txpower 20.00 dBm

Following a previous suggestion, I tried iw dev wlan0 set power_save off and ip l set wlan0 mode default. Neither helped.

I would like to first try downgrading the aforementioned kernel packages and see if it fixes the issue before trying to test this issue with a fresh install.

MichaIng commented 1 month ago

Hmm, after running ip l set wlan0 mode default, ip link still shows mode DORMANT? In case, is there any error output?

And does downgrading the kernel help?

apt install linux-{image,dtb}-current-meson64=24.5.0-trunk-dietpi1
reboot
kartikynwa commented 1 month ago

No. Sorry for not being clear. The state does change from DORMANT to DEFAULT. But the adapter is still unable to find any wifi networks.

I just downgraded the psckages following the commands you suggested and I can resolutely confirm that the adapter has started working again.

You have no idea how happy this makes me.

MichaIng commented 1 month ago

Okay, then we can at least narrow it down and it works again for you for now. To prevent another upgrade of the kernel, mark then on hold:

apt-mark hold linux-{image,dtb}-current-meson64
MichaIng commented 1 month ago

I found a commit from 2 days before I triggered our last kernel update, which seems very suspicious: https://github.com/armbian/build/pull/6888

wifi: rtw88: coex: Prevent doing I/O during Wi-Fi power saving

I triggered new builds with this patch removed. Let's see whether it helps: https://github.com/MichaIng/DietPi/actions/runs/9897823517

MichaIng commented 1 month ago

Okay, it is ready for testing:

cd /tmp
wget https://dietpi.com/downloads/binaries/testing/linux-{image,dtb}-current-meson64.deb
dpkg -i linux-{image,dtb}-current-meson64.deb
reboot
kartikynwa commented 1 month ago

I was just able to test it. Unfortunately it looks like the testing debs don't fix the problem. The adapter is still unable to detect any networks. The mode also shows up as DORMAN under ip link. But setting it to default does not fix it either.

kartikynwa commented 1 month ago

Btw let me know if you need any more info. Happy to provide.