Rtl8812au and OpenWrt

Hi all,

since OpenWRT is lacking a driver for rtl8812au I am trying to integrate
such a driver I got from https://github.com/abperiasamy/rtl8812AU_8821AU_linux

Hardware: Mirabox (mvebu platform)
OpenWRT:  https://www.github.com/openwrt/openwrt
/etc/os-release 
NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="http://lede-project.org/"
BUG_URL="http://bugs.lede-project.org/"
SUPPORT_URL="http://forum.openwrt.org/"
BUILD_ID="r0-55f3731"
LEDE_BOARD="mvebu/cortexa9"
LEDE_ARCH="arm_cortex-a9_vfpv3"
LEDE_TAINTS="busybox"
LEDE_DEVICE_MANUFACTURER="OpenWrt"
LEDE_DEVICE_MANUFACTURER_URL="http://lede-project.org/"
LEDE_DEVICE_PRODUCT="Generic"
LEDE_DEVICE_REVISION="v0"
LEDE_RELEASE="OpenWrt SNAPSHOT r0-55f3731"

I managed to build it, but whan insmodding the module, I am getting
the following:

// ----------------------------------------------------------------------------------------------------------------
[83441.360649] WARNING: CPU: 0 PID: 3536 at backports-2017-11-01/net/wireless/core.c:730 wiphy_register+0x270/0x8dc [cfg80211]
[83441.371863] Modules linked in: rtl8812au(+) pppoe ppp_async pppox ppp_generic nf_conntrack_ipv6 iptable_nat ipt_REJECT ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD xt_CT slhc nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables crc_ccitt mwlwifi mac80211 cfg80211 compat ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables gpio_button_hotplug [last unloaded: rtl8812au]
[83441.434914] CPU: 0 PID: 3536 Comm: insmod Tainted: G        W       4.14.43 #0
[83441.442171] Hardware name: Marvell Armada 370/XP (Device Tree)
[83441.448062] [<c010f5c0>] (unwind_backtrace) from [<c010b2c8>] (show_stack+0x10/0x14)
[83441.455853] [<c010b2c8>] (show_stack) from [<c06183a8>] (dump_stack+0x88/0x9c)
[83441.463117] [<c06183a8>] (dump_stack) from [<c0121e00>] (__warn+0xe4/0x100)
[83441.470115] [<c0121e00>] (__warn) from [<c0121ecc>] (warn_slowpath_null+0x20/0x28)
[83441.477776] [<c0121ecc>] (warn_slowpath_null) from [<bf053b98>] (wiphy_register+0x270/0x8dc [cfg80211])
[83441.487674] [<bf053b98>] (wiphy_register [cfg80211]) from [<bfcf5bb4>] (rtw_wdev_alloc+0x110/0x248 [rtl8812au])
[83441.498658] [<bfcf5bb4>] (rtw_wdev_alloc [rtl8812au]) from [<bfcdd228>] (rtw_usb_if1_init+0xbc/0x1e8 [rtl8812au])
[83441.509803] [<bfcdd228>] (rtw_usb_if1_init [rtl8812au]) from [<bfcdd6a8>] (rtw_drv_init+0x354/0x424 [rtl8812au])
[83441.520458] [<bfcdd6a8>] (rtw_drv_init [rtl8812au]) from [<c048ddcc>] (usb_probe_interface+0x164/0x1b4)
[83441.529909] [<c048ddcc>] (usb_probe_interface) from [<c03d8458>] (really_probe+0x11c/0x27c)
[83441.538301] [<c03d8458>] (really_probe) from [<c03d8644>] (__driver_attach+0x8c/0xb0)
[83441.546170] [<c03d8644>] (__driver_attach) from [<c03d6be4>] (bus_for_each_dev+0x4c/0xa0)
[83441.554387] [<c03d6be4>] (bus_for_each_dev) from [<c03d7b60>] (bus_add_driver+0xe8/0x200)
[83441.562605] [<c03d7b60>] (bus_add_driver) from [<c03d8d88>] (driver_register+0xa8/0xe4)
[83441.570649] [<c03d8d88>] (driver_register) from [<c048d8e4>] (usb_register_driver+0x70/0x128)
[83441.579619] [<c048d8e4>] (usb_register_driver) from [<bfdcf0ac>] (init_module+0xac/0x1000 [rtl8812au])
[83441.589394] [<bfdcf0ac>] (init_module [rtl8812au]) from [<c0101afc>] (do_one_initcall+0xc0/0x184)
[83441.598325] [<c0101afc>] (do_one_initcall) from [<c0188484>] (do_init_module+0x60/0x1dc)
[83441.606457] [<c0188484>] (do_init_module) from [<c01878cc>] (load_module+0x1d48/0x20f0)
[83441.614500] [<c01878cc>] (load_module) from [<c0187da0>] (SyS_init_module+0x12c/0x164)
[83441.622460] [<c0187da0>] (SyS_init_module) from [<c0107940>] (ret_fast_syscall+0x0/0x54)
[83441.630655] ---[ end trace 17747186de764f45 ]---
[83441.635298] ------------[ cut here ]------------
[83441.640048] WARNING: CPU: 0 PID: 3536 at backports-2017-11-01/net/wireless/core.c:789 wiphy_register+0x594/0x8dc [cfg80211]
[83441.651259] Modules linked in: rtl8812au(+) pppoe ppp_async pppox ppp_generic nf_conntrack_ipv6 iptable_nat ipt_REJECT ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD xt_CT slhc nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables crc_ccitt mwlwifi mac80211 cfg80211 compat ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables gpio_button_hotplug [last unloaded: rtl8812au]
[83441.714303] CPU: 0 PID: 3536 Comm: insmod Tainted: G        W       4.14.43 #0
[83441.721558] Hardware name: Marvell Armada 370/XP (Device Tree)
[83441.727445] [<c010f5c0>] (unwind_backtrace) from [<c010b2c8>] (show_stack+0x10/0x14)
[83441.735235] [<c010b2c8>] (show_stack) from [<c06183a8>] (dump_stack+0x88/0x9c)
[83441.742498] [<c06183a8>] (dump_stack) from [<c0121e00>] (__warn+0xe4/0x100)
[83441.749495] [<c0121e00>] (__warn) from [<c0121ecc>] (warn_slowpath_null+0x20/0x28)
[83441.757152] [<c0121ecc>] (warn_slowpath_null) from [<bf053ebc>] (wiphy_register+0x594/0x8dc [cfg80211])
[83441.767051] [<bf053ebc>] (wiphy_register [cfg80211]) from [<bfcf5bb4>] (rtw_wdev_alloc+0x110/0x248 [rtl8812au])
[83441.778023] [<bfcf5bb4>] (rtw_wdev_alloc [rtl8812au]) from [<bfcdd228>] (rtw_usb_if1_init+0xbc/0x1e8 [rtl8812au])
[83441.789168] [<bfcdd228>] (rtw_usb_if1_init [rtl8812au]) from [<bfcdd6a8>] (rtw_drv_init+0x354/0x424 [rtl8812au])
[83441.799822] [<bfcdd6a8>] (rtw_drv_init [rtl8812au]) from [<c048ddcc>] (usb_probe_interface+0x164/0x1b4)
[83441.809273] [<c048ddcc>] (usb_probe_interface) from [<c03d8458>] (really_probe+0x11c/0x27c)
[83441.817666] [<c03d8458>] (really_probe) from [<c03d8644>] (__driver_attach+0x8c/0xb0)
[83441.825534] [<c03d8644>] (__driver_attach) from [<c03d6be4>] (bus_for_each_dev+0x4c/0xa0)
[83441.833750] [<c03d6be4>] (bus_for_each_dev) from [<c03d7b60>] (bus_add_driver+0xe8/0x200)
[83441.841969] [<c03d7b60>] (bus_add_driver) from [<c03d8d88>] (driver_register+0xa8/0xe4)
[83441.850011] [<c03d8d88>] (driver_register) from [<c048d8e4>] (usb_register_driver+0x70/0x128)
[83441.858981] [<c048d8e4>] (usb_register_driver) from [<bfdcf0ac>] (init_module+0xac/0x1000 [rtl8812au])
[83441.868743] [<bfdcf0ac>] (init_module [rtl8812au]) from [<c0101afc>] (do_one_initcall+0xc0/0x184)
[83441.877673] [<c0101afc>] (do_one_initcall) from [<c0188484>] (do_init_module+0x60/0x1dc)
[83441.885804] [<c0188484>] (do_init_module) from [<c01878cc>] (load_module+0x1d48/0x20f0)
[83441.893848] [<c01878cc>] (load_module) from [<c0187da0>] (SyS_init_module+0x12c/0x164)
[83441.901808] [<c0187da0>] (SyS_init_module) from [<c0107940>] (ret_fast_syscall+0x0/0x54)
[83441.909985] ---[ end trace 17747186de764f46 ]---
[83441.914627] RTL871X: Couldn't register wiphy device

