rtl8812au driver install..
#1
So bear with me here got to get the fix.  I don't like re-inventing the wheel but was unable to find a driver that was built for the RTL8812AU adaper in the store, I bought one, mainly for 5GHz band as well as 2.4 it does not work out of the box on the artful build (ayufan's) since he is one of the main kernel grinders, I looked there first... did not see anything, for the RTL8812AU.  I was plenty of questions, but no working solutions... so.. did some digging, most driver code is a base, as drivers are added, and just functions are added or adapted, rarely is a whole driver written if a similar one exists.

As it happens, in my search, I ran across this: http://xhyumiracle.com/how-to-install-rt...-adapters/

So, I gave it a try..., ran into error(s), most were warnings, those are not uncommon, I like to get rid of them,but mostly at this level they are informative, rather than deadly... I like no warnings, but with any portable code shared among several builds, and probably at this age several compile versions, you will see them... So, most of the warning were simply generated from older 'C' coding..., the main thing to me in maintaining code is some notion to 'overcode' if it works on similar or elsewhere, it is probably not a complicated fix.

That was the case on this... it terminated with an error:

include/linux/sched.h:1198:42: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
 const struct sched_group_energy * const(*sched_domain_energy_f)(int cpu);
                                          ^
/root/rtl8812AU/core/rtw_br_ext.c: In function 'nat25_db_handle':
/root/rtl8812AU/core/rtw_br_ext.c:1444:28: error: implicit declaration of function 'csum_ipv6_magic' [-Werror=implicit-function-declaration]
         hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
                            ^
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/root/rtl8812AU/core/rtw_br_ext.o' failed

The fatal error in the compile was this (if you are a coder)...:



/root/rtl8812AU/core/rtw_br_ext.c:1444:28: error: implicit declaration of function 'csum_ipv6_magic' [-Werror=implicit-function-declaration]
         hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,


                            ^


Did some digging in header files...experience has taught me more often than not with 'development' be developed on these days, someone probably improved the code in some other place..., here is the fix:

in core/rtw_br_ext.c I added the following after digging...

 ******************************************************************************/
#define _RTW_BR_EXT_C_



#ifdef __KERNEL__

#include <linux/if_arp.h>

#include <net/ip.h>

#include <net/ipx.h>



/**********************************************/

/* added here                                                            */

#ifndef _CHECKSM_IPV6_H

#include <net/ip6_checksum.h>

#endif

/**********************************************/

#include <linux/atalk.h>

#include <linux/udp.h>
#include <linux/if_pppox.h>




