Welcome! Log In Create A New Profile

Advanced

Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter

Posted by jrey 
Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
August 10, 2021 10:36PM
Just got a cheap wifi adapter for 5GHz from AE. Here is the output when plugged in.

[995247.201899] usb 1-1.1: new high-speed USB device number 9 using orion-ehci
[995247.353130] usb 1-1.1: New USB device found, idVendor=0bda, idProduct=b812, bcdDevice= 2.10
[995247.362388] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[995247.370574] usb 1-1.1: Product: USB3.0 802.11ac 1200M Adapter
[995247.377588] usb 1-1.1: Manufacturer: Realtek
[995247.382927] usb 1-1.1: SerialNumber: 123456

Is there anyway to get the driver installed for debian on dockstar? The dongle comes with some source codes that need to be compiled but I have no idea how to do that. Can someone please help? Thanks.
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
August 11, 2021 01:28AM
jrey,

You might not need to compile driver. In Debian try:

modprobe rtl8821ae
And see if dmesg will show anything more about the device.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
August 11, 2021 01:35AM
I have just tried and nothing happened. No dmesg output either.
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
August 18, 2021 08:00AM
Try searching for someone that has compiled it for Raspberry Pi 3. I've compiled drivers for armv5te using Raspberry Pi modified code for rtl8812 and rtl8821. It doesn't always work automagically so you may need to make minor mods to the makefile to get it to work.
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
October 10, 2021 12:57AM
So I am trying to compile it. I found an instruction from the web
https://forum.armwizard.org/viewtopic.php?f=13&p=1380

and I am stuck with

