rtl8812AU and/or rtl8814AU drivers


#82

There is any dual band or at least 5ghz USB WiFi adapter compatible with LEDE ? if I need to do a opkg install to a pkg in some URL with a precompiled is not a problem.


#83

AC no, AN yes, some ralink chipsets

https://wikidevi.com/wiki/Ralink_RT5572


#84

found these

https://www.aliexpress.com/item/Ralink-RT5572-300Mbps-802-11AC-2-4G-5G-dual-band-wireless-card-300M-wireless-n-USB/32796582521.html


#85

Should be ok, but you don't need something with external antenna?


#86

Ideally yes, these have small connectors but are not uFL type. Im using
these currently as a 2nd radio for home mesh nwtworking


#87

This one?
Netis WF2151


#88

Got rtl8812au to compile, but is missing symbols -
[ 63.446622] 8812au: Unknown symbol cfg80211_connect_bss (err 0)
[ 63.453448] 8812au: Unknown symbol __ieee80211_get_channel (err 0)

Kernel is 4.9.54, backports is 4.14-rc2 and module.symvers was copied from 4.14-rc2 backports. Interesting cfg80211_connect_bss is not listed in module.symvers.


#89

Finally giving up on Realtek. Here is what I have gathered. I did get it to compile and work after many hours.

Generally most any of the above repos for the plain 8812AU/14AU drivers work. I ended up with the one from aircrack-ng as that was version 5 and seemed to have lots of different options (8812AU, 8821AU, 8814AU, etc). To use it in LEDE, I applied two main patches. The first dealt with sta_info (as simple as changing #include <sta_info.h> to #include "sta_info.h" in drv_types.h). The second patch was more complicated. It involves patching ioctl_cfg80211.c for backports - ended up with 5 hunks there. Most of these patches have been documented in the repos above. Lastly the big/little-endian on x86 could have been a problem, but fortunately the Makefile for the rtl source code takes care of this in a lot of versions. Turning on debugging in the LEDE package makefile helps on the real hardware (see the driver Makefile for the proper CONFIG_xxxxx commands)

After successfully compiling and installing, I found that the driver doesn't fully support cfg80211. In particular the commands iw dev wlan0 del will delete the interface, but a iw phy phy0 interface add wlan0 type __ap doesn't work (it appears only type monitor is available - didn't look at all the driver repos to confirm if they all have it). The mac80211.sh (driver) makes use of these commands - it deletes the interface and tries to add it in. Without modification to this file the use of /etc/config/wireless to enable wifi is useless. I eventually got it to work, but I needed to two AP networks and since the driver doesn't fully support cfg80211 in particular adding a virtual interface, I gave up.

It is too bad that a majority of usb dongles are going the way of Realtek and they don't have a good driver yet or one that supports the needs of what one of things that LEDE is used for, an AP.


#90

Can you please share some tested instructions or working image?


#91

Driver development continuesfor RTL881xAU?
Especially interesting for RTL8811AU

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


#92

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


#93

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:


#94

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


#95

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


#96

No one new Realtek driver support command:

iw phy phy2 interface add wlan2 type __ap

The solution is here:


#97

Could you share the modified scripts?


#98

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.


#99

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:


#102

@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.


#103

@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.