Clone Driver

git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git
cd rtl8812AU_8821AU_linux

Install DKMS and Kernel headers

sudo apt install dkms raspberrypi-kernel-headers -y

Edit “Makefile”

vim Makefile

turn on “CONFIG_PLATFORM_ARM_PI” and turn off “CONFIG_PLATFORM_I386_PC”

CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = y

Compiling with DKMS

sudo make -f Makefile.dkms install

Compiling without DKMS you can use this command

make
sudo make install

Load module

sudo modprobe -a rtl8812au

Disable onboard WIFI

vim /boot/config.txt

add it to the last line

dtoverlay=pi3-disable-wifi