コンピューター好きのブログ

主にコンピューター・ラズパイと電子工作・オーディオ関連の記事を書いています。

Ubuntu 20.04 LTSで802.11ac対応のUSB Wifi アダプターを使ってみました

今まで我が家のLinuxマシンでは、2.4GHz の 802.11n 対応の USB Wifi アダプターを使っていました。

しかし、2.4GHzは混雑気味なのと、速度に不満が出てきたため、5GHzの802.11ac対応のUSB Wifi アダプターを導入してみました。

↓の製品です。

導入してしばらく問題なく使っていたのですが、最近突然使えなくなり、再度ドライバを導入することになりました。

しかし、手順を忘れており、少しはまったので、備忘録として記しておきます。

 

ドライバについて

このWifiアダプターは、Realtek 社の 8812BU というチップを使っているらしいので、そのLinux用ドライバを使います。

私は下記で公開されているものを使いました。

基本的に下記に記載されている手順で導入していきます。

GitHub - morrownr/88x2bu-20210702: Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL8822BU Chipsets - v5.13.1

ドライバの導入

事前準備

まず、下記のコマンドを実行してOSを最新状態にします。

sudo apt update && sudo apt upgrade

その後、念のため再起動します。

sudo reboot

必要なパッケージをインストールします。

sudo apt install -y build-essential dkms git iw

ドライバの入手

ディレクトリを作成します。

mkdir -p ~/src

作成したディレクトリに移動します。

cd ~/src

ドライバをダウンロードします。

git clone https://github.com/morrownr/88x2bu-20210702.git

ダウンロードしたドライバのディレクトリに移動します。

cd ~/src/88x2bu-20210702

ドライバの作成、インストール

下記のコマンドを実行すると、インストール済みドライバの削除、ドライバの作成、ドライバのインストールが行われます。

sudo sh install-driver.sh

私の環境でインストールしたときに画面に出力された内容は下記です。

最後に2つ質問されますが、1つ目はデフォルトの N 、2つ目は推奨されている Y としました。2つ目を Y とすると、OSが再起動されます。

: ---------------------------
: install-driver.sh v20230126
: x86_64 (architecture)
: 4/4 (in-use/total processing units)
: 3894828 (total system memory)
: 5.15.0-69-generic (kernel version)
: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
: dkms:2.8
This system doesn't support Secure Boot
:
: ---------------------------
rtl88x2bu, 5.13.1, 5.15.0-69-generic, x86_64: installed
Removing a dkms installation: rtl88x2bu

-------- Uninstall Beginning --------
Module:  rtl88x2bu
Version: 5.13.1
Kernel:  5.15.0-69-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

88x2bu.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.15.0-69-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.

------------------------------
Deleting module version: 5.13.1
completely from the DKMS tree.
------------------------------
Done.
Removing 88x2bu.conf from /etc/modprobe.d
Removing source files from /usr/src/rtl88x2bu-5.13.1
Installing 88x2bu.conf to /etc/modprobe.d
The dkms installation routines are in use.
Copying source files to /usr/src/rtl88x2bu-5.13.1

Creating symlink /var/lib/dkms/rtl88x2bu/5.13.1/source ->
                 /usr/src/rtl88x2bu-5.13.1

DKMS: add completed.
The driver was added to dkms successfully.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
./dkms-make.sh......................
Signing module:
 - /var/lib/dkms/rtl88x2bu/5.13.1/5.15.0-69-generic/x86_64/module/88x2bu.ko
This system doesn't support Secure Boot
Secure Boot not enabled on this system.
cleaning build area...

DKMS: build completed.
Compile time: 207.15 seconds
The driver was built by dkms successfully.

88x2bu.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-69-generic/updates/dkms/

depmod...

DKMS: install completed.
The driver was installed by dkms successfully.
Do you want to edit the driver options file now? [y/N]
Do you want to apply the new options by rebooting now? (recommended) [y/N]

導入の確認

OS再起動後、下記のコマンドを実行すると、Wifiアダプターが認識され、Wifiに接続できていることを確認できました。Wifi接続の情報(ESSIDとパスワード)は再設定不要でした。

  • コマンド

iwconfig

  • コマンドの結果

wlx90de803a35e2  IEEE 802.11AC  ESSID:"XXXXXXXXX"

 Nickname:"WIFI@RTL88X2BU"
          Mode:Managed  Frequency:5.58 GHz  Access Point: xx:xx:xx:xx:xx:xx
          Bit Rate:867 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=85/100  Signal level=69/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

以上、私のようにはまった方のお役に立てば幸いです。

(c) 2018 toomath