2025年12月17日 星期三

Ubuntu 安裝 RTL8852AU USB Wi-Fi 驅動記錄

前言

最近入手了一張 ASUS USB-AX56 (USB ID: 0b05:1997) Wi-Fi 6 無線網卡,這張網卡使用的是 Realtek RTL8852AU 晶片。由於 Linux 核心預設不包含這個驅動,需要手動編譯安裝。本文記錄完整的安裝過程和遇到的問題。

系統環境

  • 作業系統: Ubuntu 23.10
  • 網卡型號: ASUS USB-AX56
  • 晶片組: Realtek RTL8852AU
  • USB ID: 0b05:1997

安裝步驟

1. 安裝編譯所需套件

首先需要安裝編譯工具和核心標頭檔:

sudo apt-get update
sudo apt-get install make gcc linux-headers-$(uname -r) build-essential git

2. 下載驅動原始碼

使用 lwfinger 維護的驅動版本(這個版本比 Realtek 官方版本更穩定):

git clone https://github.com/lwfinger/rtl8852au.git
cd rtl8852au

3. 編譯與安裝

make
sudo make install

4. 載入驅動模組

sudo modprobe 8852au

驅動載入確認

安裝完成後,可以透過以下指令確認驅動是否成功載入:

# 檢查模組是否載入
lsmod | grep 8852

# 檢查 USB 裝置
lsusb | grep ASUS

# 查看核心訊息
sudo dmesg | tail -20
成功訊息範例:
usbcore: registered new interface driver rtl8852au
rtl8852au 9-1:1.0 wlxc87f549a5c4e: renamed from wlan0

網路介面命名問題

現代 Linux 系統會使用基於 MAC 位址的可預測網路介面命名,因此 Wi-Fi 介面不會叫做 wlan0,而是類似 wlxc87f549a5c4e 這樣的名稱。

查看無線介面

# 使用 iwconfig
iwconfig
使用 ip 指令
ip link show
使用 NetworkManager
nmcli device

啟用網路介面

如果介面沒有自動啟用,手動啟用:

sudo ip link set wlxc87f549a5c4e up

設定自動連接

為了避免每次重開機都要手動啟用,需要設定自動連接:

# 查看現有連線
nmcli connection show

# 設定 Wi-Fi 連線自動連接
nmcli connection modify "你的WiFi名稱" connection.autoconnect yes

# 設定裝置自動連接
nmcli device set wlxc87f549a5c4e autoconnect yes

連接 Wi-Fi 網路

方法 1: 使用 NetworkManager CLI

# 掃描可用網路
nmcli device wifi list
連接到 Wi-Fi
nmcli device wifi connect "WiFi名稱" password "密碼"

方法 2: 使用圖形界面

安裝成功後,直接在 Ubuntu 系統設定的 Wi-Fi 選項中就能看到可用的無線網路,點擊連接即可。

核心更新後的處理

每次系統核心更新後,需要重新編譯驅動:

cd ~/rtl8852au
git pull
make clean
make
sudo make install

使用 DKMS 自動重新編譯(推薦)

DKMS (Dynamic Kernel Module Support) 可以在核心更新時自動重新編譯驅動:

# 加入 DKMS
sudo dkms add .

# 編譯
sudo dkms build rtl8852au -v 1.15.0.1

# 安裝
sudo dkms install rtl8852au -v 1.15.0.1

# 載入驅動
sudo modprobe 8852au
提示:設定完成後,之後核心更新就不需要手動重新編譯了。

疑難排解

問題 1: 執行 modprobe 後沒有錯誤,但看不到無線介面

解決方法:檢查 dmesg 訊息,確認驅動是否真的載入成功:

sudo dmesg | grep -i rtl8852

問題 2: D-Link DWA-X1850 裝置顯示為 USB 儲存裝置

如果你的裝置是 D-Link DWA-X1850,lsusb 顯示 ID 為 0bda:1a2b,表示裝置處於 USB 儲存模式。

解決方法:編輯 /usr/lib/udev/rules.d/40-usb_modeswitch.rules/lib/udev/rules.d/40-usb_modeswitch.rules,加入:
# D-Link DWA-X1850 Wifi Dongle
ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="usb_modeswitch '/%k'"

