Skip to content

JonPark0/RTL8851BU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

RTL8851BU Driver Installation Tutorial for Orange Pi Zero 3

This tutorial is for generic USB WIFI Dongle that uses Realtek RTL8851BU or RTL8831BU chipsets. Most of them uses the model name "AX900"

Install Precompiled Driver (Might not work, Fast)

Execute the script below to check the kernel version of your Orange Pi Zero 3

uname -r

It 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.

Compile from the source code (Recommended, Slow)

1. Extract Kernel Header File

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*.deb

reddit source

2. Download Driver File

Use the link below to download compressed driver file.

iptime original 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 .

3. Modify Driver Device Table

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.c

Search 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 */

4. Compile the driver

Execute the command below to compile the driver.

make clean
sudo make ARCH=arm64 -j$(nproc) # Use all processor

This process would take quite a while. Just take time.

Installation Process

Prerequisite

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.20240422

1. Install Driver

Execute the command below to install driver to the system.

# Remove Previously Installed Driver
sudo rmmod 8851bu

# Install Compiled Driver
sudo make install
sudo modprove 8851bu

2. Load Drier to the System Auto-load

To 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 8851bu

After executing the last script, you shall see 8851bu listed on it.

3. Update Initramfs and Module Dependency

# 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

About

Tutorial for compiling driver for RTL8815BU WiFi chipset.

Topics

Resources

Stars

Watchers

Forks