morrownr / rtl8852bu

Linux Driver for USB WiFi Adapters that are based on the RTL8852BU and RTL8832BU Chipsets - v1.19.3 - 20230505
Other
107 stars 22 forks source link

(Info) Progress Log #2

Open morrownr opened 1 year ago

morrownr commented 1 year ago

Progress Log:

List of things that appear to be broken or unfinished:

ToDo:

Help is welcome.

Note: There are a massive amount of additions and changes from the WiFi 5 class Realtek out-of-kernel drivers.

Summary: Managed mode appears to be solid. Monitor mode and AP mode have had minimal testing so the status is mostly unknown, Monitor mode may not work as desired in all situations but that is true of almost all Realtek out-of-kernel drivers. I think this is a driver that can be released to the public but the driver appears to still be in development by Realtek and is fragile right now.


Performance report Test using managed mode and 5 GHz DFS channel:

$ iperf3 -c 192.168.1.1
Connecting to host 192.168.1.1, port 5201
[  5] local 192.168.1.184 port 45936 connected to 192.168.1.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  66.2 MBytes   556 Mbits/sec    0   1.89 MBytes       
[  5]   1.00-2.00   sec  67.5 MBytes   566 Mbits/sec    0   1.89 MBytes       
[  5]   2.00-3.00   sec  68.8 MBytes   577 Mbits/sec    0   1.89 MBytes       
[  5]   3.00-4.00   sec  70.0 MBytes   587 Mbits/sec    0   1.89 MBytes       
[  5]   4.00-5.00   sec  68.8 MBytes   577 Mbits/sec    0   1.89 MBytes       
[  5]   5.00-6.00   sec  70.0 MBytes   587 Mbits/sec    0   1.89 MBytes       
[  5]   6.00-7.00   sec  68.8 MBytes   577 Mbits/sec    0   1.89 MBytes       
[  5]   7.00-8.00   sec  70.0 MBytes   587 Mbits/sec    0   1.89 MBytes       
[  5]   8.00-9.00   sec  70.0 MBytes   587 Mbits/sec    0   1.89 MBytes       
[  5]   9.00-10.00  sec  68.8 MBytes   577 Mbits/sec    0   1.89 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   689 MBytes   578 Mbits/sec    0             sender
[  5]   0.00-10.01  sec   686 MBytes   575 Mbits/sec                  receiver

iperf Done.

Performance Test on a RasPi4B running RasPiOS: (the lower speed is likely due to my RasPi4B running headless)

RasPi4B:~ $ iperf3 -c 192.168.1.1
Connecting to host 192.168.1.1, port 5201
[  5] local 192.168.1.184 port 59510 connected to 192.168.1.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.05   sec  48.4 MBytes   386 Mbits/sec    0   1.07 MBytes       
[  5]   1.05-2.02   sec  51.2 MBytes   445 Mbits/sec    0   1.23 MBytes       
[  5]   2.02-3.00   sec  53.8 MBytes   458 Mbits/sec    0   1.30 MBytes       
[  5]   3.00-4.00   sec  52.5 MBytes   439 Mbits/sec    0   1.50 MBytes       
[  5]   4.00-5.01   sec  55.0 MBytes   456 Mbits/sec    0   1.50 MBytes       
[  5]   5.01-6.01   sec  53.8 MBytes   453 Mbits/sec    0   1.58 MBytes       
[  5]   6.01-7.02   sec  55.0 MBytes   458 Mbits/sec    0   1.58 MBytes       
[  5]   7.02-8.02   sec  55.0 MBytes   459 Mbits/sec    0   1.58 MBytes       
[  5]   8.02-9.00   sec  53.8 MBytes   459 Mbits/sec    0   1.58 MBytes       
[  5]   9.00-10.02  sec  55.0 MBytes   455 Mbits/sec    0   1.58 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.02  sec   533 MBytes   447 Mbits/sec    0             sender
[  5]   0.00-10.02  sec   533 MBytes   446 Mbits/sec                  receiver

iperf Done.

Packet Injection Test

$ sudo aireplay-ng --test wlx893a35b802a5
[sudo] password for xzxzxz: 
14:54:20  Trying broadcast probe requests...
14:54:22  No Answer...
14:54:22  Found 11 APs

