jahed.dev

WiFi 6E USB adapters on Linux.

I recently bought a WiFi 6 router. I didn't buy it for the WiFi 6 specifically, I just needed a router and WiFi 6 is the latest thing nowadays. Other than my phone, nothing else I have supports WiFi 6. So to justify my purchase, I decided to buy a WiFi 6 USB adapter.

I'm guessing it's a somewhat niche and new market, so popular brands are really expensive. I decided to buy a cheaper one, a "FENVI AX5400 WiFi 6E USB Adapter" to be precise. Out of the bunch, it was the newest, looked nice and was apparently really fast. 2.4Gbps over WiFi 6 at 5GHz! I'll test those unlikely speeds in the future, right now I just want to make sure it works -- on Linux of course.

Before we start, remember that Linux installations vary wildly, so I can't guarantee a solution. You might even break something. So do this at your own risk!

Plugging in the device

Initially without the correct drivers and firmware, the device won't do much. It won't show up as a network WiFi device or anything.

To confirm it's a driver issue, if we list USB devices, the device should be listed:

lsusb

The issue is that since the chipset is pretty new, there's a good chance the Linux kernel we're using doesn't have the necessary drivers baked in. To find out which chip the device is using, check the manual or product description. I had a "RTL8832CU".

It's possible to install additional drivers to the kernal using DKMS. Search the package manager for the chip's name and it might already be there. If it is, problem solved! In my case it wasn't so I had to do some additional research.

Linux's community of developers work hard to provide the latest drivers for new hardware. While they might not be easily available, it's possible to find them through forums and looking into alternative package managers to see where they get their sources from.

In my case, I found an AUR package by aquilarubra which uses a git repository by lwfinger for its sources and an additional dkms.conf file. A quick look through the repo and a make later, this looked like a robust solution.

Check DKMS status

First let's make sure our changes will have a visible effect. The list of DKMS modules should not initially include "rtl8852cu".

dkms status

Set up the DKMS module source

First we'll clone the source repo.

git clone https://github.com/lwfinger/rtw8852cu

Then we can add a dkms.conf to its root directory similar to the AUR package.

PACKAGE_NAME="rtl8852cu"
PACKAGE_VERSION="1.0.0"
MAKE="'make' -j$(nproc) KVER=${kernelver} KSRC=/lib/modules/${kernelver}/build"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="8852cu"
DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
AUTOINSTALL="yes"

Note, while the package is named "rtl8852cu" and the repo is named "rtw8852cu", it works with other chipsets in the same series. For consistency, we'll keep the same name as the AUR package.

Add the module to DKMS

dkms add /home/main/repos/rtw8852cu

DKMS will make a copy of the repo with the appropriate name and set everything up. Changing the original repo will not change the repo added to DKMS, since it's a full copy, not a symbolic link or anything like that.

The module should now appear in the module list as "rtl8852cu"

dkms status

Install the module

dkms autoinstall

Restart the machine

To make sure everything is set up and pesisted correctly, restart the machine.

Try out the USB

Now when we plug in the USB, it should automatically show up as a network WiFi device!

If it doesn't work, you may need to look further into your Linux distribution's defaults. For example, you may need additional firmware packages installed such as "non-free" or "ahs" variants. If you can't find them, you may need to add the relevant package repositories.

Conclusion

It's obvious now that when hunting for these sorts of devices, it's best to check what's in them to ensure a level of quality and compatibility. Had I known "RTL" was referencing "Realtek", a company known for its poor drivers, I would've stayed well away. To help navigate this area, morrownr has created a handy guide.

As always, I'm really impressed with Linux's hardware support. Using the latest non-free hardware always comes with a risk of incompatibility. In this case, that risk paid off thanks to Linux's thriving community.

Thanks for reading.