rtl8812AU and/or rtl8814AU drivers

Driver development continuesfor RTL881xAU?
Especially interesting for RTL8811AU

P.S.
rtl8812AU_8821AU linux kernel driver for AC1200 (801.11ac) Wireless Dual-Band USB Adapter

Hello,
I have seen that you have been able to compile the drivers, I am trying but I can not compile them.
Reading all the thread I have obtained the necessary material:
-SDK for compile, in my case 15.15.1 x86
-makefile for openwrt posted by you


-patches posted by you https://github.com/dl12345/rtl8812au
-driver https://github.com/astsam/rtl8812au/tree/v5.1.5

Unzip sdk and in the package folder I include the rtl8812au folder that contains:
original driver folders
I include the new makefile and the "patches" folder.

Now I execute:

/ scripts / feeds update -a OK
./scripts/feeds install rtl8812au
Argument "4.2.1" is not numeric in numeric ge (> =) at ./scripts/feeds line 25.
Argument "4.2.1" is not numeric in numeric ge (> =) at / root / Desktop / OpenWrt-SDK / scripts / feeds line 25.
ERROR: please fix package / rtl8812au / Makefile - see logs / package / rtl8812au / dump.txt for details
Collecting package info: done
Argument "4.2.1" is not numeric in numeric ge (> =) at / root / Desktop / OpenWrt-SDK / scripts / feeds line 25.
Argument "4.2.1" is not numeric in numeric ge (> =) at ./scripts/feeds line 25.
WARNING: No feed for package 'rtl8812au' found, maybe it's already part of the standard packages?

Can you help me compile the drivers?

I understand that once compiled the configuration is manual by wpa_supplicant and hostapd and it is not supported by luci, but this does not matter to me I can configure it manually.

Thank you
regards

i have these versions (along with v4.3.21 and v5.1.5) loaded up (and working in client mode, manually) OpenWrt r8313 (gcc7.3.0 mips74k ar71xx on Linux kernel 4.14.75) but i haven't tested with Luci yet to see if anything has changed. of course they required new patches (i don't have any posted in a repository currently) but i used the same Makefile as before, the new sources just need the correct patches applied. i'll test the new compiled versions with Luci tomorrow or the next day (most likely) and go from there or just report back with bad news (again).

Sat Oct 13 16:30:53 2018 kern.warn kernel: [   55.570480] rtl8812au v5.2.9.3_24903.20171101
Sat Oct 13 16:30:53 2018 kern.info kernel: [   55.575245] usbcore: registered new interface driver rtl8812au
########
Sat Oct 13 20:51:49 2018 kern.warn kernel: [   57.091450] rtl88xxau v5.2.20.2_28373.20180619
Sat Oct 13 20:51:50 2018 kern.info kernel: [   57.307981] usbcore: registered new interface driver rtl88xxau
########
Sat Oct 13 20:52:59 2018 kern.warn kernel: [   77.268607] rtl8812au v5.3.4_28226.20180614_COEX20171103-6c6d
Sat Oct 13 20:52:59 2018 kern.info kernel: [   77.477979] usbcore: registered new interface driver rtl8812au

(edit): so, i tried to test this in Client mode and it actually caused Luci to just derp out and just completely hang somewhat. I was able to reboot via cli but I will still need to do some more testing. it of course, so far, doesn't look promising. :frowning: I haven't had time to test the newer drivers in AP mode yet but the old ones had some trouble. It's unlikely changed, will try to report back soon as I can. :blossom:

I was able to compile rt8812au module (v4.3.21 and v5.1.5) on OpenWRT 18.06.2
However insmod failed:

root@ow:/tmp# insmod 8812au.ko
failed to insert 8812au.ko
root@ow:/tmp# dmesg
[ 8806.908038] 8812au: Unknown symbol cfg80211_connect_bss (err 0)
[ 8806.917259] 8812au: Unknown symbol __ieee80211_get_channel (err 0)
root@ow:/tmp#

