OpenWrt 24.10.0 -- How to enable RTL8821CU USB WiFi dongle

I have a USB 3.0 WiFi dongle that works on my Kubuntu 24.04 desktop (kernel 6.8.0-53-generic)

lsusb shows
Bus 001 Device 010: ID 0bda:c811 Realtek Semiconductor Corp. 802.11ac NIC

lsmod shows the device modules
Module                  Size  Used by
rtw88_8821cu           12288  0
rtw88_8821c            94208  1 rtw88_8821cu
rtw88_usb              24576  1 rtw88_8821cu
rtw88_core            360448  2 rtw88_8821c,rtw88_usb

ifconfig -a shows the device as:
wlxa047d74df245

ethtool shows
$ ethtool --driver wlxa047d74df245
driver: rtw_8821cu
version: 6.8.0-53-generic
firmware-version: N/A
expansion-rom-version: 
bus-info: 1-2.2:1.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

Based on the above info, I have installed the following to the OpenWrt 24.10.0 firmware for RasPi-4 (kernel 6.6.73)

OpenWrt packages installed:

kmod-rtw88
kmod-rtw88-8821c
kmod-rtw88-8821ce
kmod-rtw88-8821cu
rtl8821ce-firmware

lsusb shows nothing for this device.

ifconfig -a does not show a wireless interface for this device.

I would sincerely appreciate your guidance on what I am missing, to get the WiFi dongle working on my RasPi-4.

Thanks.

If lsusb shows nothing then the device isn't detected. It may mean the raspberry pi isn't providing enough power. What kind of power supply are you using? Do you have other devices connected to the pi?

The PSU is rated @ 5V/3A. I have used it for both RasPi-4 and RasPi-5
Besides the USB 3 WiFi dongle, I do have a USB 3.0 RJ45 LAN adapter on the 2nd USB port.

I have a USB MediaTek WiFi dongle which is detected on the same USB port.
Having issues with the Realtek dongle.

Most likely requires a newer kernel than what's currently used by Openwrt, but it should still be listed by lsusb.

1 Like

Thanks for the link. After a few reboots, the iw list did show the radio device. I created an AP on this device for the 5GHz band. However, it does not show up when I scanned for it on my phone. It sort of confirms the note at the end of the posted link - rtl8821cu support was added in 6.2 but performance could be flaky.

Agree, lsusb should still show it. I removed all other USB attachments except for the dongle; to eliminate power issues. It still does not show up in the output. I have a rock64 SBC; I'll check if lsusb reports it on that board.

OpenWrt 24.10 uses wireless drivers backported from Linux 6.12. In my experience, devices using RTL8811CU/RTL8821CU work reasonably well now (at least for basic client usage).

Some of them present themselves as a virtual disk containing Windows drivers. For those, the package usb-modeswitch is needed. They should still be listed in lsusb, though, but with a different ID (0bda:1a2b).

1 Like

Some more details about the Realtek 8821cu USB dongle.
It is a "driver less" device i.e. the Windows drivers are in "CDROM" storage like location in the hardware.

I switched the USB dongle to a multi NIC x86 router device.
The device has 2 USB 2.0 ports and 2 USB 3.0 ports.

OpenWrt 24.10.0 x86 generic

# cat /etc/os-release 
.....
OPENWRT_ARCH="x86_64"
OPENWRT_RELEASE="OpenWrt 24.10.0 r28427-6df0e3d02a"
.....

Relevant snippet from /etc/usb-mode.json

"0bda:1a2b": {                                                   
                        "*": {                                                   
                                "t_vendor": 8193,                                
                                "t_product": [ 13085 ],                          
                                "mode": "StandardEject",                         
                                "msg": [  ]                                      
                        }                                                        
                },                         

With the device in an USB 3.0 port lsusb shows the device as a "DISK" i.e. the kernel does not do an auto mode switch.

# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.73 xhci-hcd xHCI Host Controller
***Bus 001 Device 002: ID 0bda:1a2b Realtek DISK***
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.73 xhci-hcd xHCI Host Controller
Bus 002 Device 002: ID 18a5:0250 Verbatim STORE N GO

And with the device in an USB 2.0 port lsusb shows it as a NIC device i.e. the kernel does an auto mode switch

# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.73 xhci-hcd xHCI Host Controller
***Bus 001 Device 005: ID 0bda:c811 Realtek 802.11ac NIC***
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.73 xhci-hcd xHCI Host Controller
Bus 002 Device 002: ID 18a5:0250 Verbatim STORE N GO

With the device in the USB 2.0 port, I have configured an AP SSID 'OpenWrt-rtl8821'

No matter the mode setting (screenshot below), the SSID does not show up when I scan for WiFi APs on my cell phone.