然後重新載入 udev 規則:

sudo udevadm control --reload-rules
sudo udevadm trigger

拔掉後重新插入 USB 裝置。

問題 3: 編譯時出現錯誤

解決方法:確認核心標頭檔版本與目前執行的核心版本一致:

uname -r
dpkg -l | grep linux-headers

如果不一致,安裝對應版本的標頭檔。

支援的裝置列表

這個驅動支援以下裝置(來自官方文件):

裝置名稱 USB ID
BUFFALO WI-U3-1200AX2(/N) 0411:0312
ASUS USB-AX56 0b05:1997 或 0b05:1a62
EDUP EP-AX1696GS 0bda:8832
Fenvi FU-AX1800P 0bda:885c
D-Link DWA-X1850 2001:3321
TP-Link AX1800 2357:013f 或 2357:0141
ipTIME AX2000U 0bda:8832
ELECOM WDC-X1201DU3 056e:4020
Realtek 展示板 0bda:8832, 0bda:885a, 0bda:885c

效能測試

安裝完成後測試連接速度,在 Wi-Fi 6 路由器下:

  • 連接速度: 1200 Mbps (理論值)
  • 實際下載速度: 約 600-800 Mbps
  • 延遲: 穩定在 2-5ms
  • 訊號強度: 表現良好

結論

雖然 Linux 對於較新的硬體支援需要手動安裝驅動,但整個過程並不複雜。lwfinger 維護的這個驅動版本相當穩定,安裝後運作正常,效能表現也很好。建議使用 DKMS 來管理驅動模組,可以省去核心更新後手動重新編譯的麻煩。

參考資源

本文記錄於 2024 年 12 月,使用 Ubuntu 23.10 系統

2025年12月13日 星期六

在 Mint Linux 21.3 (Ubuntu 22.04 LTS) 裝嘸蝦米 with fcitx4

想在 Mint Linux 上安裝嘸蝦米,簡單來說

在 Mint Linux 21.3 (Ubuntu 22.04 LTS) 裝嘸蝦米 with fcitx 4

在 Mint Linux 22.1 (Ubuntu 24.04 LTS) 裝嘸蝦米 with fcitx 5

=====================================================

Mint Linux 22.1 安裝很簡單,只要在「軟體管理員」搜尋 fcitx5-table-boshiamy

安裝好後重新登入,在 Fcitx 設定裡就可以看到嘸蝦米可選,並將其加入。

=====================================================

在 Mint Linux 21.3 則要用指令的方式

sudo apt update
sudo apt install fcitx fcitx-table-boshiamy im-config


若你曾經裝過fcitx5,須先移除後再裝一次
sudo apt purge fcitx5* im-config

安裝好後輸入 im-config 來設定選擇以 fcitx 作為輸入器


======================================================

22.1 安裝方式乃參考jute的
[無需指令] 在 Linux Mint 22.1 Cinnamon 上安裝嘸蝦米輸入法
https://jute.im/boshiamy/installing-boshiamy-on-linux-mint-22-1-cinnamon-without-any-command/
Linux 與嘸蝦米(feat. Fcitx)
https://jute.im/boshiamy/my-review-of-installing-fcitx-with-boshiamy-table-on-linux/




2025年9月16日 星期二

Win10, set default browser by registry

modify regesitry, set default browser

 reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge /v DefaultBrowserSettingEnabled /t REG_DWORD /d 0 /f

2024年6月20日 星期四

Fix Git CRLF issue

git config --global core.autocrlf input


 https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf



https://www.huanlintalk.com/2011/05/git-coreautocrlf.html

2024年5月27日 星期一

Use nvm-windows but not able to switch to correct node version

 Install NVM-Windows

remove the nodejs windows version

nvm install 18

nvm ls (see 18)

nvm use 18 (say used)

node -v

'node' is not recognized as an internal or external command,

operable program or batch file.

solve: Go to C:\Programs\nodejs

remove the folder C:\Programs\nodejs

then check again will success

2023年2月14日 星期二

