Rock64 Wifi Module

Guides and tutorials for various stuff. Posted by DietPi users.
Post Reply
Joseph_Lin
Posts: 22
Joined: Tue Sep 26, 2017 2:56 am

Rock64 Wifi Module

Post by Joseph_Lin »

I successfully installed Dietpi on my new Rock64 2G board. However, I cannot make my RTL8812AU wifi module to work on Dietpi.
I tried to compile the driver by myself but the linux headers for Rock64 cannot be found, tried to get the headers but apt-get told me the system has the newest headers.
I am wondering, is there a way to compile the driver for Dietpi? Will Dietpi support RTL8812AU wifi module in the future? I found
https://github.com/ayufan-rock64/linux- ... kchip_wlan
has a lot of drivers ready for compilation if it is possible on Dietpi.
Joseph_Lin
Posts: 22
Joined: Tue Sep 26, 2017 2:56 am

Re: Rock64 Wifi Module

Post by Joseph_Lin »

Joseph_Lin wrote:I successfully installed Dietpi on my new Rock64 2G board. However, I cannot make my RTL8812AU wifi module to work on Dietpi.
I tried to compile the driver by myself but the linux headers for Rock64 cannot be found, tried to get the headers but apt-get told me the system has the newest headers.
I am wondering, is there a way to compile the driver for Dietpi? Will Dietpi support RTL8812AU wifi module in the future? I found
https://github.com/ayufan-rock64/linux- ... kchip_wlan
has a lot of drivers ready for compilation if it is possible on Dietpi.
Looks like not many people are using Rock64, very few views and no replies.

Anyways, I spent 4 hours trying to figure out how to compile 8812au for Rock64, and finally have it up and running in Dietpi!
Here's my tutorial:

sudo apt-get install git
sudo apt-get install build-essential
sudo dpkg -i linux-headers-4.4.77-rockchip-ayufan-136_0.5.15_arm64.deb
mkdir header
dpkg -x linux-headers-4.4.77-rockchip-ayufan-136_0.5.15_arm64.deb header
cd header/usr/src
sudo mv linux-headers-4.4.77-rockchip-ayufan-136/ /usr/src/.

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

git clone https://github.com/gnab/rtl8812au.git
cd rtl8812au
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

Somehow, I am not able to make 8812au.ko loads in /etc/modules. My fix is to simply edit /etc/rc.local and add insmod /Path-to-driver/8812au.ki

My path to driver is in /lib/modules/4.4.77-rockchip-ayufan-136 since I moved 8812au.ko to this location.

I hope this helps someone.
Joseph_Lin
Posts: 22
Joined: Tue Sep 26, 2017 2:56 am

Re: Rock64 Wifi Module

Post by Joseph_Lin »

By the way, since I have 8812au module compiled and confirmed working. Will dietpi include this driver in the future release, please? I do not want to recompile it again in the future.
Joseph_Lin
Posts: 22
Joined: Tue Sep 26, 2017 2:56 am

Re: Rock64 Wifi Module

Post by Joseph_Lin »

I made some corrections, if you like, you can download my Makefile and skip those confusing modifications

sudo apt-get install git

sudo apt-get install build-essential

apt-get download linux-headers-4.4.77-rockchip-ayufan-136

mkdir header

dpkg -x linux-headers-4.4.77-rockchip-ayufan-136_0.5.15_arm64.deb header

cd header/usr/src

sudo mv linux-headers-4.4.77-rockchip-ayufan-136/ /usr/src/.

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


Somehow, I am not able to make 8812au.ko loads in /etc/modules. My fix is to simply edit /etc/rc.local and add insmod /Path-to-driver/8812au.ki

My path to driver is in /lib/modules/4.4.77-rockchip-ayufan-136/kernel/drivers/net/wireless since I moved 8812au.ko to this location.

I hope this helps someone.
Attachments
Makefile.zip
(5.06 KiB) Downloaded 123 times
Joseph_Lin
Posts: 22
Joined: Tue Sep 26, 2017 2:56 am

Re: Rock64 Wifi Module

Post by Joseph_Lin »

Some screen shots after connected to my 5G router. It is fast!
Attachments
Capture2.JPG
Capture.JPG
Joseph_Lin
Posts: 22
Joined: Tue Sep 26, 2017 2:56 am

Re: Rock64 Wifi Module

Post by Joseph_Lin »

There is a newer version of 8812au driver -- 5.2.20, I think it is the newest. If you know there is a newer one, please let me know.

To compile and install it:

0. If you have old rtl8812au installed, please remove it first. Leave no trace of it :)
sudo rmmod 8812au
go to the path where 8812au.ko is installed
sudo rm 8812au.ko
1. Install build-essential from Dietpi-software(Looks like Dietpi-software is not able to install a complete build-essential, you need to install it with :sudo apt-get install build-essential)
2. Install git from dietpi-software
3. git clone https://github.com/gordboy/rtl8812au
4. apt-get download linux-headers-4.4.77-rockchip-ayufan-136
5. mkdir header
6. dpkg -x linux-headers-4.4.77-rockchip-ayufan-136_0.5.15_arm64.deb header
7. cd header/usr/src
8. sudo mv linux-headers-4.4.77-rockchip-ayufan-136/ /usr/src/.
9. cd
10. cd rtl8812au
11. ARCH=arm64 make
12. sudo ARCH=arm64 make install
13. Reboot and it should work now.
Post Reply