// ----------------------------------------------------------------------------------------------------------------

Any hints I could follow to make the thing working?

I haven been able to build and install the same driver in an Arch Linux environment on the same hardware.
On that platform, WiFi works.

Thanks in advance!

Jax128, I'm working on the same thing and using the abperiasamy repo as you are. Maybe we can collaborate.

@castillofrancodamian may be interested, he needs the same driver. He may be willing to test.

See: RTL8812AU in OpenWrt

and: RTL8812AU without drivers

Hi Dears,

I’ve acquired a cheap USB 1200ac WiFi dongle lsusb says vendor Realtek product rtl8812au. I have a gl-inet ar150 to go with it. Absolutely willing to contribute to testing it in on openwrt. I am new to Linux and embedded Linux and openwrt but if you need people to test the driver on different devices feel free to sign me in. Bests P.

I noticed this wifi driver has been added to the sources,trying to make it work on a raspberry pi, on STA mode it scans and when it connects crash, on AP mode also crash ,my usb wfi divice is a trend tew-805ub

[73239.508164] usb 1-1.3: new high-speed USB device number 6 using dwc_otg
[73239.638971] usb 1-1.3: New USB device found, idVendor=20f4, idProduct=805b
[73239.647337] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[73239.656238] usb 1-1.3: Product: AC1200 Dual Band USB Adapter
[73239.663501] usb 1-1.3: Manufacturer: Realtek
[73239.669347] usb 1-1.3: SerialNumber: 123456
[73239.963960] RTL871X: rtw_ndev_init(wlan1)
[73240.983732] asix 1-1.1.3:1.0 eth1: link up, 100Mbps, full-duplex, lpa 0xC1E1
[73273.134916] br-lan: port 1(eth0) entered blocking state
[73273.142087] br-lan: port 1(eth0) entered forwarding state
[73371.218565] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[73468.449389] RTL871X: rtw_ndev_uninit(wlan1)

Crash log: https://pastebin.com/Ttz366JK

Could this FreeBSD driver be of any help ?

@Pipo Driver is in OpenWrt ,it can be installed if you are running the snapshots,in the description say for " Realtek 8812AU devices comfast 912ac, etc" I don't have that specific usb wifi adapter model to check

Screenshot_rtl8812

Evidently it failed to work on some of our internal regression tests too, but I
have not had time to investigate why. It is low-priority at the moment as I have
other higher priority things to work on. If someone figures it out, please send
me a patch.

Thanks,
Ben

1 Like

The driver is not working properly.

See: https://github.com/openwrt/openwrt/issues/8870