我一直在寻找如何将 ALFA AWUS036NHA 网络适配器设置为笔记本电脑的网络接口,但运气不佳。我尝试安装驱动程序,但不确定问题是否出在这里。我的内置 wifi 总是断线,所以我想试试外置的。
我会尝试提供所有相关信息,但尽管我经常使用 ubuntu,但我对 linux 并不熟悉,因此,如果我遗漏了任何信息,请让我添加。
当我运行时lsusb
,我得到输出:
Bus 001 Device 002: ID 8087:8001 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 0cf3:9271 Qualcomm Atheros Communications AR9271 802.11n
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
所以我可以看到它位于倒数第二个条目中。
当我运行时iwconfig
,我得到输出:
wlx00c0ca993a0c IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
针对相关设备。我不确定如何用这个连接任何东西。我试过了,ifconfig wlx00c0ca993a0c up
但似乎什么也没做。
然后我尝试安装驱动程序。首先我尝试:
sudo apt-get update
sudo apt-get install firmware-ath9k-htc
reboot
再次,什么也没有发生,即使在
sudo ifconifig wlp3s0 down
sudo ifconfig wlx00c0ca993a0c
我尝试的最后一件事是使用
sudo apt-get update
sudo apt-get install firmware-atheros
然后这提示我添加密钥,我照做了。之后我再次运行命令并得到输出:
The following NEW packages will be installed
firmware-atheros
0 to upgrade, 1 to newly install, 0 to remove and 27 not to upgrade.
Need to get 0 B/873 kB of archives.
After this operation, 1,803 kB of additional disk space will be used.
(Reading database ... 204024 files and directories currently installed.)
Preparing to unpack .../firmware-atheros_0.43_all.deb ...
Unpacking firmware-atheros (0.43) ...
dpkg: error processing archive /var/cache/apt/archives/firmware-atheros_0.43_all.deb (--unpack):
trying to overwrite '/lib/firmware/htc_7010.fw', which is also in package linux-firmware 1.187.27
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/firmware-atheros_0.43_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
任何帮助都将不胜感激。非常感谢 :)
编辑1:运行后sudo modprobe athk9_htc
,没有得到任何输出。
运行sudo dmesg | grep ath
得到输出:
[ 3.031592] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.dev.0.fw requested
[ 3.031718] usbcore: registered new interface driver ath9k_htc
[ 3.321557] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 3.572001] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 3.854140] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[ 3.854144] ath9k_htc 2-1:1.0: FW RMW support: On
[ 3.854146] ath: EEPROM regdomain: 0x833a
[ 3.854147] ath: EEPROM indicates we should expect a country code
[ 3.854148] ath: doing EEPROM country->regdmn map search
[ 3.854149] ath: country maps to regdmn code: 0x37
[ 3.854150] ath: Country alpha2 being used: GB
[ 3.854151] ath: Regpair used: 0x37
[ 3.863026] ath9k_htc 2-1:1.0 wlx00c0ca993a0c: renamed from wlan0
[ 366.623494] ath: phy1: Failed to wakeup in 500us
[ 366.633781] ath: phy1: Failed to wakeup in 500us
[ 366.689730] usb 2-1: ath9k_htc: USB layer deinitialized
[ 538.754776] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.dev.0.fw requested
[ 539.038505] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 539.290445] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 539.556796] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[ 539.556806] ath9k_htc 2-1:1.0: FW RMW support: On
[ 539.556811] ath: EEPROM regdomain: 0x833a
[ 539.556815] ath: EEPROM indicates we should expect a country code
[ 539.556818] ath: doing EEPROM country->regdmn map search
[ 539.556820] ath: country maps to regdmn code: 0x37
[ 539.556823] ath: Country alpha2 being used: GB
[ 539.556825] ath: Regpair used: 0x37
[ 539.573422] ath9k_htc 2-1:1.0 wlx00c0ca993a0c: renamed from wlan0
[ 1037.813810] usb 2-1: ath9k_htc: USB layer deinitialized
[ 1059.511049] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.dev.0.fw requested
[ 1059.795484] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 1060.047277] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 1060.315864] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[ 1060.315869] ath9k_htc 2-1:1.0: FW RMW support: On
[ 1060.315871] ath: EEPROM regdomain: 0x833a
[ 1060.315872] ath: EEPROM indicates we should expect a country code
[ 1060.315873] ath: doing EEPROM country->regdmn map search
[ 1060.315874] ath: country maps to regdmn code: 0x37
[ 1060.315875] ath: Country alpha2 being used: GB
[ 1060.315876] ath: Regpair used: 0x37
[ 1060.331362] ath9k_htc 2-1:1.0 wlx00c0ca993a0c: renamed from wlan0
[ 4315.992158] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 4316.243814] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 6316.322040] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 6316.573622] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
编辑2:
按照 chili555 的答案的建议后,我按照答案中的方法运行了所有内容,现在当我运行时sudo dmesg | grep ath
,我得到了输出:
[ 3.031592] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.dev.0.fw requested
[ 3.031718] usbcore: registered new interface driver ath9k_htc
[ 3.321557] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 3.572001] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 3.854140] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[ 3.854144] ath9k_htc 2-1:1.0: FW RMW support: On
[ 3.854146] ath: EEPROM regdomain: 0x833a
[ 3.854147] ath: EEPROM indicates we should expect a country code
[ 3.854148] ath: doing EEPROM country->regdmn map search
[ 3.854149] ath: country maps to regdmn code: 0x37
[ 3.854150] ath: Country alpha2 being used: GB
[ 3.854151] ath: Regpair used: 0x37
[ 3.863026] ath9k_htc 2-1:1.0 wlx00c0ca993a0c: renamed from wlan0
[ 366.623494] ath: phy1: Failed to wakeup in 500us
[ 366.633781] ath: phy1: Failed to wakeup in 500us
[ 366.689730] usb 2-1: ath9k_htc: USB layer deinitialized
[ 538.754776] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.dev.0.fw requested
[ 539.038505] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 539.290445] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 539.556796] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[ 539.556806] ath9k_htc 2-1:1.0: FW RMW support: On
[ 539.556811] ath: EEPROM regdomain: 0x833a
[ 539.556815] ath: EEPROM indicates we should expect a country code
[ 539.556818] ath: doing EEPROM country->regdmn map search
[ 539.556820] ath: country maps to regdmn code: 0x37
[ 539.556823] ath: Country alpha2 being used: GB
[ 539.556825] ath: Regpair used: 0x37
[ 539.573422] ath9k_htc 2-1:1.0 wlx00c0ca993a0c: renamed from wlan0
[ 1037.813810] usb 2-1: ath9k_htc: USB layer deinitialized
[ 1059.511049] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.dev.0.fw requested
[ 1059.795484] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 1060.047277] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 1060.315864] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[ 1060.315869] ath9k_htc 2-1:1.0: FW RMW support: On
[ 1060.315871] ath: EEPROM regdomain: 0x833a
[ 1060.315872] ath: EEPROM indicates we should expect a country code
[ 1060.315873] ath: doing EEPROM country->regdmn map search
[ 1060.315874] ath: country maps to regdmn code: 0x37
[ 1060.315875] ath: Country alpha2 being used: GB
[ 1060.315876] ath: Regpair used: 0x37
[ 1060.331362] ath9k_htc 2-1:1.0 wlx00c0ca993a0c: renamed from wlan0
[ 4315.992158] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 4316.243814] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 6316.322040] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[ 6316.573622] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 8634.988784] ath: phy3: Failed to wakeup in 500us
[ 8634.998794] ath: phy3: Failed to wakeup in 500us
[ 8635.255231] usb 2-1: ath9k_htc: USB layer deinitialized
[10421.149380] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.dev.0.fw requested
[10421.433865] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.dev.0.fw, size: 51008
[10421.685730] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[10421.954366] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[10421.954374] ath9k_htc 2-1:1.0: FW RMW support: On
[10421.954378] ath: EEPROM regdomain: 0x833a
[10421.954381] ath: EEPROM indicates we should expect a country code
[10421.954383] ath: doing EEPROM country->regdmn map search
[10421.954385] ath: country maps to regdmn code: 0x37
[10421.954387] ath: Country alpha2 being used: GB
[10421.954389] ath: Regpair used: 0x37
[10421.970537] ath9k_htc 2-1:1.0 wlx00c0ca993a0c: renamed from wlan0
答案1
我注意到:“ath9k_htc/htc_9271-1.dev.0.fw”我建议您恢复原始的htc_9271-1.4.0.fw固件:
sudo apt update
sudo apt install --reinstall linux-firmware.
我们还会看到:“ath:EEPROM 表示我们应该期待一个国家代码。”我建议您明确设置监管区域。检查您的监管区域:
sudo iw reg get
如果您选择 00,则这是一个通用的设置。请在此处查找您的设置:http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2然后暂时设置一下:
sudo iw reg set IS
当然,如果不是冰岛,请替换您的国家代码。永久设置它:
sudo nano /etc/default/crda
将最后一行改为:
REGDOMAIN=IS
仔细校对,保存并关闭文本编辑器。
重启后我们再看看新的输出:
sudo dmesg | grep ath
编辑:它仍然加载了错误的固件。检查:
ls /usr/lib/firmware/ath9k_htc
我们希望只看到:
htc_7010-1.4.0.fw htc_9271-1.4.0.fw
我们怀疑您还拥有 htc_9271-1.dev.0.fw(如 dmesg 所示)。如果是这样,请重命名它,以便不会加载它:
cd /usr/lib/firmware/ath9k_htc
mv htc_9271-1.dev.0.fw htc_9271-1.dev.0.bak
重启。
检查网络管理器图标。您应该看到“USB WiFi 未连接”。您可以单击它并连接吗?