$ sudo dkms build -m rtl88x2bu -v ${VERS_DRIVER}

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
'make' KVER=5.14.9-kirkwood-tld-1 src=/usr/src/rtl88x2bu-5.8.7.1.....(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.14.9-kirkwood-tld-1 (armv5tel)
Consult /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log for more information.

This is what's in the log file:

$ cat /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log 
DKMS make.log for rtl88x2bu-5.8.7.1 for kernel 5.14.9-kirkwood-tld-1 (armv5tel)
Sun 10 Oct 2021 12:51:30 PM +07
/bin/sh: 1: bc: not found
make ARCH=armv5tel CROSS_COMPILE= -C /lib/modules/5.14.9-kirkwood-tld-1/build M=/var/lib/dkms/rtl88x2bu/5.8.7.1/build  modules
make[1]: Entering directory '/usr/src/linux-headers-5.14.9-kirkwood-tld-1'
Makefile:710: arch/armv5tel/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/armv5tel/Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-5.14.9-kirkwood-tld-1'
make: *** [Makefile:2390: modules] Error 2

There is no sub-directory arch/armv5tel. Only arch/arm is avalable. Can someone please help?
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
October 23, 2021 08:12PM
The last error above is complaining that you don't have "bc" installed.
apt-get install bc
Should get you going. I just tried building this under the 5.7.1-kirkwood-tld-1 kernel and it built just fine. I didn't use DKMS, just git cloned the repo, edited the Makefile and made the following changes:
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = y
After that make sure you have enough free RAM (swap?) and your standard make command works just fine.
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 08, 2022 07:31AM
I figured it's quite relevant here.... I'm having a very similar issue. I've installed the 5.15 headers.

This is the error I'm getting when using the make command (not using DKMS):
root@pogoplug:~/88x2bu-20210702# make
make ARCH=arm CROSS_COMPILE= -C /lib/modules/5.15.5-kirkwood-tld-1/build M=/root/88x2bu-20210702  modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.5-kirkwood-tld-1'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: arm-linux-gnueabi-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
  You are using:           gcc (Debian 10.2.1-6) 10.2.1 20210110
  CC [M]  /root/88x2bu-20210702/core/rtw_cmd.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[2]: *** [scripts/Makefile.build:277: /root/88x2bu-20210702/core/rtw_cmd.o] Error 126
make[2]: *** Deleting file '/root/88x2bu-20210702/core/rtw_cmd.o'
make[1]: *** [Makefile:1868: /root/88x2bu-20210702] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.5-kirkwood-tld-1'
make: *** [Makefile:2497: modules] Error 2
It's not something I've really done before, so at a loss where to begin troubleshooting.
I'm guessing:
CC [M]  /root/88x2bu-20210702/core/rtw_cmd.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error
is where the issue lies?



Edited 1 time(s). Last edit at 04/08/2022 07:32AM by Biohead.
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 08, 2022 03:50PM
Biohead,

> warning: the compiler differs from the one used to
> build the kernel
> The kernel was built by: arm-linux-gnueabi-gcc
> (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
> You are using: gcc (Debian 10.2.1-6)
> 10.2.1 20210110

That seems to be the issue. The kernel was built with gcc 7.5. The current Debian has gcc 10.21. Compiler versions that far apart tend to be problematic.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 10, 2022 07:21AM
Thanks for the pointer bodhi.

I've had a look at what may be needed, and it seems a downgrade to GCC isn't as straightforward as I'd hoped, certainly not below GCC-9 anyway (which gives the same error when trying to compile this driver).

Could anyone offer any further advice, or should I look for a more compatible WiFi adapter?
(A genuine question: would there been any benefit to AC speeds on these boxes? Are they quick enough to actually benefit?)
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 10, 2022 08:04AM
Biohead Wrote:
-------------------------------------------------------
> it
> seems a downgrade to GCC isn't as straightforward
> as I'd hoped,
What do you mean? On my system (Buster)
apt list | grep gcc
shows (among others) gcc-7-base

> (A genuine question: would there been any benefit
> to AC speeds on these boxes? Are they quick enough
> to actually benefit?)
A Dockstar has according to the OpenWrt Wiki a 1200MHz Kirkwood. I think that box should be able to provide 35MB/sec over Samba, and more over NFS/HTTP/FTP/... To be able to stream 35MB/sec you need a link of at least 280Mbit, and for some reason in wifi you need twice that bandwidth (has something to do with half duplex, but as the stream is asymmetrical I don't fully understand that), so any change which lift the link from below to above 560Mbit, is beneficial for Samba, and for NFS/HTTP/FTP/... you could even use more bandwidth.
Unless. When the WPA2 encryption is handled by software, you won't benefit that much. I don't know how expensive WPA2 is, but for SSL the box is limited to something like 1MB/sec, so odds are that on wifi you'll be limited to something like that. But it could be hardware. My router/AP has a processor which can't compete with a Kirkwood, and yet the througput on wifi is not CPU limited.

/Edit: I overlooked that a Dockstar doesn't have SATA, only USB2. So when you have to provide data from/to a disk, you'll be limited to 25MB/sec anyway. That might change the story a bit.



Edited 1 time(s). Last edit at 04/10/2022 08:46AM by Mijzelf.
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 10, 2022 03:57PM
> Unless. When the WPA2 encryption is handled by
> software, you won't benefit that much.

True. But the Kirkwood SoC has Marvell CESA engine. When it is enabled, the work is off loaded to cryptodev.

uname -a
Linux HomeBackup 5.17.1-kirkwood-tld-1 #1.0 PREEMPT Fri Apr 1 16:17:12 PDT 2022 armv5tel GNU/Linux
dmesg | grep -i cesa
[   27.863642] marvell-cesa f1030000.crypto: CESA device successfully registered

We have a few threads on this topic in the Wiki thread

Quote

Hardware Cryptography

Marvell CESA (also see correction post in this thread)
Marvell CESA in kernel 4.4 performance
Hardware Cryptography cryptodev/openssl On arm5/Debian (build circa 2019)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 11, 2022 08:43AM
Mijzelf Wrote:
-------------------------------------------------------
> Biohead Wrote:
> -------------------------------------------------------
> > it
> > seems a downgrade to GCC isn't as
> straightforward
> > as I'd hoped,
> What do you mean? On my system (Buster)
>
> apt list | grep gcc
>
> shows (among others) gcc-7-base


Hmm, I could swear when I looked that wasn't there, nor could I see it in the repo, but indeed after a refresh it's there. I'm away for a week now so have to standby in this.

I'm not familiar at all with building drivers, let alone calling an older component as part of Make. Could anyone let me know the trick to call gcc-7, or better yet recommend some reading where I can learn about it?
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 11, 2022 01:13PM
Re: Need help compiling WIFI adapter for Realtek USB3.0 802.11ac 1200M Adapter
April 18, 2022 09:26AM
Thanks guys. All sorted.

I couldn't do it on my current install - despite showing as installed the binaries weren't there. No idea what had happened, but it's been used a lot to get a feel for the system again so I probably broke it somewhere.

But I took a clean rootfs and it compiled (almost) first time. Adding some swap sorted it, took around an hour to compile.

Thanks for the reading material too - it's the first i'd heard of update-alternatives but seems useful for this scenario.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: