USB wifi device wth rtl8812au chipset is not working

I was able to successfully build the driver for rtl8812au as describe below.

  1. Get OSMC kernel source
sudo apt-get install  rbp2-headers-$(uname -r)
  1. Create soft link to kernel source
sudo ln -s /usr/src/rbp2-headers-$(uname -r) /lib/modules/$(uname -r)/build
  1. Clone rtl8812au source code and build
osmc@osmc:~/rtl8812au$ make
make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.19.55-6-osmc/build M=/home/osmc/rtl8812au  modules
make[1]: Entering directory '/usr/src/rbp2-headers-4.19.55-6-osmc'
  CC [M]  /home/osmc/rtl8812au/core/rtw_cmd.o
In file included from ./include/linux/compat.h:16:0,
                 from ./include/linux/ethtool.h:17,
                 from ./include/linux/netdevice.h:41,
                 from /home/osmc/rtl8812au/include/osdep_service_linux.h:35,
                 from /home/osmc/rtl8812au/include/osdep_service.h:41,
                 from /home/osmc/rtl8812au/include/drv_types.h:32,
                 from /home/osmc/rtl8812au/core/rtw_cmd.c:22:
./include/linux/if.h:28:54: fatal error: sys/socket.h: No such file or directory
 #include <sys/socket.h>   /* for struct sockaddr.  */
                                                      ^
compilation terminated.

  1. The reason for above build failure is some issue with socket.h included as part of osmc source files. I followed instructions given in Has anybody tried to install Wireguard? - #25 by rstein to download source from kernel.org and replace few inlcude files

Following are the steps:

wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.55.tar.xz
tar xf linux-4.19.55.tar.xz
  • Delete files in osmc include directory
sudo rm -r /usr/src/rbp2-headers-`uname -r`/include/linux/*
sudo cp -ar linux-4.19.55/include/linux/* /usr/src/rbp2-headers-`uname -r`/include/linux/
  1. Build rtl8812au driver
make clean
make
sudo ./install.sh

Driver built by above process is working fine.

1 Like