How to fix the problem of symbol references? (unfortunately both functions do not exist in Module.symvers)

[solved] for RPI the kernel 4.9.x is in the OpenWRT v18.06.2 but rtl8812au driver required kernel 4.14.x

So i've had one of these sitting around and been wanting to give it a go........ ( tplink 4U something USB3 )

Just tested and it ran like a ***breeze***on master.......

[   97.407069] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[   98.062667] RTL871X: rtw_ndev_init(wlan2)

wlan2     unassociated  Mode:Managed  Frequency=2.412 GHz 


root@OpenWrt:/# lsmod | grep rtl
cfg80211              413696  4 ath10k_core,ath,rtl8812au,mac80211
rtl8812au            1175552  0


cat /sys/module/rtl8812au/drivers/usb:rtl8812au/1-1\:1.0/modalia
s 
usb:v2357p010Fd0000dc00dsc00dp00icFFiscFFipFFin00


root@OpenWrt:/# lsusb 
Bus 003 Device 002: ID 0bda:0109 Realtek Semiconductor Corp. microSDXC Card Reader [Hama 00091047]
Bus 001 Device 002: ID 2357:010f TP-Link

Despite the log.... just selected

kmodrtl8812U - in Kernel > Wireless

and went up to deselect mesh support in kmod-mac80211

Not sure if that made any difference but figured it might be asking a bit much......

+?CONFIG_PACKAGE_kmod-lib80211 is not set?
+CONFIG_PACKAGE_MAC80211_TRACING is not set ?
-MAC80211 mesh is set?

Hold my horses! Give me a few days to see about this thing..... She plugged well.... but I wanna play with the upper levels before I make final judgement........

Sun Feb 10 06:33:45 2019 kern.info kernel: [   97.407069] usb 1-1: new high-speed USB device number 2 using xhci
-hcd
Sun Feb 10 06:33:46 2019 kern.warn kernel: [   98.062667] RTL871X: rtw_ndev_init(wlan2)
Sun Feb 10 06:34:38 2019 daemon.err uhttpd[2721]: luci: accepted login on /admin/system/admin for root from 192.
168.1.7
Sun Feb 10 06:56:07 2019 kern.warn kernel: [ 1438.825773] RTL871X: rtw_ndev_uninit(wlan2)
Sun Feb 10 06:56:07 2019 user.notice mac80211: Failed command: iw phy phy2 set antenna all all
Sun Feb 10 06:56:07 2019 daemon.notice netifd: radio2 (8814): command failed: Not supported (-95)
Sun Feb 10 06:56:07 2019 user.notice mac80211: Failed command: iw phy phy2 set antenna_gain 0
Sun Feb 10 06:56:07 2019 daemon.notice netifd: radio2 (8814): command failed: No such device (-19)
Sun Feb 10 06:56:07 2019 user.notice mac80211: Failed command: iw phy phy2 interface add wlan2 type __ap
Sun Feb 10 06:56:07 2019 daemon.err hostapd: Configuration file: /var/run/hostapd-phy2.conf
Sun Feb 10 06:56:07 2019 daemon.err hostapd: Could not read interface wlan2 flags: No such device
Sun Feb 10 06:56:07 2019 daemon.notice hostapd: nl80211: Driver does not support authentication/association or c
onnect commands
Sun Feb 10 06:56:07 2019 daemon.notice hostapd: nl80211: deinit ifname=wlan2 disabled_11b_rates=0
Sun Feb 10 06:56:07 2019 daemon.err hostapd: Could not read interface wlan2 flags: No such device
Sun Feb 10 06:59:35 2019 daemon.notice hostapd: wlan2: interface state UNINITIALIZED->DISABLED
Sun Feb 10 06:59:35 2019 daemon.notice hostapd: wlan2: AP-DISABLED
Sun Feb 10 06:59:35 2019 daemon.notice hostapd: wlan2: CTRL-EVENT-TERMINATING
Sun Feb 10 06:59:35 2019 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan2 wasn't started
Sun Feb 10 06:59:35 2019 daemon.notice netifd: radio2 (10395): cat: can't open '/var/run/wifi-phy2.pid': No such
 file or directory