(Actually I didn't put in the spaces and comments, I did here so others could see the surrounding code, but the fix was not at line 1444, it was the inclusion of a now independent header file that apparently did not exist on the building machine of the original code or it was in an included header file)

Earlier, I questioned about manifest defines, in actuality, the is a linux fix, but it is at the Linux level, not the actual low level code writing, and it works.  So if someone want to include it in a distributed, please help yourself, you can add other defines if necessary, I suppose you could tighten it up more, but the above put in the manifest define for the header, without changing the code generously, and this was for the 'artful' load, not previous loads... so since these are somewhat experimental boards, either way it was a good excercise, and it works on the rock64 under artful where it previously was unavailable with the build.

I saved the broken make (make.out), and I saved the one that worked..(make.good)

Following the instructions on the above URL do not work did not work out of the box, as my CROSS_COMPILE was set to aarch64, ayufan's is arm64 so, I made it simple, rather than digging reconfiguring, etc, etc by doing the simplest change at the shell:

export ARCH=arm64<enter>

That said - I don't care what your CROSS_COMPILE ARCH is, override it. (I am lazy... guess I should fix my cross compiler)..

using the gcc-5 that it prompted me to use, was easy as well (geeze been away from this along time, I am not on board with Tim Cook, everybodyisn't a coder, in fact most get too intimidated by very verbose error messages... too many coders create too many of everything..., about 4-5 different 'current' version of gcc these days. 8 years ago we were only using a couple).... I pulled gcc-5.

I compile with the following added on and go watch tv while it compiles..

make all (all is mostly) 2>&1 | tee <make.out>


With the correction, 

make CC=/usr/bin/gcc-5 2>&1 | tee make.good

ended with:

include/linux/sched.h:1198:42: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
 const struct sched_group_energy * const(*sched_domain_energy_f)(int cpu);
                                          ^
  LD [M]  /root/rtl8812AU/8812au.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.4.77-rockchip-ayufan-136'

The kernel module!!!!!



Followed by a:

make CC=/usr/bin/gcc-5 install <- this installs the kernel module...

So, I never hand setup a wireless on linux, that is another story, however I had to configure wpa_supplicant, I won't go into that here, but there is always a first time.

here is the end result (I am logged in on the wireless, it is connected... we will see how good the code is..., wearing it in now):

root@rock64:~/rtl8812AU# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 114  bytes 8427 (8.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 114  bytes 8427 (8.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.88.166  netmask 255.255.255.0  broadcast 192.168.88.255
        ether 08:10:7a:66:b5:4f  txqueuelen 1000  (Ethernet)
        RX packets 4827  bytes 592210 (592.2 KB)
        RX errors 0  dropped 15  overruns 0  frame 0
        TX packets 1467  bytes 365926 (365.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@rock64:~/rtl8812AU# 

root@rock64:~/rtl8812AU# lsusb
Bus 005 Device 003: ID 05e3:0617 Genesys Logic, Inc. 
Bus 005 Device 002: ID 05e3:0617 Genesys Logic, Inc. 
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 004: ID 0bda:8812 Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac WLAN Adapter
Bus 004 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 004 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@rock64:~/rtl8812AU# 

oot@rock64:~/rtl8812AU# wpa_cli
wpa_cli v2.4
Copyright © 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.


Selected interface 'wlan0'

Interactive mode

> list_networks
network id / ssid / bssid / flags
0 Puke_5GHz any [CURRENT]


AND the wired is disconnected, and it is running through usb3.0 7 port bus.


Now, I do know this works... (mine does Smile   )

If you want more info. please advise I will attempt to assist.

Maybe next attempt will be AP mode for this...
 


Attached Files
.zip   makes.zip (Size: 3.85 KB / Downloads: 142)
  Reply
#2
(02-24-2018, 09:43 PM)11b2p508 Wrote: So bear with me here got to get the fix.  I don't like re-inventing the wheel but was unable to find a driver that was built for the RTL8812AU adaper in the store, I bought one, mainly for 5GHz band as well as 2.4 it does not work out of the box on the artful build (ayufan's) since he is one of the main kernel grinders, I looked there first... did not see anything, for the RTL8812AU.  I was plenty of questions, but no working solutions... so.. did some digging, most driver code is a base, as drivers are added, and just functions are added or adapted, rarely is a whole driver written if a similar one exists.

Maybe next attempt will be AP mode for this...

I have several different versions of the rtl8812au drivers on my server that utilise DKMS files, which means any time you upgrade to a different kernel it will rebuild rather than needing different binaries...

As for HostAPD, I have that working as well in AC mode, as far as I can tell. To make it easier for people  I updated ayufan's Debian stretch minimal image to turn a rock64 into a router.
  Reply
#3
(02-24-2018, 10:06 PM)evilbunny Wrote:
(02-24-2018, 09:43 PM)11b2p508 Wrote: So bear with me here got to get the fix.  I don't like re-inventing the wheel but was unable to find a driver that was built for the RTL8812AU adaper in the store, I bought one, mainly for 5GHz band as well as 2.4 it does not work out of the box on the artful build (ayufan's) since he is one of the main kernel grinders, I looked there first... did not see anything, for the RTL8812AU.  I was plenty of questions, but no working solutions... so.. did some digging, most driver code is a base, as drivers are added, and just functions are added or adapted, rarely is a whole driver written if a similar one exists.

Maybe next attempt will be AP mode for this...

I have several different versions of the rtl8812au drivers on my server that utilise DKMS files, which means any time you upgrade to a different kernel it will rebuild rather than needing different binaries...

As for HostAPD, I have that working as well in AC mode, as far as I can tell. To make it easier for people  I updated ayufan's Debian stretch minimal image to turn a rock64 into a router.

Thanks for advising where you have them, I may check them out.
  Reply
#4
(02-24-2018, 10:06 PM)evilbunny Wrote:
(02-24-2018, 09:43 PM)11b2p508 Wrote: So bear with me here got to get the fix.  I don't like re-inventing the wheel but was unable to find a driver that was built for the RTL8812AU adaper in the store, I bought one, mainly for 5GHz band as well as 2.4 it does not work out of the box on the artful build (ayufan's) since he is one of the main kernel grinders, I looked there first... did not see anything, for the RTL8812AU.  I was plenty of questions, but no working solutions... so.. did some digging, most driver code is a base, as drivers are added, and just functions are added or adapted, rarely is a whole driver written if a similar one exists.

