rtl8812AU and/or rtl8814AU drivers

Anyone built a driver for 8814au?
I've been trying to get this driver https://github.com/tpircher/rtl8814AU for nanopi neo2 board.
The source gets copied to the target build directory and seems to have been touched, but
it doesn't seem to get compiled.
I'm not very experience with this, just winging it.
Here's the makefile that I copied from rtl8812au-ct driver with some obvious changes.
If someone could correct it that would be great. :slight_smile:

include $(TOPDIR)/rules.mk
PKG_NAME:=rtl8814au
PKG_RELEASE:=1
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/tpircher/rtl8814AU.git
#PKG_MIRROR_HASH:=
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2019-02-18
PKG_SOURCE_VERSION:=12288c4a0939669df35b09ddfb3d1fb650211fa5
PKG_MAINTAINER:=User <user@nouse.com>
PKG_BUILD_PARALLEL:=1
#PKG_EXTMOD_SUBDIRS:=rtl8812au-ct
#PKG_SOURCE_SUBDIR=
#PKG_BUILD_DIR:=

STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtl8814au
SUBMENU:=Wireless Drivers
TITLE:=Driver for Realtek 8814 AU devices, etc
DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @!LINUX_3_18 @!LINUX_4_9
FILES:=\
$(PKG_BUILD_DIR)/rtl8814au.ko
AUTOLOAD:=$(call AutoProbe,rtl8814au)
PROVIDES:=kmod-rtl8814au
endef

NOSTDINC_FLAGS = \
-I$(PKG_BUILD_DIR) \
-I$(PKG_BUILD_DIR)/include \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-include backport/backport.h
NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT

define Build/Compile
+$(MAKE) $(PKG_JOBS) -C &quot;$(LINUX_DIR)&quot; \
$(KERNEL_MAKE_FLAGS) \
SUBDIRS=&quot;$(PKG_BUILD_DIR)&quot; \
NOSTDINC_FLAGS=&quot;$(NOSTDINC_FLAGS)&quot; \
modules
endef

$(eval $(call KernelPackage,rtl8814au))

My package makefile is located at /home/mhel/openwrt/openwrt-sdk-sunxi-cortexa53_gcc-7.4.0_musl.Linux-x86_64/feeds/packages/kernel/rtl8814au.
I installed it by ./scripts/feeds install -a and make menuconfig lists it in the wireles drivers,
Then build it with make -j=1 V=99 but the source Makefile doesn't seem to be triggered.

I think it's trying to execute make here:
Entering directory '/home/mhel/openwrt/openwrt-sdk-sunxi-cortexa53_gcc-7.4.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/linux-4.14.105'

which I think should be here:
/home/mhel/openwrt/openwrt-sdk-sunxi-cortexa53_gcc-7.4.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/rtl8814au-2019-02-18-12288c4a/

EDIT:
I have to admit defeat on this one...there's more to it than just being able to build.
I cross compiled the driver from the git instead, but unable to load the module..something with unrecognize symbol. I'll leave it as is for now and just find a supported adapter :blush:

1 Like

Hi,
I'm revisiting this post to inform that I have managed to
build an rtl8814au driver from here _https://github.com/aircrack-ng/rtl8812au.git .
There's so many git sources out there I tried a few before this one.
My asus usb-n13 is too slow, and the cheap MT7601u dongle I bought doesn't work
with built in driver even though it's supposed to. I tried one more time (well a few more times :slight_smile: ) and managed to get a working module, (kinda working).

I'm currently bringing up the interface manually using iw and hostapd. I don't know how to bring the interface up on boot yet. The wifi config detect the interface but when enabled it seems to crash the network interfaces. But I'm able to get the device running if I use hostapd, I have full wpad installed
on my nanopi neo2. I could get both bands running only one at a time. Apparently it's a limitation of the chip, it's either 2.4Ghz or 5Ghz but not both at the same time.

Now if I could get it working with LuCi that would be nice :slight_smile:

EDIT:
Forgot to mention, I'm running OpenWrt master with 4.19.34 kernel.

1 Like

Cross posting this from aircrack-ng github to hopefully gather more input.

I'm trying to make an access point out of an EDUP AC1621 rtl8814au based.
I managed to get the driver build against OWRT master kernel 4.19.34 for NanopiNeo2.
I can't bring the interface up using the usual OWRT way. The interface get's detected
and I can see the configuration in /etc/config/wireless get generated by "wifi config".
If I enable the wireless and restart the network it hangs,.

I know that the driver works because I can bring the interface up manually using ifconfig or iw,
and run hostapd with a basic configuration and have an access point. I can use either band of the device and it works.
I'd very much like to use LuCI to configure my wifi.
What should I be looking for to check what's causing the problem?

1 Like

Thanks. That clear things up. Still hoping for a work around .

It's now working for me.
And the fix is right here in this very same thread:

I can switch between bands, do a reboot and still working
It may not be the ideal fix, but works for me. :slight_smile:

Hi Mhel,

I am struggling with the rtl8814au as well. Not a developer nor a programmer. Just want the adapter working as an AP. Could you please share your Makefile? Tried a lot repo but none of them could pass the compile stage.

Many thanks!

1 Like

Hi I'm no programmer too just a hack.
Unfortunately, I haven't build for 8814au in a while since I switch to a dedicated AP and I tried to build a few times before I post this and no luck.
The makefile is basically derived from openwrt/package/kernel/rtl8812au-ct/Makefile
I'll post mine anyway, you might find something useful.


include $(TOPDIR)/rules.mk

PKG_NAME:=rtl8814au
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/aircrack-ng/rtl8812au.git
PKG_SOURCE_DATE:=2019-09-02
PKG_SOURCE_VERSION:=57871abeba6152c4b75778240caff889a17b0c2b
PKG_BUILD_PARALLEL:=1

STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtl8814au
  SUBMENU:=Wireless Drivers
  TITLE:=Realtek RTL8814AU support
  DEPENDS:= +kmod-usb-core +kmod-cfg80211 @USB_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SU$
  FILES:= $(PKG_BUILD_DIR)/88XXau.ko
  AUTOLOAD:=$(call AutoLoad,100,88XXau,1)
endef

NOSTDINC_FLAGS = \
        -I$(PKG_BUILD_DIR) \
        -I$(PKG_BUILD_DIR)/include \
        -I$(STAGING_DIR)/usr/include/mac80211-backport \
        -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
        -I$(STAGING_DIR)/usr/include/mac80211 \
        -I$(STAGING_DIR)/usr/include/mac80211/uapi \
        -include backport/backport.h

define Build/Compile
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
                ARCH="$(LINUX_KARCH)" \
                CROSS_COMPILE="$(TARGET_CROSS)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
                modules
endef

$(eval $(call KernelPackage,rtl8814au))

Depends on your target platform, I also had to make changes to the src Makefile to get something compiling. Last time I was able to build the module I think I had to remove -Werror in OpenWrt just to build the module, but can't remember were exactly.
This is as far as I was able to build untill I got an error:

./include/net/iw_handler.h:528:7: note: expected 'struct iw_event *' but argument is of type 'struct iw_event *'
 char *iwe_stream_add_point(struct iw_request_info *info, char *stream,
       ^~~~~~~~~~~~~~~~~~~~
./include/net/iw_handler.h: At top level:
./include/net/iw_handler.h:549:39: warning: 'struct iw_event' declared inside parameter list will not be visible outside of this definition or declaration
       char *value, char *ends, struct iw_event *iwe,
                                       ^~~~~~~~
In file included from /home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe/include/drv_types.h:30:0,
                 from /home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe/core/rtw_cmd.c:17:
/home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe/include/ieee80211.h:386:5: warning: "WIRELESS_EXT" is not defined, evaluates to 0 [-Wundef]
 #if WIRELESS_EXT < 17
     ^~~~~~~~~~~~
In file included from /home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe/core/rtw_cmd.c:17:0:
/home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe/include/drv_types.h:1510:23: error: field 'iwstats' has incomplete type
  struct iw_statistics iwstats;
                       ^~~~~~~
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:304: /home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe/core/rtw_cmd.o] Error 1
make[4]: *** [Makefile:1517: _module_/home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe] Error 2
make[4]: Leaving directory '/home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-4.19.69'
make[3]: *** [Makefile:1599: modules] Error 2
make[3]: Leaving directory '/home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe'
make[2]: *** [Makefile:46: /home/dell/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/rtl8814au-2019-09-02-57871abe/.built] Error 2
make[2]: Leaving directory '/home/dell/myfeeds/rtl8814au'
time: package/feeds/localfeed/rtl8814au/compile#4.05#1.12#4.79
make[1]: *** [package/Makefile:113: package/feeds/localfeed/rtl8814au/compile] Error 2
make[1]: Leaving directory '/home/dell/openwrt'
make: *** [/home/dell/openwrt/include/toplevel.mk:218: package/rtl8814au/compile] Error 2

I will try to keep building and see how far I can go.
BTW I build from git master.

yes, I also got werror warnings. what I found was if you delete the

NOSTDINC_FLAGS = \
        -I$(PKG_BUILD_DIR) \
        -I$(PKG_BUILD_DIR)/include \
        -I$(STAGING_DIR)/usr/include/mac80211-backport \
        -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
        -I$(STAGING_DIR)/usr/include/mac80211 \
        -I$(STAGING_DIR)/usr/include/mac80211/uapi \
        -include backport/backport.h

the compile will be success. but the module won't work.

I will post my Makefile and patches later

Drivers for RTL8812AU are included in OpenWrt 19.07.

You might want to check it here:

1 Like

Hi all

Is there any particular hint to make it to work?

I am using a rtl8812au dongle on Raspberri PI4 on snapshot

The dongle is recognized but the first strange thing comes from the configuration page, where in 5Ghz there is no possibility to change between AC and N mode.

But trying to bring up and access point in 5Ghz oe 2.4Ghz return hostpad errors and after a while the drivers is uninit

Bye

Try building the driver from this source:https://github.com/aircrack-ng/rtl8812au/pull/619
I had tested with rtl8811, rtl8812au and rtl8814au USB WiFi dongles, working well and has AC mode support.

How could I test that driver?

You have to download the source driver and cross compile or add it to OpenWrt Buildroot as a patch https://github.com/1Jeff1/openwrt/commit/5249b47cc4658ee78cb2a94362d3401cea90e9cd.patch

1 Like

Should I download the patch? In which directory?

From the root directory:

wget https://github.com/1Jeff1/openwrt/commit/5249b47cc4658ee78cb2a94362d3401cea90e9cd.patch

patch -p 1 -i 5249b47cc4658ee78cb2a94362d3401cea90e9cd.patch
2 Likes

Do they work as APs?
A drawback to Realtek was they didn't (same with Intel)... I think.

@jeff1 Are you able to give a look at the 8812BU driver and try to build it in Openwrt?
I tried but with no success, I have limited knowledge of Openwrt build system

BTW tried the driver built in the latest snapshot
Actually it is working as bad as the -ct one currently in the repo
I am not able to run it in AC mode, sometimes it works in N mode @2.4Ghz, but slow and for example there is no rate indication

I want to try this driver on the nanopi r2s, but I get this error when is compiling:

rtl8812au-ac-2020-05-20-fc0194c1/os_dep/linux/ioctl_cfg80211.c:10072:25: error: initialization of 'int (*)(struct wiphy *, struct wireless_dev *, u64)' {aka 'int (*)(struct wiphy *, struct wireless_dev *, long long unsigned int)'} from incompatible pointer type 'void (*)(struct wiphy *, struct wireless_dev *, u16,  bool)' {aka 'void (*)(struct wiphy *, struct wireless_dev *, short unsigned int,  _Bool)'} [-Werror=incompatible-pointer-types]
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
 ^~~~~~~~~~~~~~~~~~~
rtl8812au-ac-2020-05-20-fc0194c1/os_dep/linux/ioctl_cfg80211.o] Error 1