14:54:22  Trying directed probe requests...
14:54:22  CC:BE:59:C0:16:E2 - channel: 11 - 'Lolli369#'
14:54:22  Ping (min/avg/max): 10.349ms/15.036ms/21.051ms Power: -74.17
14:54:22  30/30: 100%

14:54:22  Injection is working!

14:54:22  6C:CD:D6:E2:EC:F7 - channel: 10 - 'NETGEAR61'
14:54:28   0/30:   0%

14:54:28  10:33:BF:60:FA:32 - channel: 11 - ''
14:54:29  Ping (min/avg/max): 1.726ms/6.949ms/35.982ms Power: -39.00
14:54:29  30/30: 100%

14:54:29  10:33:BF:60:FA:36 - channel: 11 - ''
14:54:29  Ping (min/avg/max): 1.698ms/6.039ms/24.658ms Power: -39.03
14:54:29  30/30: 100%

14:54:29  10:33:BF:60:FA:34 - channel: 11 - ''
14:54:29  Ping (min/avg/max): 1.880ms/5.366ms/24.434ms Power: -39.90
14:54:29  30/30: 100%

14:54:29  CC:BE:59:3C:40:DA - channel: 11 - 'Lacys place'
14:54:30  Ping (min/avg/max): 11.869ms/21.771ms/141.221ms Power: -73.23
14:54:30  30/30: 100%

p7x404 commented 1 year ago

@morrownr

Le 11/08/2023 à 01:05, morrownr a écrit :

If I can be of any help in testing, don't hesitate to ask.

Alright. This is me asking.

When you install, is it clear what you have to do to turn USB3 mode on?

You can check the usb mode with:

Humm, actually I did it because I knew I had to do it given on my previous (numerous) tests with the 1.15 firmware. I also have had a rtl8812bu adapter for some time, which also gave me some hard time, and wasn't performing OK in USB3 mode at all. So one of the first things I did when I got the 8852bu adapter and faced performances issues was to test in USB2 or USB3 mode. USB3 is working nicely with the 8852bu.

The comments in the provided conf file are clear enough IMHO.

On a side note, maybe you could add in the documentation that we may want to set up the default editor before launching the script ?

$ lsusb -t

Also, I need you to test updating the driver. Go to the driver directory in a terminal:

$ git pull $ sudo sh install-driver.sh

...and let me know if everything works and is understandable.

So, it works very well, I thing I even get higher bandwidth (with Wifi 5 for the time being).

However, I had to manually remove the driver from DKMS to be able to install the update.


sudo ./remove-driver.sh
: ---------------------------
: remove-driver.sh v20230801
: x86_64 (architecture)
: 5.15.0-78-generic (kernel version)
: ---------------------------

Removing a dkms installation.
Error! Could not locate dkms.conf file.
File: /var/lib/dkms/nvidia/430.64/source/dkms.conf does not exist.
rtl8852bu/1.19.3 has been removed
Removing 8852bu.conf from /etc/modprobe.d
Removing source files from /usr/src/rtl8852bu-1.19.3
The driver was removed successfully.
You may now delete the driver directory if desired.

: ---------------------------
: install-driver.sh v20230718
: x86_64 (system architecture)
: x86_64 (gcc architecture)
: 6/6 (in-use/total processing units)
: 32600684 (total system memory)
: 5.15.0-78-generic (kernel version)
: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
: dkms:2.8
: SecureBoot disabled
: ---------------------------

Checking for previously installed drivers.
Error! Could not locate dkms.conf file.
File: /var/lib/dkms/nvidia/430.64/source/dkms.conf does not exist.
: ---------------------------

Starting installation.
Installing 8852bu.conf to /etc/modprobe.d
The dkms installation routines are in use.
Copying source files to /usr/src/rtl8852bu-1.19.3
Error! DKMS tree already contains: rtl8852bu-1.19.3
You cannot add the same module/version combo more than once.
This driver may already be installed.
Run the following and then reattempt installation.
$ sudo ./remove-driver.sh

$sudo dkms status -c dkms.conf
nvidia, 430.64: added
nvidia, 535.86.05: added
rtl8852bu, 1.15.11, 5.15.0-76-generic, x86_64: installed
rtl8852bu, 1.19.3, 5.15.0-78-generic, x86_64: installedError! Could not locate dkms.conf file.
File: /var/lib/dkms/rtl8852bu/1.19.3/source/dkms.conf does not exist.