Sun Feb 10 06:59:35 2019 daemon.notice netifd: radio2 (10395): WARNING (wireless_add_process): executable path /
usr/sbin/wpad does not match process  path (/proc/exe)
Sun Feb 10 06:59:35 2019 daemon.notice netifd: radio2 (10395): Command failed: Invalid argument

I think there is some sort of switcheroo in the higher layers that has to be done on my end..... Above is a compile and plug output anyways.... ( ipq8065 - arm ) Gimme a day or two.

rtl8812au-ct-2018-11-16-661268fd.tar.xz
Linux OpenWrt 4.14.97 #0 SMP Wed Feb 6 05:39:39 2019 armv7l
r9272-26fcc937f7

No one new Realtek driver support command:

iw phy phy2 interface add wlan2 type __ap

The solution is here:

1 Like

Could you share the modified scripts?

1 Like

Might be a little bit off-topic, but the same family of problems/wireless devices so somewhat related. I have successfully compiled the RTL8189FTV driver with Linux 4.14 based Openwrt using Hauke Mertens uncommitted patches that include activating back ports:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh;h=bf9d52ae4203c294e25487f1678cfcd25e7a1dce;hb=HEAD#l465
After that I booted the openwrt image with a Orange PI zero plus (H5, Ethernet and RTL8189FTV) and the RTL8189FTV was detected. Using luci I could scan for WLANs, but after entering all the data, the mac80211.sh script destroys the interfaces as described.
I have renamed mac80211.sh, rebooted (otherwise the wireless is in a non working state) and successfully activated a static IP address connection as wireless station (or just a client) based on iwconfig, ifconfig and wpasupplicant. However, I haven't spent the time to rework the mac80211.sh script, but I can confirm what jgrulich wrote. Unfortunately for now luci wireless shows the wireless as not working, but at least it can be used.

Hope that helps.

1 Like

First I've made the following modification in the /package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh :

mac80211_interface_cleanup() {
	local phy="$1"

	for wdev in $(list_phy_interfaces "$phy"); do
		ip link set dev "$wdev" down 2>/dev/null
#		iw dev "$wdev" del
	done
} 

That disables to remove the interface and the AP may be created than. The rest modifications with ifconfig and iwconfig were used only for disabling and restart of the interface and are not important for debugging.

But this is working only with kernel 4.14.72 and older. The newer one results in kernel panic as described here:

1 Like

@jgrulich I have commented out the iw in the mac80211sh script as you described. But I have not used rtl8189fs.patch (I just created the Makefile and the two patch files from the link I have posted earlier).
With my Orange PI zero plus both the kernels 4.14.98 (which is the one that was selected when I checked out from openwrt git about a week ago) and 4.19.20 (with one change to the method signature of rtw_select_queue in os_intfs.c which is currently not part of the repository for rtl8189ftv that Hauke Mertens has used in his Makefile) work if, but I have just tested the initial created image and then use luci to configure a wlan station or client by using scan, enter the WPA password and do save&apply.
There were no reboots since yesterday with the 4.14.98 kernel and no reboots since one hour with 4.19.20, I just did a couple of wgets to test the bandwidth so far.

@kestrel It means that there need to be some issue in the rtl8189es.patch rtl8189fs.patch files. May I ask you for the Makefile and patch files you've exactly used to compare them?
And one newbie question, how to change the linux to 4.19? I've not found it in the menuconfig for the sunxi devices.

@kestrel Just compared the files created by the patch file and they are exactly same as the following ones:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=commit;h=7b419a743403f00374cc53c0067b464fd0510836
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=commit;h=46b6c11e5263e00397ac756173d517ea70bdb207