Maybe next attempt will be AP mode for this...

I have several different versions of the rtl8812au drivers on my server that utilise DKMS files, which means any time you upgrade to a different kernel it will rebuild rather than needing different binaries...

As for HostAPD, I have that working as well in AC mode, as far as I can tell. To make it easier for people  I updated ayufan's Debian stretch minimal image to turn a rock64 into a router.

I checked your items out, good juju, evil bunny,  if one hasn't done an implementation before, they are left to learn a refine it... I now have a 5gz accesspoint at the other end of my house.  I had not got into hostapd yet.  So was really looking at smaller wifi dongles this morning, that are capable of AP mode.
  Reply
#5
can you help me to install RTL8192EU drivers? Don't have much experience in linux
  Reply
#6
(02-26-2018, 07:19 AM)elik745i Wrote: can you help me to install RTL8192EU drivers? Don't have much experience in linux

So, in these projects, I find my best help (sometimes a benevolent hand lends itself), the best solution, though time consuming, and maybe not immediately gratifying, makes me personally more proficient...

So for starters, what do you have loaded?  What variation of linux, unbuntu? debian? (they are very similar, ubuntu is based on debian).  AND what version?
To find out:

cat /etc/os-release <enter> (note this may be different on other Linux variations, e.g. redhat = cat /etc/redhat-release, at&t unix (or other deviations) cat /etc/release)
uname -a <enter> this will give you details about your kernel version

OS variation and kernel versions are great starting points.

Just a quick network query on google, reveals  a lot.  I queried, "linux RTL8192EU"

A lot of ubuntu will ALSO apply to debian releases, and vice versa.

familiarities you need to know:

'git' <- there are several examples in the results, as well as examples for the 16.04 LTS 
'apt' <- learn about this, you will need it, especially using ubuntu, debian,
also 'dpkg' <- believe this was the original package manager for debian.
(yum for redhat derivatives)

you will need to know the above package managers just to get provisioned to put in the driver, e.g. installing compilers, dev tools, etc.

This is not just linux, it is same with MicroSloth, when you get into stuff at this level you are no longer, a user...

Remember, if another man/woman did it, you can too. Be tenacious, it will build your skills and familiarity with what you are trying to accomplish.

I do not have the particular USB dongle to validate (yours), so I cannot provide a driver, you need to do that since you have one.

evilbunny made note of dkms..., that is a better option, but I did not find a dkms build there may be one out there (I could not find one at first for mine).  but also, going through the exercise of a build (like my first post), will help you understand the basic process of if making a driver work, there IS versions of that driver out there in particular for ubuntu and debian builds.

Advise of your progress in understand some of the above, I will make an attempt to coach you through the process. (I check back here periodically, so bear with me).

(02-27-2018, 06:13 AM)11b2p508 Wrote:
(02-26-2018, 07:19 AM)elik745i Wrote: can you help me to install RTL8192EU drivers? Don't have much experience in linux

So, in these projects, I find my best help (sometimes a benevolent hand lends itself), the best solution, though time consuming, and maybe not immediately gratifying, makes me personally more proficient...

So for starters, what do you have loaded?  What variation of linux, unbuntu? debian? (they are very similar, ubuntu is based on debian).  AND what version?
To find out:

cat /etc/os-release <enter> (note this may be different on other Linux variations, e.g. redhat = cat /etc/redhat-release, at&t unix (or other deviations) cat /etc/release)
uname -a <enter> this will give you details about your kernel version

OS variation and kernel versions are great starting points.

Just a quick network query on google, reveals  a lot.  I queried, "linux RTL8192EU"

A lot of ubuntu will ALSO apply to debian releases, and vice versa.

familiarities you need to know:

'git' <- there are several examples in the results, as well as examples for the 16.04 LTS 
'apt' <- learn about this, you will need it, especially using ubuntu, debian,
also 'dpkg' <- believe this was the original package manager for debian.
(yum for redhat derivatives)

you will need to know the above package managers just to get provisioned to put in the driver, e.g. installing compilers, dev tools, etc.

This is not just linux, it is same with MicroSloth, when you get into stuff at this level you are no longer, a user...

Remember, if another man/woman did it, you can too. Be tenacious, it will build your skills and familiarity with what you are trying to accomplish.

I do not have the particular USB dongle to validate (yours), so I cannot provide a driver, you need to do that since you have one.

evilbunny made note of dkms..., that is a better option, but I did not find a dkms build there may be one out there (I could not find one at first for mine).  but also, going through the exercise of a build (like my first post), will help you understand the basic process of if making a driver work, there IS versions of that driver out there in particular for ubuntu and debian builds.

Advise of your progress in understand some of the above, I will make an attempt to coach you through the process. (I check back here periodically, so bear with me).
Oh, forgot the MOST important of all - they MAY or may not be on your distro - in particular SBCs (small space), 'man' <- in the *nix world this is your biggest friend!  Learn it, live it, look there. At this level man sections 2,3,5 are your best resources for using the system, 2 = system calls, 3 = stdio calls, 5 = configuration files for utilities.  There are other sections, but again at this level those will probably be of most benefit - to see if man is installed, type:

man <enter>

man is your friend.
  Reply
#7
Hi everyone, 
This is my first posting here:

I just wanted to share what I did to make RTL8812AU working in dual-band mode on Rock64 running Xenial Mate Community Build Image.

The following information is based on the personal blog I found on the net:
https://ameblo.jp/gabriel1225/entry-12337005303.html

The page is in Japanese only, so I summarise the relevant parts here.

1) Obtain the source code:

>$ git clone https://github.com/gnab/rtl8812au.git

[This will create a directory called rtl8812au in your home directory.]

2) Move to this newly created rtl8812au directory:

>$ cd rtl8812au

3) Using your text editor, edit some entries in file called Makefile so that it can run without error on Rock64.

[Disable energy saving around line 40]

CONFIG_POWER_SAVING = y
     ↓
CONFIG_POWER_SAVING = n 


[Change platform setting around line 53]

CONFIG_PLATFORM_I386_PC = y
     ↓
CONFIG_PLATFORM_I386_PC = n


[Add the following platform setting immediately under the above line]

CONFIG_PLATFORM_ARM_PC = y


[Add the following command around line 662]

ifeq ($(CONFIG_PLATFORM_ARM_PC), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
SUBARCH := arm64
ARCH ?= arm64
CROSS_COMPILE ?=
KVER ?= $(shell uname -r)
KSRC := /lib/modules/$(KVER)/build/
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
INSTALL_PREFIX :=
endif


[Remove "modules" part from the following command around line 1065]

$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd)  modules
                  ↓
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd)
 

4) Compile:

>$ make

5) Register the newly created driver:

>$ sudo insmod 8812au.ko


In order to automate this driver compiling process after each version update, use DKSM function.

1) Unload the driver:

>$ sudo rmmod 8812au


2) Install dkms:

>$ sudo apt-get install dkms -y

8) Since dkms is managed in /usr/src directory, copy dkms into there.

>$ sudo cp dkms /usr/src

9)  Type:

>$ make clean

>$ sudo cp -R . /usr/src/8812au-4.2.2

10) Register module:

[First, move to the working directory]

>$ cd ../../usr/src

[Type]

>$ sudo dkms add -m 8812au -v 4.2.2

11) Build:

>$ sudo dkms build -m 8812au -v 4.2.2

12) Install:

>$ sudo dkms install -m 8812au -v 4.2.2

Now your driver will be self-build in the next kernel update, so you do not have to repeat this cumbersome operation again. Big Grin
  Reply
#8
(03-03-2018, 09:04 AM)HackerKitty Wrote: >$ git clone https://github.com/gnab/rtl8812au.git

There is a lot of realtek driver on github, gnab publishes version 4.2.2, I found driver version 5.2.20 from https://github.com/gordboy/rtl8812au.git
  Reply
#9
When I try to run make I get

Code:
DKMS make.log for rtl8812au-4.3.22 for kernel 4.4.77-rockchip-ayufan-136 (aarch64)
Sat May 19 21:02:37 UTC 2018
make -j4 ARCH=arm64 CROSS_COMPILE= -C /lib/modules/4.4.77-rockchip-ayufan-136/build M=/var/lib/dkms/rtl8812au/4.3.22/build  modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.77-rockchip-ayufan-136'
 CC [M]  /var/lib/dkms/rtl8812au/4.3.22/build/core/rtw_cmd.o
 CC [M]  /var/lib/dkms/rtl8812au/4.3.22/build/core/rtw_security.o
 CC [M]  /var/lib/dkms/rtl8812au/4.3.22/build/core/rtw_io.o
 CC [M]  /var/lib/dkms/rtl8812au/4.3.22/build/core/rtw_debug.o
