DKMS Device Driver for WiFi Modules
Preparation
Automatically rebuilds and installs on kernel updates. DKMS is in official sources of Ubuntu, for installation do:
- target
sudo apt install build-essential dkms git
WiFi Module 5 and 5A
Clone the driver source from GitHub and the driver source must be copied to /usr/src/8812au-4.2.2
- target
git clone https://github.com/gnab/rtl8812au sudo cp -a rtl8812au /usr/src/8812au-4.2.2
Then add it to DKMS:
- target
sudo dkms add -m 8812au -v 4.2.2 sudo dkms build -m 8812au -v 4.2.2 sudo dkms install -m 8812au -v 4.2.2
WiFi Module 5B
Clone the driver source from GitHub.
- target
git clone https://github.com/brektrou/rtl8821CU cd rtl8821CU
Add this to DKMS.
- target
sudo ./dkms-install.sh
Then add the following contents to enable the WiFi feature in every boot.
Edit usb_modeswitch rules.
- target
sudo vi /lib/udev/rules.d/40-usb_modeswitch.rules
Append before the end line LABEL=“modeswitch_rules_end” the following:
- target
# Realtek 8821CU Wifi AC USB ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="/usr/sbin/usb_modeswitch '/%k'"
Reload udev rules to apply the changes without rebooting.
- target
sudo udevadm control --reload-rules && sudo udevadm trigger
- If you lost the WiFi module 5B after rebooting your system, you can re-enable that by using the following command. To do this automatically, there're so many ways to do that such as using systemd, an init script, or a Python script.
- target
sudo udevadm control trigger