NET::ERR_CERT_INVALID 頁面沒有繼續前往XXX網站的連結

 開啟一個沒有SSL的網站,會被 Chrome 認為是不安全的網站,由於憑證不被信任的關係會出現錯誤代碼 NET::ERR_CERT_INVALID

若已知是安全的,通常點擊「進階」會出現「繼續前往 XXXX 網站(不安全)」後就能進入



但有時候不知為何Chrome會擋住,連點擊的連結都消失了,例如下圖:


別緊張,這時候在網頁空白處,點擊一下,並輸入「thisisunsafe」,就可以連線了喔!







2021年10月26日 星期二

Docker Desktop Upgrade Failed

 

Docker Desktop Upgrade Failed



Here is a new update version could install

Click Install & Restart but not working.


Or select "Download update" to upgrade Docker Desktop


It starts to downloading, but always failed or no response.


Says installation failed.



The problem might be the service won't stop, let us stop it manually.


Go to Windows Services, find out Docker Desktop Service, then stop it.



Then it's stoping.


Download install file from official website: 
Docker Desktop


Execute the install package, start to install.


If you see it's unpacking, sound good.



It might occur some warning, ignore it.



Finally, the installation succeeded.



Chck out the About dialog, it's updated.


2021年8月7日 星期六

How to remove OneDrive 如何移除

Terminated process first.
(首先停止正在執行的OneDrive程序)

 taskkill /f /im OneDrive.exe

According to your OS type:
(根據OS版本)

open cmd with administrator permission
(以系統管理員身份執行)

32bit
%SystemRoot%\System32\OneDriveSetup.exe /uninstall

64bit
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

2021年5月4日 星期二

Webstorm can't resolve module with vue-cli, setup webpack config for alias. 解決Webstorm無法解析路徑的問題

WebStorm can't resolve alias if project created by vue-cli.

Because vue-cli didn't set up via webpack, the alias can't resolved without webpack config.

To fix this problem, we can specify a webpack config for WebStorm to recognize alias.

[Setting] > [Language & Frameworks] > [JavaScript] > [Webpack]



Here are my references.

[1] https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000556284/comments/360000093780

[2] https://juejin.cn/post/6844903802185891848

[3] https://cli.vuejs.org/guide/webpack.html#inspecting-the-project-s-webpack-config


Updated

In unknown problem, all above action can't fix the resolution issue. But I found some trick: Go to any *.vue file, move to import block, right click on any component then install it. And it will solved. Unbeleible. Amazing.


Updated-2

No need to set webpack config because it always says: 
Can't analyse webpack.config.js: coding assistance will ignore module resolution rules in this file.
The rest current setting: node_module was excluded. src was rescouce root.
Rewritre vue.config.js, let it re-index, then it can resolved correctly.
I rewrite 

config.resolve.alias
.set('@img', path.resolve(__dirname, 'src/asset/images'))
.set('@common', path.resolve(__dirname, 'src/components/common'))
.set('Source', path.resolve(__dirname, 'src'));
to
config.resolve.alias
.
set('_img', path.resolve(__dirname, 'src/asset/images'))
.
set('_common', path.resolve(__dirname, 'src/components/common'))
.
set('Source', path.resolve(__dirname, 'src')); then re-write back
config.resolve.alias
.set('@img', path.resolve(__dirname, 'src/asset/images'))
.set('@common', path.resolve(__dirname, 'src/components/common'))
.set('Source', path.resolve(__dirname, 'src'));

Updated-3

[Setting] > [Language & Frameworks] > [JavaScript] > [Webpack]
=> Set as Automatic.


Select node_module folder, right click to popup menu, click "Optimize Imports"
=> it's work!

Or, select "src" root, do "Optimize Imports".
=> it's work!

Or, select any single *.vue, do "Optimize Imports".


[1] https://youtrack.jetbrains.com/issue/WEB-27933



2021年4月1日 星期四

解決執行Bat檔案,第一行是亂碼。不是內部或外部命令、可執行的程式或批次檔。


 如上圖,每次執行BAT檔第一行一定會出現亂碼報錯。

這有可能是該BAT檔的文件編碼選到UTF-8。

要正確顯示BAT檔,需改成ANSI格式。

可利用Notepad++或以記事本開啟BAT檔後另存新檔時將編碼改選為ANSI

以上