Get Wifi Dongle based on rtl8821CU working

It’s been a while since I started a help topic. I’m having issues getting my wifi dongle working.
https://wiki.odroid.com/accessory/connectivity/wifi/wifimodules#wifi_module_5b
It’s based on rtl8821CU chipset. There is a dkms package in AUR and I got the driver from there. Then I followed the instructions in the driver package github and I’m getting an error
brektrou/rtl8821CU: Realtek RTL8811CU/RTL8821CU USB Wi-Fi adapter driver for Linux

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 004: ID 0bda:c820 Realtek Semiconductor Corp. 802.11ac NIC
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
>>  sudo usb_modeswitch -KW -v 0bda -p c820
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.2 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x0bda
DefaultProduct= 0xc820

StandardEject=1

Look for default devices ...
  found USB ID 05e3:0620
  found USB ID 1d6b:0003
  found USB ID 0bda:c820
   vendor ID matched
   product ID matched
  found USB ID 05e3:0610
  found USB ID 1d6b:0002
 Found devices in default mode (1)
Access device 004 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 224
Error: can't use storage command in MessageContent with interface 0; interface class is 224, expected 8. Abort

Any ideas on how to solve this issue?

Edit: Further research says that the driver is in the 6.13 kernel (which eos-arm uses).

So now, I’m beyond baffled why this dongle isn’t working

is sudo modprobe 8821cu giving any error?
would be may hinting to do the following procedure:

Open terminal and run live journal with the dongle unplugged:
journalctl -f
Now plug it and see what journal prints..

I installed this morrownr fork driver
morrownr/8821au-20210708: Linux Driver for USB WiFi Adapters that are based on the RTL8811AU and RTL8821AU Chipsets - v5.12.5.2
instead of the normal driver and it’s working without usb_modeswitch.
Now sudo modprobe 8821cu isn’t giving any error.

1 Like

@sradjoker
There has been some problems with ARM and wpa_supplicant lately.

wpa_supplicant-2:2.10-8 still works, but anything newer doesn’t.

RPi 4b & 5 fixed this so it runs OK on wpa_supplicant-2:2.11.3
However Pinebook Pro still needs wpa_supplicant2:2.10-8.

On Odroid N2 it just depends on which WiFi dongle you use. The dongle I use is the dual band USB 3 dongle that ameridroid sells and it works just fine on 2:2.11-3

Pudge

Won’t iwd be an ideal replacemet for wpa_supplicant?
I don’t know how things are on ARM side but I use it on all my installations on x86_64, Arch or otherwise. Has been working flawlessly for me.

Excellent idea. Can you write up a short how-to on installing it on x86_64? I tried iwd on ARM before but I just didn’t have much time to spend on it. I would like to try again on ARM.

Thanks

Pudge

From the top of my head:

sudo pacman -Syu iwd

sudo nano /etc/NetworkManager/conf.d/iwd.conf

with this content:

[device]
wifi.backend=iwd

sudo systemctl stop wpa_supplicant.service

sudo systemctl enable --now iwd.service (## This step is not needed. Please see @tbg’s post below)

sudo systemctl restart NetworkManager.service

If everything is working, disable and mask wpa_supplicant

sudo systemctl disable wpa_supplicant && sudo systemctl mask wpa_supplicant

If it doesn’t work just unmask wpa_supplicant and revert the rest. Tell me if it is working or not perhaps I could look into it more.

1 Like

Thanks so much for your help. I will definitely try this. If not tonight then tomorrow.

Pudge

1 Like

You are welcome! I hope you will get it to work on ARM too.

1 Like

Your memory is pretty good.

I have successfully got iwd running on my Odroid N2+ with a USB 3 WiFi dongle, as the Odroid N2+ does not have WiFi build in.

Previously, I was missing this step:

I have removed wpa_supplicant and it still works. Now I have to attempt to get iwd working on the RPi 4b, RPi 5, and the Pinebook Pro laptop. If successful I can then modify the images for iwd.

Thanks again. You have given me plenty of stuff to do this weekend.

Pudge

1 Like

I am glad to hear that it is working for you!

Once you get iwd working wpa_supplicant is not needed anymore. But I am not sure if you by removing mean uninstalling because I couldn’t uninstall the package as it is a required dependency of networkmanager.

sudo pacman -R wpa_supplicant 
[sudo] password for cactux:          
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing wpa_supplicant breaks dependency 'wpa_supplicant' required by networkmanager
1 Like
sudo pacman -Rdd wpa_supplicant

pacman -Rdd can be dangerous, one is always taking a chance with it. I was working with a test install, so if it messed it up, no big deal.

Hopefully in future ARM images, wpa_supplicant will never be installed and iwd will be installed by default.

Pudge

1 Like

OK, I see. I never thought of this option so I just have left the package in the system.
I wonder, when networkmnager gets updated, being its dependency, wpa_supplicant won’t get installed again.

1 Like

Just FYI, if using IWD as the backend for Network Manager the Archwiki has this to say:

7.12 Using iwd as the Wi-Fi backend

Note:

  • Do not enable iwd.service or manually configure iwd. NetworkManager will start and manage it itself.
  • Consider existing issues before switching to iwd.
3 Likes

Thanks for that info! It has been a long time I did this in my installs. I will edit my post and refer to yours.

2 Likes