Setting up WDB-433SU2M2 driver for Raspberry Pi 1 Model B

A lot of tutorials for setting up a driver for WBD-433SU2M2 were partial or broken due to old versions of NPM, so here’s a new writeup.

1. Setting up RPi

My RPi is a Model B Rev 2.0, which meant that it doesn’t have on-board Wi-Fi. I bought a super-cheap Elecom WDB-433SU2M2 for something like ¥900, but the only driver on its website is for Windows only.

The adapter uses Realtek RTL8821AU chipset, so what we can do is use its driver to compile it for Raspberry Pi.

RPi setup

This writeup uses the most recent Raspbian image (2019-09-26). See here for tutorial on how to set up your RPi.

After all that’s done, update your RPi.

$ sudo su
$ apt update && apt upgrade -y

Now check the kernel version of your device.

$ uname -a

Linux raspberrypi 4.19.93+ #1290 Fri Jan 10 16:34:37 GMT 2020 armv6l GNU/Linux

Note the version number 4.19.93+. This is the kernel header you want to use.

Get kernel source

$ apt install raspberrypi-kernel-headers
$ cd /usr/src
$ sudo ln -s linux-headers-4.14.79-v7+ linux
$ ls -la
total 16
drwxr-xr-x  4 root root 4096 Jan 23 18:19 .
drwxr-xr-x 10 root root 4096 Jan 23 18:19 ..
lrwxrwxrwx  1 root root   25 Jan 23 18:23 linux -> linux-headers-4.14.79-v7+
drwxr-xr-x 24 root root 4096 Jan 23 18:23 linux-headers-4.14.79+
drwxr-xr-x 24 root root 4096 Jan 23 18:23 linux-headers-4.14.79-v7+

Now get driver from git

$ git clone -b v5.6.4.2 https://github.com/aircrack-ng/rtl8812au.git
$ cd rtl*

Change headers in Makefile with below

$ sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
$ sed -i 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/g' Makefile

Once you’re done, compile

$ make
// should take something like 15 min
$ make install

After the driver is installed, confirm with:

$ dmesg | tail