Here is the output from iw list

Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 4
        max scan IEs length: 2243 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports T-DLS.
        Available Antennas: TX 0x1 RX 0x1
        Configured Antennas: TX 0x1 RX 0x1
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
        Band 1:
                Capabilities: 0x196e
                        HT20/HT40
                        SM Power Save disabled
                        RX HT20 SGI
                        RX HT40 SGI
                        RX STBC 1-stream
                        Max AMSDU length: 7935 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 2 usec (0x04)
                HT Max RX data rate: 150 Mbps
                HT TX/RX MCS rate indexes supported: 0-7, 32
                Frequencies:
                        * 2412.0 MHz [1] (30.0 dBm)
                        * 2417.0 MHz [2] (30.0 dBm)
                        * 2422.0 MHz [3] (30.0 dBm)
                        * 2427.0 MHz [4] (30.0 dBm)
                        * 2432.0 MHz [5] (30.0 dBm)
                        * 2437.0 MHz [6] (30.0 dBm)
                        * 2442.0 MHz [7] (30.0 dBm)
                        * 2447.0 MHz [8] (30.0 dBm)
                        * 2452.0 MHz [9] (30.0 dBm)
                        * 2457.0 MHz [10] (30.0 dBm)
                        * 2462.0 MHz [11] (30.0 dBm)
                        * 2467.0 MHz [12] (disabled)
                        * 2472.0 MHz [13] (disabled)
                        * 2484.0 MHz [14] (disabled)
        Band 2:
                Capabilities: 0x196e
                        HT20/HT40
                        SM Power Save disabled
                        RX HT20 SGI
                        RX HT40 SGI
                        RX STBC 1-stream
                        Max AMSDU length: 7935 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 2 usec (0x04)
                HT Max RX data rate: 150 Mbps
                HT TX/RX MCS rate indexes supported: 0-7, 32
                VHT Capabilities (0x03d07122):
                        Max MPDU length: 11454
                        Supported Channel Width: neither 160 nor 80+80
                        short GI (80 MHz)
                        SU Beamformee
                        MU Beamformee
                        +HTC-VHT
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT RX highest supported: 390 Mbps
                VHT TX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 390 Mbps
                VHT extended NSS: not supported
                Frequencies:
                        * 5180.0 MHz [36] (23.0 dBm)
                        * 5200.0 MHz [40] (23.0 dBm)
                        * 5220.0 MHz [44] (23.0 dBm)
                        * 5240.0 MHz [48] (23.0 dBm)
                        * 5260.0 MHz [52] (24.0 dBm) (radar detection)
                        * 5280.0 MHz [56] (24.0 dBm) (radar detection)
                        * 5300.0 MHz [60] (24.0 dBm) (radar detection)
                        * 5320.0 MHz [64] (24.0 dBm) (radar detection)
                        * 5500.0 MHz [100] (24.0 dBm) (radar detection)
                        * 5520.0 MHz [104] (24.0 dBm) (radar detection)
                        * 5540.0 MHz [108] (24.0 dBm) (radar detection)
                        * 5560.0 MHz [112] (24.0 dBm) (radar detection)
                        * 5580.0 MHz [116] (24.0 dBm) (radar detection)
                        * 5600.0 MHz [120] (24.0 dBm) (radar detection)
                        * 5620.0 MHz [124] (24.0 dBm) (radar detection)
                        * 5640.0 MHz [128] (24.0 dBm) (radar detection)
                        * 5660.0 MHz [132] (24.0 dBm) (radar detection)
                        * 5680.0 MHz [136] (24.0 dBm) (radar detection)
                        * 5700.0 MHz [140] (24.0 dBm) (radar detection)
                        * 5720.0 MHz [144] (24.0 dBm) (radar detection)
                        * 5745.0 MHz [149] (30.0 dBm)
                        * 5765.0 MHz [153] (30.0 dBm)
                        * 5785.0 MHz [157] (30.0 dBm)
                        * 5805.0 MHz [161] (30.0 dBm)
                        * 5825.0 MHz [165] (30.0 dBm)
        interface combinations are not supported
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        max # scan plans: 1
        max scan plan interval: -1
        max scan plan iterations: 0
        Supported extended features:
                * [ RRM ]: RRM
                * [ SET_SCAN_DWELL ]: scan dwell setting
                * [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
                * [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
                * [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
                * [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
                * [ CAN_REPLACE_PTK0 ]: can safely replace PTK 0 when rekeying
                * [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
                * [ DEL_IBSS_STA ]: deletion of IBSS station support
                * [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
                * [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
                * [ POWERED_ADDR_CHANGE ]: can change MAC address while up