rtl8812AU and/or rtl8814AU drivers

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

I updated the rtl8812au-ac driver, It should work now.
https://github.com/1Jeff1/openwrt/commit/af426db0e78c3880a6bfe26fa97ae03caccce783.patch

3 Likes

Thanks @jeff1 I was able to compile the WiFi driver for the NanoPi R2S and confirm working with my dongle Alfa AWUS036ACS with no issues at all, also this driver works better than the one used on friendlywrt as this support AC WiFi.

How did you set it up? By CLI or GUI?

I set it up using GUI, I'm not familiarized with CLI.

I mean by LuCI? Because I have an Archer T4UHP with the rtl8812au chipset and it doesn't work.

@jeff1
I managed to compile your rtl8812au-ac driver package as single package for 19.07.3 on a Archer C2600 (have modified 0003-wireless-5.8.patch to match the older kernel code). The driver can do a successful scan on my ASUS USB-AC56 wifi device (after having problems with the delivered rtl8812au-ct driver).

The problem is, that I am not able to successfully connect to a hotspot:

root@Gate:~# logread | grep -e radio2 -e wlan4wan2 -e wwan2
Sun Aug  9 18:30:00 2020 cron.info crond[1026]: USER root pid 14653 cmd /usr/sbin/hotspot-login wlan4wan2>/dev/null
Sun Aug  9 18:45:00 2020 cron.info crond[1026]: USER root pid 25764 cmd /usr/sbin/hotspot-login wlan4wan2>/dev/null
Sun Aug  9 18:52:21 2020 daemon.notice netifd: Interface 'wwan2' is disabled
Sun Aug  9 18:52:21 2020 daemon.notice netifd: Interface 'wwan2' has link connectivity loss
Sun Aug  9 18:52:21 2020 daemon.notice netifd: wwan2 (25295): udhcpc: received SIGTERM
Sun Aug  9 18:52:21 2020 daemon.notice netifd: Interface 'wwan2' is now down
Sun Aug  9 18:52:21 2020 daemon.notice wpa_supplicant[25221]: wlan4wan2: CTRL-EVENT-DISCONNECTED bssid=ec:58:ea:12:10:88 reason=3 locally_generated=1
Sun Aug  9 18:52:21 2020 daemon.notice wpa_supplicant[25221]: nl80211: deinit ifname=wlan4wan2 disabled_11b_rates=0
Sun Aug  9 18:52:21 2020 daemon.notice wpa_supplicant[25221]: wlan4wan2: CTRL-EVENT-TERMINATING
Sun Aug  9 18:52:22 2020 daemon.notice netifd: radio2 (31285): command failed: Not supported (-95)
Sun Aug  9 18:52:22 2020 kern.info kernel: [ 8665.496512] IPv6: ADDRCONF(NETDEV_UP): wlan4wan2: link is not ready
Sun Aug  9 18:52:22 2020 daemon.notice netifd: Network device 'wlan4wan2' link is up
Sun Aug  9 18:52:22 2020 daemon.notice netifd: Interface 'wwan2' is enabled
Sun Aug  9 18:52:22 2020 daemon.notice netifd: Interface 'wwan2' has link connectivity
Sun Aug  9 18:52:22 2020 daemon.notice netifd: Interface 'wwan2' is setting up now
Sun Aug  9 18:52:22 2020 daemon.notice netifd: wwan2 (31551): udhcpc: started, v1.30.1
Sun Aug  9 18:52:22 2020 daemon.notice netifd: wwan2 (31551): udhcpc: sending discover
Sun Aug  9 18:52:27 2020 daemon.notice netifd: wwan2 (31551): udhcpc: sending discover
Sun Aug  9 18:52:27 2020 daemon.notice wpa_supplicant[31463]: wlan4wan2: Trying to associate with ec:58:ea:12:10:88 (SSID='WiFi4rlp' freq=2437 MHz)
Sun Aug  9 18:52:27 2020 daemon.notice wpa_supplicant[31463]: wlan4wan2: CTRL-EVENT-STARTED-CHANNEL-SWITCH freq=2437 ht_enabled=1 ch_offset=0 ch_width=20 MHz cf1=2437 cf2=0
Sun Aug  9 18:52:29 2020 daemon.notice wpa_supplicant[31463]: wlan4wan2: Associated with ec:58:ea:12:10:88
Sun Aug  9 18:52:29 2020 daemon.notice wpa_supplicant[31463]: wlan4wan2: CTRL-EVENT-CONNECTED - Connection to ec:58:ea:12:10:88 completed [id=0 id_str=]
Sun Aug  9 18:52:29 2020 daemon.notice wpa_supplicant[31463]: wlan4wan2: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Sun Aug  9 18:52:29 2020 kern.info kernel: [ 8672.120113] IPv6: ADDRCONF(NETDEV_CHANGE): wlan4wan2: link becomes ready
Sun Aug  9 18:52:31 2020 user.notice mwan3[32642]: Execute ifdown event on interface wwan2 (unknown)
Sun Aug  9 18:52:31 2020 user.info mwan3track[3548]: Detect ifdown event on interface wwan2 (wlan4wan2)
Sun Aug  9 18:52:31 2020 user.notice mwan3track[3548]: Interface wwan2 (wlan4wan2) is offline
Sun Aug  9 18:52:32 2020 daemon.notice netifd: wwan2 (31551): udhcpc: sending discover
config wifi-device 'radio2'
        option path 'platform/soc/soc:usb30@1/10000000.dwc3/xhci-hcd.1.auto/usb4/4-1/4-1:1.0'
        option type 'mac80211'
        option htmode 'VHT80'
        option country 'DE'
        option channel '6'
        option hwmode '11g'