Can you help me figure out what I am missing?
I am using jessie-openmediavault-rock64-0.5.15-136-armhf.img

(03-03-2018, 09:04 AM)HackerKitty Wrote: Hi everyone, 
This is my first posting here:

I just wanted to share what I did to make RTL8812AU working in dual-band mode on Rock64 running Xenial Mate Community Build Image.

The following information is based on the personal blog I found on the net:
https://ameblo.jp/gabriel1225/entry-12337005303.html

The page is in Japanese only, so I summarise the relevant parts here.

1) Obtain the source code:

>$ git clone https://github.com/gnab/rtl8812au.git

[This will create a directory called rtl8812au in your home directory.]

2) Move to this newly created rtl8812au directory:

>$ cd rtl8812au

3) Using your text editor, edit some entries in file called Makefile so that it can run without error on Rock64.

[Disable energy saving around line 40]

CONFIG_POWER_SAVING = y
     ↓
CONFIG_POWER_SAVING = n 


[Change platform setting around line 53]

CONFIG_PLATFORM_I386_PC = y
     ↓
CONFIG_PLATFORM_I386_PC = n


[Add the following platform setting immediately under the above line]

CONFIG_PLATFORM_ARM_PC = y


[Add the following command around line 662]

ifeq ($(CONFIG_PLATFORM_ARM_PC), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
SUBARCH := arm64
ARCH ?= arm64
CROSS_COMPILE ?=
KVER ?= $(shell uname -r)
KSRC := /lib/modules/$(KVER)/build/
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
INSTALL_PREFIX :=
endif


[Remove "modules" part from the following command around line 1065]

$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd)  modules
                  ↓
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd)
 

4) Compile:

>$ make

5) Register the newly created driver:

>$ sudo insmod 8812au.ko


In order to automate this driver compiling process after each version update, use DKSM function.

1) Unload the driver:

>$ sudo rmmod 8812au


2) Install dkms:

>$ sudo apt-get install dkms -y

8) Since dkms is managed in /usr/src directory, copy dkms into there.

>$ sudo cp dkms /usr/src

9)  Type:

>$ make clean

>$ sudo cp -R . /usr/src/8812au-4.2.2

10) Register module:

[First, move to the working directory]

>$ cd ../../usr/src

[Type]

>$ sudo dkms add -m 8812au -v 4.2.2

11) Build:

>$ sudo dkms build -m 8812au -v 4.2.2

12) Install:

>$ sudo dkms install -m 8812au -v 4.2.2

Now your driver will be self-build in the next kernel update, so you do not have to repeat this cumbersome operation again. Big Grin
  Reply
#10
I remember now, I wasn't able to build on the hf install, only on arm64
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  on-board ethernet driver michaelanburaj 0 627 03-26-2020, 12:01 PM
Last Post: michaelanburaj
  How Can Install Unify controller in rock64? gedas07 0 620 03-23-2020, 08:41 AM
Last Post: gedas07
  Can Anyone help me install Wine latest on Rock64 Rock90 1 1,310 08-10-2019, 06:18 AM
Last Post: OnyxxOr
  8812au wifi driver OS pane 9 3,703 11-19-2018, 02:46 AM
Last Post: pane
  apt --fix-broken install KC7NOA 1 1,109 10-29-2018, 09:17 PM
Last Post: KC7NOA
  HELP I want install a desktop but I don't Know how can I do gedas07 11 5,196 10-02-2018, 01:34 PM
Last Post: jovval
  Managed to install Kubernetes digitaldaz 2 1,848 09-29-2018, 09:05 PM
Last Post: suberimakuri
  OMV wifi setup (driver issue) six9 0 1,290 07-25-2018, 03:34 PM
Last Post: six9
  How can I get a driver to support my USB wifi dongle Rocklobster 4 2,604 04-19-2018, 12:55 PM
Last Post: Rocklobster
  bringing up X on minimal stretch install gene83 11 5,066 03-05-2018, 01:47 AM
Last Post: jegb

Forum Jump:


Users browsing this thread: 1 Guest(s)