SparkLAN WPET-236ACN mPCIe 2.4/5Ghz WiFi Card Setup

This section covers the configuration needed to use the SparkLAN WPET-236ACN mPCIe card (featuring Realtek RTL8822BU chipset) which has both dual band 2.4 and 5Ghz WiFi compatibility as well as integrated BlueTooth adapter

Kernel 6.6+ (No Driver Installation Required)

From Raspberry Pi kernel 6.6 onwards, the RTL8822BU chipset is supported natively by the in-tree rtw_8822bu driver. No compilation or third-party modules are needed — the driver loads automatically when the card is detected.

You can verify this in dmesg output:

root@raspberrypi:~# dmesg | grep rtw
[ 8992.036978] rtw_8822bu 1-1.4:1.2: Firmware version 27.2.0, H2C version 13
[ 8992.641213] usbcore: registered new interface driver rtw_8822bu

If you see the above, skip straight to the WiFi Configuration section below.

WiFi Configuration

The WiFi interface is managed by dhcpcd which hooks into wpa_supplicant automatically. There are four steps needed to bring up WiFi.

1. Unblock the WiFi interface

The WiFi interface may be soft-blocked by rfkill on first boot. Check and unblock if necessary :

root@raspberrypi:~# rfkill list all
0: hci0: Bluetooth
        Soft blocked: yes
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: no

root@raspberrypi:~# rfkill unblock all

2. Scan for available networks

Bring the interface up and scan to verify the card can see your WiFi network :

root@raspberrypi:~# ip link set wlan0 up
root@raspberrypi:~# iwlist wlan0 scanning
wlan0     Scan completed :
          Cell 01 - Address: 34:E1:A9:5E:85:CF
                    Channel:36
                    Frequency:5.18 GHz (Channel 36)
                    Quality=42/70  Signal level=-68 dBm
                    Encryption key:on
                    ESSID:"EMT5"
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK

If you see "Operation not possible due to RF-kill" ensure you have completed step 1 above. If you see "Network is down" ensure you have run ip link set wlan0 up first. Make a note of the ESSID for the network you wish to connect to.

3. Add your WiFi credentials

Generate the WPA authentication details and append them to the wpa_supplicant configuration file :

root@raspberrypi:~# wpa_passphrase EMT5 >> /etc/wpa_supplicant/wpa_supplicant.conf

You will be prompted to enter your WiFi password. Verify the country code is set correctly in /etc/wpa_supplicant/wpa_supplicant.conf. This setting MUST be present when system is booted or WiFi will be disabled and you will be unable to bring up the interface.

country=??

Where ?? is your country code (dictating your WiFi power/range), for example GB for the United Kingdom. This is pre-configured as GB on our supplied images.

A sample config file is shown here :

root@raspberrypi:~# cat /etc/wpa_supplicant/wpa_supplicant.conf

country=GB
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="EMT5"
        #psk="xxxxxxxx"
        psk=4265dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}

4. Reboot

Reboot the system to allow dhcpcd to bring up the WiFi interface with the new credentials :

root@raspberrypi:~# reboot

Once rebooted you can check connectivity as below :

root@raspberrypi:~# ip addr show wlan0
wlan0: flags=4163  mtu 1500
        inet 192.168.1.119  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::f47f:4f32:2a75:91a7  prefixlen 64  scopeid 0x20
        ether 00:0e:8e:bb:47:14  txqueuelen 1000  (Ethernet)

root@raspberrypi:~# iw dev wlan0 link
Connected to 34:e1:a9:5e:85:cf (on wlan0)
        SSID: EMT5
        freq: 5180
        signal: -68 dBm
        tx bitrate: 867.0 MBit/s

We can test the bluetooth interface has been detected :

root@raspberrypi:~# hciconfig
hci0:   Type: Primary  Bus: USB
        BD Address: 00:05:44:33:22:11  ACL MTU: 1021:8  SCO MTU: 255:16
        UP RUNNING
        RX bytes:688 acl:0 sco:0 events:46 errors:0
        TX bytes:2675 acl:0 sco:0 commands:46 errors:0

WiFi Power Management

For always-on industrial deployments the WiFi power management should be disabled to prevent intermittent disconnects. Create a dhcpcd enter-hook to disable power save whenever the wlan0 interface comes up :

root@raspberrypi:~# echo 'if [ "$interface" = "wlan0" ]; then
    iw dev wlan0 set power_save off
fi' > /etc/dhcpcd.enter-hook

You can verify the setting has taken effect after the interface is up :

root@raspberrypi:~# iw dev wlan0 get power_save
Power save: off

Legacy Driver Installation (Kernel 6.5 and earlier)

The following sections are only relevant for systems running Raspberry Pi kernel versions prior to 6.6, where the RTL8822BU chipset is not supported by an in-tree driver and requires manual compilation or pre-compiled modules.

Installation From Source

Here's the procedure we used to configure the WiFi card, this process was fairly straight-forward thanks to a open source git-hub page maintaining support for the chipset.

root@raspberrypi:~/wifi# apt-get update
root@raspberrypi:~/wifi# apt-get install bc git build-essential python flex bison libssl-dev libncurses5-dev
root@raspberrypi:~/wifi# wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source 
root@raspberrypi:~/wifi# sudo chmod +x /usr/local/bin/rpi-source 
root@raspberrypi:~/wifi# /usr/local/bin/rpi-source -q --tag-update
root@raspberrypi:~/wifi# rpi-source

That last step may argue a few times you haven't installed something, if so run the prompted command to install the missing component and re-run rpi-source.

There are two sources we have found for the driver, the second one below appears to be the latest version however causes a kernel panic on reboot (unit still reboots though)

https://github.com/fastoe/RTL8812BU_for_Raspbian

https://github.com/morrownr/88x2bu-20210702

We will use the first version since this does not cause any errors

root@raspberrypi:~/wifi/compile# git clone -b v5.6.1 https://github.com/fastoe/RTL8812BU_for_Raspbian
root@raspberrypi:~/wifi/compile# cd RTL8812BU_for_Raspbian/
root@raspberrypi:~/wifi/compile/RTL8812BU_for_Raspbian# make
root@raspberrypi:~/wifi/compile/RTL8812BU_for_Raspbian# make install
root@raspberrypi:~/wifi# echo "options 88x2bu rtw_power_mgnt=0 rtw_ips_mode=0 rtw_enusbss=0" >/etc/modprobe.d/88x2bu.conf
root@raspberrypi:~/wifi/compile/RTL8812BU_for_Raspbian# reboot

A sample log of the compile procedure can be seen HERE

After compilation, instalation and rebooting check the output of dmesg to verify the card has been detected:

root@raspberrypi:~/rtl8822bu# dmesg
[    5.486128] usb 1-1.3: New USB device found, idVendor=0bda, idProduct=b82c, bcdDevice= 2.10
[    5.494791] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.502251] usb 1-1.3: Product: 802.11ac NIC
[    5.506740] usb 1-1.3: Manufacturer: Realtek
[    5.511108] usb 1-1.3: SerialNumber: 123456


[   11.313670] Bluetooth: hci0: RTL: examining hci_ver=07 hci_rev=000b lmp_ver=07 lmp_subver=8822
[   11.329241] Bluetooth: hci0: RTL: rom_version status=0 version=2
[   11.329271] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822b_fw.bin
[   11.342814] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822b_config.bin
[   11.343749] Bluetooth: hci0: RTL: cfg_sz 14, total sz 20270
[   11.345524] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   11.361211] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
[   11.560798] 88x2bu: loading out-of-tree module taints kernel.
[   11.714744] random: crng init done
[   11.714768] random: 7 urandom warning(s) missed due to ratelimiting
[   12.172787] tpm_tis_spi spi1.0: 2.0 TPM (device-id 0x1B, rev-id 22)
[   12.178655] Bluetooth: hci0: RTL: fw version 0xab6b705c

Pre-Compiled Driver Modules

Note : Pre-compiled modules are only needed for kernel versions prior to 6.6. Modern kernels include native support via the rtw_8822bu driver.

Third party suppport providing pre-compiled kernel modules files for different WiFi cards can be found on the link below :

Pre-compiled Realtek WiFi driver kernel modules for all kernel versions

For kernel version 5.10.92-v7+ we have packaged up the pre-compiled kernel module for easy usage, to check which version you are using use the below

root@raspberrypi:~# uname -a
Linux raspberrypi 5.10.92-v7+ #1514 SMP Mon Jan 17 17:36:39 GMT 2022 armv7l GNU/Linux

Precompiled kernel module for 5.10.92-v7+ kernel download link :

GDrive Download link for 8822BU v5.6 driver file for Kernel 5.10.92

GDrive Download link for 8822BU v5.13.1 driver file for Kernel 5.10.92

We haven't gone as far as to test out full DKMS configuration, but expect that would also work.

WiFi Configuration Instructions for Raspbian Buster/Stretch/Jessie

RTL8822BU Fastoe Github Page

RTL8822BU morrownr Github

Contact us now to discuss your project

Ready to order, contact us today for pricing or samples

Contact Us