config wifi-iface 'wwan2'
        option device 'radio2'
        option ifname 'wlan4wan2'
        option network 'wwan2 wwan2_6'
        option mode 'sta'
        option ssid 'WiFi4rlp'
        option encryption 'none'
        option macaddr 'XX:XX:XX:XX:XX:XX'
config interface 'wwan2'
        option proto 'dhcp'
        option hostname 'android-xxxxxxxxxx'
        option macaddr 'XX:XX:XX:XX:XX:XX'
        option metric '2'
        option peerdns '0'
        list dns '8.8.8.8'
        list dns '1.1.1.1'
        list dns '8.8.4.4'
        list dns '1.0.0.1'

config interface 'wwan2_6'
        option ifname '@wwan2'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'
        option metric '2'

Any idea why the wifi disconnects directly? The same config works on a other device.

Thanks for creating this patch and for using the aircrack driver! I am able to scan!
Haven't previously been able to do that.

Likewise, a lot cannot be done because it does not work well.

Yeah, I can't connect either with the patch he posted but it scans and this is the first patch I've seen using the aircrack source for openwrt. I know aircrack drivers work in client mode on arch linux so I think it's a step in the right direction at least.

1 Like

It connect only to encrypted networks, some parameter seems to be missing that make it look on the web UI that is not connected.

root@OpenWrt:/# iwconfig wlan0
wlan0     IEEE 802.11AC  ESSID:"XXX_5GHz"  
          Mode:Managed  Frequency:5.765 GHz  Access Point: 90:C8:A0:09:1E:9A
          Bit Rate:434 Mb/s   
          RTS thr:off   Fragment thr:off
          Encryption key:****-****-****-****-****-****-****-****   Security mode:open
          Power Management:off
          Link Quality=37/100  Signal level=68/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Hi,

trying to compile the RTL8812AU driver but I cant find:

compat-wireless "Module.symvers" located in build_dir/target.../linux-.../compat-wireless into the folder "staging_dir/target.../usr/include/mac80211/Module.symvers" as to allow proper linking