I was looking for your earlier link as you've mentioned, but nothing found.

I think after building the image for the first time, there is a target folder in your <build_root>, in that folder go to folder sunxi and edit Makefile, simply replace KERNEL_PATCHVER:=4.14 with KERNEL_PATCHVER:=4.19 and then go back to <build_root> and then you need to do make menuconfig without changing anything, just save and then build again. It will download the new kernel and build everything again based on the new kernel.

@jgrulich Yes, looks like there is no difference in the patches. But if you did git clone https://github.com/openwrt/openwrt.git I wonder why you did not get kernel 4.14.98 in the first place?

This way I know, but I don't like to directly modify any Makefiles files to be safe from any incompatibility from the source. And I was quite surprised that the Linux version was as a bolean in the menuconfig, but was not able to change it.

Now I have 4.14.95 and when used git pull, I received 4.14.99. I've updated the packages as well with make package/symlinks, make menuconfig and only save without changes. Than make -j4.

I got:

Firmware Version OpenWrt SNAPSHOT r9103+252-45a2771 / LuCI Master (git-19.046.39448-bd56c1a)
Kernel Version 4.14.99

Configured WiFi AP, WPA2 and passwd and stored.
Wireless status:

Type: MAC80211 802.11bgn
Channel: 11 (2.462 GHz)
Bitrate: -
[Signal: 0 dBm / Quality: 0%] SSID: OpenWrt
Mode: Master
Encryption: WPA2 PSK (CCMP)
Associations: -

But when try to connect, it hangs.

Edit: compiled the 4.19.21 kernel and the result is the same.
Edit 2: I've updated the rtl8189fs driver to the latest 2018-09-02 version, but no change, still hangs.
BTW, for sure, I've tested several boards, SD cards and power supply to eliminate it.

@jgrulich I have not tried AP mode, I am just using it as a WLAN client to Ethernet bridge. Then very likely in AP mode I will have the same issue.

@kestrel Please try the AP mode than if the issue appears.

@jgrulich Thanks for the mod,I got the rtl8812 usb wifi dongle working, based on your information, I build a snapshot image found on this commit: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e9d92bf1e1af71ff19e4cdc753de3f65963c58a5 tried on raspberry pi 3 b ,AP and STA are working.

