rtl8812AU and/or rtl8814AU drivers

How you did the build, kernel 4.9 is assigned for RPI3 in this git version (8812au required 4.14)

I've used the Armbian kernel and most of the system works well, included the WiFi:

Hostname OpenWrt
Model Xunlong Orange Pi Zero
Architecture ARMv7 Processor rev 5 (v7l)
Firmware Version OpenWrt SNAPSHOT unknown / LuCI Master git-19.046.56017-7f791e9)
Kernel Version 4.19.20-sunxi

Exactly it's running on OPi-R1 board, not Zero.

But there are missing some OpenWrt specific kernel modules which are not available in Armbian and need to be replaced by some Armbian alternative:

root@OpenWrt:~# dmesg | grep "kmodloader: failed to load"
[    9.673861] kmodloader: failed to load rtc-sunxi
[   10.025866] kmodloader: failed to load crc-ccitt
[   10.063430] kmodloader: failed to load nf_conntrack_rtcache
[   10.063720] kmodloader: failed to load nf_flow_table_hw
[   10.068321] kmodloader: failed to load xt_FLOWOFFLOAD

Another, but not so important issue is the LED triggering which omits netdev/wlan0 status which indicates the WiFi working.

@Piorun2002 Yes you right, kernel need to be upgrade to 4.14 on that snapshot or build on master with mac80211 driver from 2017-11-01,you can take at look at my source:

@jgrulich I had a look at the kernel config in openwrt and tried to activate mac80211, after building the kernel I got duplicate symbol problems cfg80211_something during startup. So my guess is, that in armbian, parts of the cfg80211 layer from the net/mac80211 sources is used, but in openwrt the kernel builtin cfg80211 is used, which causes the differences. If I have some time, I will further research that.

Which versions / tags I should download exactly to build openwrt for RPI with 8812au?

@kestrel In fact, fully featured mac80211 is not needed, but only cfg80211, which is only part of it.
Not sure, seems that before version 2017-11-01 the source was standalone modified source inside the openwrt and from 4.18.5 it is from mainline Linux source and there is missing some openwrt compatibility patch for older versions of the drivers.

@Piorun2002 you have to build on master.I uploaded the image file for the RBP with the rtl8812au :
RPI RTL8812au

Careful here, the whole wireless subsystem in OpenWrt is not provided by the kernel (where these Kconfig symbols are disabled), but by an external backports (mac80211) package - third party wireless drivers need to be build against these backports (roughly 4.14 based for 18.06.x (including for targets running kernel 4.9), currently 4.19.x based for master).

Yes, that's correct. The cfg80211 is derived from the backport drivers, the latest is this one:

https://mirrors.edge.kernel.org/pub/linux/kernel/projects/backports/stable/v4.19.23/

The version 2017-11-01 comes from 4.14 backports from here:

https://mirrors.edge.kernel.org/pub/linux/kernel/projects/backports/stable/v4.14-rc2/

and is working for all 4.14 OpenWrt versions included the latest master, but 4.19 is not supported at all by this backport version and OpenWrt patch set need to be updated to bring the latest backports to work with the new drivers.

BTW, what are advantages of backported drivers compared with the mainline sunxi-kernel with all it's patches? As confirmed, wifi is working much better there.

Thx :slight_smile: kernel is 4.14.101 and the 8812au works fine (sta and ap).
How to setup 802.11ac mode or only hwmodes '11a' and '11g' are supported?

root@gw:/# iwinfo wlan0 info
wlan0     ESSID: "XX"
          Access Point: 00:0F:00:xx:xx:xx
          Mode: Master  Channel: 3 (2.422 GHz)
          Tx-Power: 12 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11abgn
          Hardware: unknown [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: no  PHY name: phy0
root@gw:/# iwinfo wlan0 htmodelist
HT20 HT40

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
#       option channel '36'
#       option hwmode '11a'
       option channel '3'
       option hwmode '11g'
       option htmode 'VHT20'

Update: compilation of TOR client failed, however after upgrade to 3.5.8 is ok

The ac mode is not supported by the backported Generic mac80211 driver now as you see it in your post: HW Mode(s): 802.11abgn

Yesterday I've received important information about the driver support from Hauke Mehrtens: "Hi Jan, I do not plan to invest any more time into the Realtek drivers, they are in the reposetory just to have a backup."
Means that for now the Realtek drivers are working only fro 4.14 kernel and there is no support for 4.19, or 5.00 kernels.

I have now managed to get the rtl8812 driver compiled and running on x86 4.19 and 4.14 kernels only by updating the driver from abperiasamy repo latest commit, so not all issues are related to the mac80211 backports.
here an iperf test:

root@OpenWrt:~# uname -a
Linux OpenWrt 4.19.24 #0 SMP Sat Feb 23 23:58:20 2019 x86_64 GNU/Linux
root@OpenWrt:~# opkg list-installed | grep kmod-rtl8812au-ct
kmod-rtl8812au-ct - 4.19.24+2019-02-21-42f148ce-1
root@OpenWrt:~# opkg list-installed | grep mac80211
kmod-mac80211 - 4.19.24+4.19.23-1-3
root@OpenWrt:~# iwinfo phy0 info
phy0      ESSID: unknown
          Access Point: 18:EB:97:ZF:41:YX
          Mode: Master  Channel: 161 (5.805 GHz)
          Tx-Power: 12 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11abgn
          Hardware: unknown [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: no  PHY name: phy0

root@OpenWrt:~# iperf3 -c 192.168.1.151
Connecting to host 192.168.1.151, port 5201
[  5] local 192.168.1.1 port 60576 connected to 192.168.1.151 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.9 MBytes   100 Mbits/sec    0    468 KBytes       
[  5]   1.00-2.00   sec  10.3 MBytes  86.5 Mbits/sec    0    494 KBytes       
[  5]   2.00-3.00   sec  10.4 MBytes  87.6 Mbits/sec    0    519 KBytes       
[  5]   3.00-4.00   sec  10.7 MBytes  89.7 Mbits/sec    0    547 KBytes       
[  5]   4.00-5.00   sec  10.4 MBytes  87.6 Mbits/sec    0    581 KBytes       
[  5]   5.00-6.00   sec  9.63 MBytes  80.8 Mbits/sec    0    581 KBytes       
[  5]   6.00-7.00   sec  9.82 MBytes  82.4 Mbits/sec    0    581 KBytes       
[  5]   7.00-8.00   sec  10.8 MBytes  90.6 Mbits/sec    0    581 KBytes       
[  5]   8.00-9.00   sec  9.77 MBytes  82.1 Mbits/sec    0    819 KBytes       
[  5]   9.00-10.00  sec  10.0 MBytes  83.9 Mbits/sec    0    819 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   104 MBytes  87.1 Mbits/sec    0             sender
[  5]   0.00-10.00  sec   101 MBytes  84.9 Mbits/sec                  receiver

iperf Done.

1 Like

Did you try driver 5.2.20.2 https://github.com/gordboy/rtl8812au

Works fine with 5.0-rc2 kernel. Source now builds with no warnings or errors.

Greatly improved stability due to huge rewrite of phydm - "4 second glitch" seems to have been fixed, or at least vastly reduced, in driver version 5.2.20.2.

Is there any possibility of using the card in the two-band mode, i.e. get two bands at the same time: wlan0_for_2.4Ghz and wlan1__for_5ghz

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 .