$sudo dkms remove -c dkms.conf -m rtl8852bu/1.19.3 --all
morrownr commented 1 year ago

@p7x404

The problem above where you had to use remove-driver.sh is very concerning and should not happen.

I have posted a new separate issue with quotes from your report. Let's discontinue this topic here and go to the new issue.

I have questions for you in the new issue.

morrownr commented 1 year ago

@alkisg

You have the ability to merge patches if there is a need.

I say this because of a health issue that I became aware of today. It will likely restrict my activities over the next 4 months or so.

I currently have one small patch that I will try to make soon and I have a lot of work that is not ready yet so I will have to make it happen when I can.

Regards

Nick

alkisg commented 1 year ago

@morrownr as always, thank you for everything, but now do drop everything and concentrate on getting well soon!

morrownr commented 1 year ago

@alkisg

I could use some help. No emergency but if you see the problem, please let me know.

The idea with the below code is to display one line that shows the status of Secure Boot.

Here is the code in install-driver.sh

# display secure mode status
if command -v mokutil >/dev/null 2>&1; then
    if mokutil --sb-state | grep -i  enabled >/dev/null 2>&1; then
        echo ": SecureBoot enabled"
    fi
    if mokutil --sb-state | grep -i  disabled >/dev/null 2>&1; then
        echo ": SecureBoot disabled"
    fi
    if mokutil --sb-state | grep -i  EFI >/dev/null 2>&1; then
        echo ": EFI variables are not supported on this system"
    fi
else
    echo ": mokutil not installed"
fi

It works fine as long as 'SecureBoot Disabled' or 'Secureboot enabled' is the situation but:

: --------------------------- : install-driver.sh v20230718 : x86_64 (system architecture) : x86_64 (gcc architecture) : 4/4 (in-use/total processing units) : 16283584 (total system memory) : 5.19.0-50-generic (kernel version) : gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 : dkms-2.8.7 This system doesn't support Secure Boot This system doesn't support Secure Boot This system doesn't support Secure Boot : ---------------------------

: --------------------------- : install-driver.sh v20230830 : aarch64 (kernel architecture) : arm64 (architecture to send to gcc) : 4/4 (in-use/total processing units) : 1889260 (total system memory) : 5.15.0-1038-raspi (kernel version) : gcc (version of gcc used to compile the kernel) : gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 : dkms-2.8.7 EFI variables are not supported on this system EFI variables are not supported on this system EFI variables are not supported on this system : ---------------------------

You can see the problem in the 2 above examples and for the life of me, I am not seeing the problem.

Nick

alkisg commented 1 year ago

Hi @morrownr, the problem is that in cmd1 | cmd2 2>&1, the 2>&1 part only applies to cmd2. You should move it before the pipe, like cmd1 2>&1 | cmd2.

But here's another way to write that part:

if command -v mokutil >/dev/null 2>&1; then
    case $(mokutil --sb-state 2>&1) in
    *enabled*) echo ": SecureBoot enabled" ;;
    *disabled*) echo ": SecureBoot disabled" ;;
    *EFI*) echo ": EFI variables are not supported on this system" ;;
    esac
else
    echo ": mokutil not installed"
fi
morrownr commented 1 year ago

Thank you sir. I could not see it.

Here is what I am going to merge:

# display Secure Boot status
if command -v mokutil >/dev/null 2>&1; then
    case $(mokutil --sb-state 2>&1) in
    *enabled*) echo ": SecureBoot enabled" ;;
    *disabled*) echo ": SecureBoot disabled" ;;
    *) echo ": This system doesn't support Secure Boot" ;;
    esac
else
    echo ": mokutil not installed"
fi

Everything beyond 'enabled' and 'disabled' just means SB is not supported so I made that change.

Also, I am adding '--force' to the build commands to solve a little problem.

This repo is averaging about 4 clones per day. Many times fewer than the other repos but I guess that is to be expected. It is enough to catch some problems but we have only seen one serious problem so far. Are you seeing any problems?

Once again, thanks.

Nick

morrownr commented 11 months ago

@alkisg

FYI: LED support is now working thanks to a little help from a user.

Also, kernel 6.7 should be working now.

Cheers,

@morrownr

alkisg commented 11 months ago

AWESOME! Thank you guys!