I have copied the driver to the proper location and I can find it in make menuconfig

I am building OpenWrt 19.07.2 for x86 on Ubuntu 20...

I get this error:

 from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/core/rtw_cmd.c:22:
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/osdep_service.h: In function 'thread_enter':
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/osdep_service.h:343:2: error: implicit declaration of function 'allow_signal'; did you mean 'do_signal'? [-Werror=implicit-function-declaration]
  allow_signal(SIGTERM);
  ^~~~~~~~~~~~
  do_signal
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/osdep_service.h: In function 'flush_signals_thread':
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/osdep_service.h:353:6: error: implicit declaration of function 'signal_pending'; did you mean 'timer_pending'? [-Werror=implicit-function-declaration]
  if (signal_pending (current))
      ^~~~~~~~~~~~~~
      timer_pending
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/osdep_service.h:355:3: error: implicit declaration of function 'flush_signals'; did you mean 'do_signal'? [-Werror=implicit-function-declaration]
   flush_signals(current);
   ^~~~~~~~~~~~~
   do_signal
In file included from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/drv_types.h:35:0,
                 from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/core/rtw_cmd.c:22:
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/wifi.h: At top level:
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/wifi.h:994:0: warning: "IEEE80211_MAX_AMPDU_BUF" redefined
 #define IEEE80211_MAX_AMPDU_BUF 0x40
 
In file included from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/staging_dir/target-x86_64_musl/usr/include/mac80211/net/cfg80211.h:24:0,
                 from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/osdep_service_linux.h:81,
                 from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/osdep_service.h:41,
                 from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/include/drv_types.h:32,
                 from /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/core/rtw_cmd.c:22:
/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/staging_dir/target-x86_64_musl/usr/include/mac80211/linux/ieee80211.h:1442:0: note: this is the location of the previous definition
 #define IEEE80211_MAX_AMPDU_BUF  0x100
 
cc1: some warnings being treated as errors
make[6]: *** [scripts/Makefile.build:327: /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/core/rtw_cmd.o] Error 1
make[5]: *** [Makefile:1542: _module_/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13] Error 2
make[5]: Leaving directory '/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/linux-4.14.171'
make[4]: *** [Makefile:1576: modules] Error 2
make[4]: Leaving directory '/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13'
make[3]: *** [Makefile:84: /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-2016-12-13/.built] Error 2
make[3]: Leaving directory '/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/package/kernel/rtl8812au'
time: package/kernel/rtl8812au/compile#1.95#0.32#2.15
make[2]: *** [package/Makefile:113: package/kernel/rtl8812au/compile] Error 2
make[2]: Leaving directory '/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2'
make[1]: *** [package/Makefile:107: /home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2'
make: *** [/home/lordrayden/OpenWrt/Rooter19072/rooter1907-2/include/toplevel.mk:227: world] Fehler 2

How can I resolve this?

I tried the driver above, and it works.

In my environment, it cannot run AC & AP mode (and reboot is required if switch from one to another) at the same time, and the LuCI seemed not right as some info may not provided correctly by driver or we cannot identify it.

Howerver, it's really a bit step supporting RTL firmwares, hoping it would be better in the future.

Thank you so much Jeff. Much appreciated for your work. This patch works really well with the latest snapshot of OpenWRT. I'm using the ALFA Awus1900 USB wifi.

Keep up the good work. Please let us know if you have any more new patches.

Thank you

Just doing some comparison with my WRT1900acs V2 running the latest OpenWRT snapshot. I have the ALFA Awus1900 USB wifi connect at the back of the WRT1900acs usb port.

This is a 5Ghz stock test no tweaking or tuning on the WRT1900 wifi and the ALFA wifi.

WRT1900acs V2 @ 5Ghz wifi

ALFA Awus1900 USB @ 5Ghz wifi

Check the pings!
Jeff's driver is a blessing in the skies. Thanks again Jeff! :smiley: