This tutorial is for generic USB WIFI Dongle that uses Realtek RTL8851BU or RTL8831BU chipsets. Most of them uses the model name "AX900"
Execute the script below to check the kernel version of your Orange Pi Zero 3
uname -rIt should give 6.1.31-sun50iw9 exactly. Unless, it won't work.
If your kernel driver matches the one specified above, proceed to driver installation tutorial below.
Official Image Provided by Orange Pi does not have any kernel header file load.
However, in the official Orange Pi wiki documentation, there is a kernel header file compressed under the specific directory.
Use the following command to install the deb package of the kernel header file.
sudo dpkg -i /opt/linux-headers*.debUse the link below to download compressed driver file.
Use this command to extract compressed file. When extracted, the folder (with the same name) will be placed under home directory.
tar -xvf RTL8851BU_WiFi_linux_v1.19.10-78-gfbe3fba11.20240422.tar(152665).gz .Some RTL8851BU related dongles have a device driver ID of 0xB831 instead of 0xB851. This will eventually make driver not to be loaded even dongle is connected.
Since the original source code doesn't read 0xB831 as 0xB851 device driver, we have to modify usb_intf.c and add custom device ID into the code.
To do this, run this:
# Extract the compressed driver file under the driver directory.
cd ~/RTL8851BU_WiFi_linux_v1.19.10-78-gfbe3fba11.20240422/driver
tar -xvf rtl8851BU_WiFi_linux_v1.19.10-78-gfbe3fba11.20240422.tar.gz .
# Move to the driver location
cd ~/RTL8851BU_WiFi_linux_v1.19.10-78-gfbe3fba11.20240422/driver/rtl8851BU_WiFi_linux_v1.19.10-78-gfbe3fba11.20240422
# Create Backup
cp os_dep/linux/usb_intf.c os_dep/linux/usb_intf.c.backup
# Use nano editor to edit USB driver ID list
sudo nano os_dep/linux/usb_intf.cSearch for the part that looks like below. (You can use CTRL+F to run search command in nano.)
#ifdef CONFIG_RTL8851B
/*=== Realtek demoboard ===*/
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB851, 0xff, 0xff, 0xff), .driver_info = RTL8851B},
#endif /* CONFIG_RTL8851B */Add new ID line so that it looks like below:
#ifdef CONFIG_RTL8851B
/*=== Realtek demoboard ===*/
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB851, 0xff, 0xff, 0xff), .driver_info = RTL8851B},
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB831, 0xff, 0xff, 0xff), .driver_info = RTL8851B},
#endif /* CONFIG_RTL8851B */Execute the command below to compile the driver.
make clean
sudo make ARCH=arm64 -j$(nproc) # Use all processorThis process would take quite a while. Just take time.
Make sure you are in the correct directory path.
cd ~/RTL8851BU_WiFi_linux_v1.19.10-78-gfbe3fba11.20240422/driver/rtl8851BU_WiFi_linux_v1.19.10-78-gfbe3fba11.20240422Execute the command below to install driver to the system.
# Remove Previously Installed Driver
sudo rmmod 8851bu
# Install Compiled Driver
sudo make install
sudo modprove 8851buTo ensure the driver loads automatically on boot, execute the script below.
# Remove any previously loaded system auto-load
sudo sed -i '/8851bu/d' /etc/modules
# Verify there is no 8851bu driver left on system auto-load
cat /etc/modules | grep 8851bu
# Add driver to the system auto-load
echo "8851bu" | sudo tee -a /etc/modules
# Verify again to ensure the driver is loaded properly
cat /etc/modules | grep 8851buAfter executing the last script, you shall see 8851bu listed on it.
# Update the initial ramdisk to include the module
sudo update-initramfs -u
# Update module dependencies
sudo depmod -a
# Check if the module is in the right place
ls -la /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8851bu.ko