Sun Feb 17 11:58:34 2019 kern.info kernel: [   50.571092] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
Sun Feb 17 11:58:34 2019 kern.info kernel: [   50.701852] usb 1-1.3: New USB device found, idVendor=20f4, idProduct=805b
Sun Feb 17 11:58:34 2019 kern.info kernel: [   50.711684] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sun Feb 17 11:58:34 2019 kern.info kernel: [   50.721881] usb 1-1.3: Product: AC1200 Dual Band USB Adapter
Sun Feb 17 11:58:34 2019 kern.info kernel: [   50.730294] usb 1-1.3: Manufacturer: Realtek
Sun Feb 17 11:58:34 2019 kern.info kernel: [   50.737193] usb 1-1.3: SerialNumber: 123456
Sun Feb 17 11:58:35 2019 kern.warn kernel: [   51.007966] RTL871X: rtw_ndev_init(wlan1)
Sun Feb 17 12:01:22 2019 user.notice mac80211: Failed command: iw phy phy1 set antenna all all
Sun Feb 17 12:01:22 2019 daemon.notice netifd: radio1 (1956): command failed: No such device (-19)
Sun Feb 17 12:01:22 2019 user.notice mac80211: Failed command: iw phy phy1 interface add wlan1 type __ap
Sun Feb 17 12:01:48 2019 daemon.err hostapd: Configuration file: /var/run/hostapd-phy1.conf
Sun Feb 17 12:01:48 2019 kern.info kernel: [  244.440981] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
Sun Feb 17 12:01:48 2019 kern.info kernel: [  244.451809] br-lan: port 2(wlan1) entered blocking state
Sun Feb 17 12:01:48 2019 kern.info kernel: [  244.459504] br-lan: port 2(wlan1) entered disabled state
Sun Feb 17 12:01:48 2019 kern.info kernel: [  244.467434] device wlan1 entered promiscuous mode
Sun Feb 17 12:01:48 2019 daemon.notice hostapd: wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
Sun Feb 17 12:01:48 2019 daemon.notice hostapd: wlan1: interface state COUNTRY_UPDATE->HT_SCAN
Sun Feb 17 12:01:49 2019 daemon.notice hostapd: Switch own primary and secondary channel to get secondary channel with no Beacons from other BSSes
Sun Feb 17 12:01:49 2019 daemon.err hostapd: Using interface wlan1 with hwaddr xx:xx:97:2f:41:b0 and ssid "RTL8812"
Sun Feb 17 12:01:49 2019 kern.warn kernel: [  245.352631] RTL871X: assoc success
Sun Feb 17 12:01:49 2019 kern.info kernel: [  245.357126] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Sun Feb 17 12:01:49 2019 kern.info kernel: [  245.364687] br-lan: port 2(wlan1) entered blocking state
Sun Feb 17 12:01:49 2019 kern.info kernel: [  245.371074] br-lan: port 2(wlan1) entered forwarding state
Sun Feb 17 12:01:49 2019 daemon.notice hostapd: wlan1: interface state HT_SCAN->ENABLED
Sun Feb 17 12:01:49 2019 daemon.notice hostapd: wlan1: AP-ENABLED
Sun Feb 17 12:01:49 2019 kern.warn kernel: [  245.379354] RTL871X: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:AES
Sun Feb 17 12:01:49 2019 daemon.notice netifd: Network device 'wlan1' link is up
Sun Feb 17 12:02:21 2019 daemon.info hostapd: wlan1: STA xx:xx:a2:58:32:09 IEEE 802.11: associated
Sun Feb 17 12:02:21 2019 kern.warn kernel: [  277.395952] RTL871X: send eapol packet
Sun Feb 17 12:02:21 2019 kern.warn kernel: [  277.403077] RTL871X: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:AES
Sun Feb 17 12:02:21 2019 kern.warn kernel: [  277.427971] RTL871X: send eapol packet
Sun Feb 17 12:02:21 2019 daemon.notice hostapd: wlan1: AP-STA-CONNECTED xx:xx:a2:58:32:09
Sun Feb 17 12:02:21 2019 daemon.info hostapd: wlan1: STA xx:xx:a2:58:32:09 RADIUS: starting accounting session 8FE7BE82C78E5CD9
Sun Feb 17 12:02:21 2019 daemon.info hostapd: wlan1: STA xx:xx:a2:58:32:09 WPA: pairwise key handshake completed (RSN)
Sun Feb 17 12:02:21 2019 kern.warn kernel: [  277.435945] RTL871X: set pairwise key camid:4, addr:xx:xx:a2:58:32:09, kid:0, type:AES
Sun Feb 17 12:02:21 2019 daemon.info dnsmasq-dhcp[1119]: DHCPREQUEST(br-lan) 192.168.1.199 xx:xx:a2:58:32:09
Sun Feb 17 12:02:21 2019 daemon.info dnsmasq-dhcp[1119]: DHCPACK(br-lan) 192.168.1.199 xx:xx:a2:58:32:09 iPhone-SE
1 Like

@jeff1 Good to know. Yes I've tested this snapshot version on several different boards and WiFi devices and it works. But it's the really latest commit which works, because the exactly next one commit is mac80211: rebase ontop of v4.18.5 which is not compatible with the mentioned drivers and cause the kernel panic.
It's confirmed, that there is not issue with the kernel itself and it works with the latest 4.14.99 kernel too.
See this: