我在 Ubuntu 上的 WiFi 卡遇到了一個非常令人困惑的問題。重新啟動後,它始終處於停用狀態,除了暫停或關閉筆記型電腦之外,沒有其他方法可以將其恢復。網路管理器顯示的狀態為「設備未就緒」。這種情況持續發生。
我的系統的一些背景:
- 筆記型電腦是 HP 350 G1。
- WLAN 卡是臭名昭著的 Ralink RT3290。 (如果我知道我會遇到多少麻煩,我就不會買它)。
- Ubuntu是最新的LTS 16.04,最近升級了。
- 核心是
4.4.9-040409-generic
(4.4.0-22-generic
在從主線升級之前 - 與 WiFi 沒有區別)。
在升級發行版之前,我使用了一個版本的rt3290sta/2.6.0.0
驅動程式(從源代碼編譯並通過DKMS 加載),它的性能大部分都很好,但它不適用於較新的內核,而且似乎已經被放棄了。所以現在我不得不恢復rt2800
並從那時起就遇到了這個問題。
這似乎是一個非常古老但反覆出現的問題。我通讀了我能找到的所有線索,但到目前為止還沒有運氣。幸運的是,這對我來說並不重要,因為我很少重新啟動,但至少它仍然令人煩惱和困擾。
以下是一些可能感興趣的命令的輸出(這是重新啟動後的狀態):
lshw -c network
說接口被禁用:
# lshw -c network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: eth0
version: 10
serial: c4:34:6b:05:5f:ff
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-3_0.0.1 04/23/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:43 ioport:4000(size=256) memory:b2504000-b2504fff memory:b2500000-b2503fff
*-network DISABLED
description: Wireless interface
product: RT3290 Wireless 802.11n 1T/1R PCIe
vendor: Ralink corp.
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlan0
version: 00
serial: 00:71:cc:6b:fe:f1
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=rt2800pci driverversion=4.4.9-040409-generic firmware=0.37 latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
resources: irq:17 memory:b2410000-b241ffff
*-network DISABLED
description: Ethernet interface
physical id: 1
logical name: virbr0-nic
serial: 52:54:00:e5:13:31
size: 10Mbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s
但rfkill list
不同意:
# rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
# iwconfig
virbr0-nic no wireless extensions.
eth0 no wireless extensions.
wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
virbr0 no wireless extensions.
lo no wireless extensions.
但我們不能提出它:
# ifconfig wlan0 up
SIOCSIFFLAGS: Input/output error
dmesg
顯示了其中一些錯誤:
# dmesg
...
[ 27.648857] ieee80211 phy0: rt2800_wait_wpdma_ready: Error - WPDMA TX/RX busy [0x00000068]
[ 29.248929] ieee80211 phy0: rt2800_wait_wpdma_ready: Error - WPDMA TX/RX busy [0x00000068]
[ 29.248936] ieee80211 phy0: rt2800pci_set_device_state: Error - Device failed to enter state 4 (-5)
...
最後,其中一部分syslog
看起來與我有關:
# cat /var/log/syslog | grep -i wlan
...
May 10 22:09:25 hp350g1 NetworkManager[820]: [1462910965.2639] devices added (path: /sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/wlan0, iface: wlan0)
May 10 22:09:25 hp350g1 NetworkManager[820]: [1462910965.2639] device added (path: /sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/wlan0, iface: wlan0): no ifupdown configuration found.
May 10 22:09:25 hp350g1 NetworkManager[820]: [1462910965.6626] (wlan0): using nl80211 for WiFi device control
May 10 22:09:25 hp350g1 NetworkManager[820]: [1462910965.6645] device (wlan0): driver supports Access Point (AP) mode
May 10 22:09:25 hp350g1 NetworkManager[820]: [1462910965.6813] manager: (wlan0): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/0)
May 10 22:09:25 hp350g1 NetworkManager[820]: [1462910965.6882] device (wlan0): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
May 10 22:09:25 hp350g1 kernel: [ 5.704724] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
May 10 22:09:29 hp350g1 NetworkManager[820]: [1462910969.0227] device (wlan0): supplicant interface state: init -> starting
May 10 22:09:32 hp350g1 wpa_supplicant[1339]: Could not set interface wlan0 flags (UP): Input/output error
May 10 22:09:32 hp350g1 wpa_supplicant[1339]: nl80211: Could not set interface 'wlan0' UP
May 10 22:09:32 hp350g1 wpa_supplicant[1339]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
May 10 22:09:35 hp350g1 wpa_supplicant[1339]: Could not set interface wlan0 flags (UP): Input/output error
May 10 22:09:35 hp350g1 wpa_supplicant[1339]: WEXT: Could not set interface 'wlan0' UP
May 10 22:09:35 hp350g1 wpa_supplicant[1339]: wlan0: Failed to initialize driver interface
May 10 22:09:35 hp350g1 NetworkManager[820]: [1462910975.4904] sup-iface[0x2450570,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
May 10 22:09:35 hp350g1 NetworkManager[820]: [1462910975.4904] device (wlan0): supplicant interface state: starting -> down
May 10 22:09:46 hp350g1 NetworkManager[820]: [1462910986.0143] device (wlan0): re-acquiring supplicant interface (#1).
May 10 22:09:49 hp350g1 wpa_supplicant[1339]: Could not set interface wlan0 flags (UP): Input/output error
May 10 22:09:49 hp350g1 wpa_supplicant[1339]: nl80211: Could not set interface 'wlan0' UP
May 10 22:09:49 hp350g1 wpa_supplicant[1339]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
May 10 22:09:52 hp350g1 wpa_supplicant[1339]: Could not set interface wlan0 flags (UP): Input/output error
May 10 22:09:52 hp350g1 wpa_supplicant[1339]: WEXT: Could not set interface 'wlan0' UP
May 10 22:09:52 hp350g1 wpa_supplicant[1339]: wlan0: Failed to initialize driver interface
May 10 22:09:52 hp350g1 NetworkManager[820]: [1462910992.4485] sup-iface[0x24506d0,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
... (after couple more tries)
May 10 22:11:00 hp350g1 NetworkManager[820]: [1462911060.4668] device (wlan0): supplicant interface state: starting -> down
May 10 22:11:00 hp350g1 NetworkManager[820]: [1462911060.4669] device (wlan0): supplicant interface keeps failing, giving up
答案1
驅動程式 rt2800pci 需要從裝置卸載韌體,該韌體在重新啟動期間仍然存在。在 Ubuntu 16.04 中,在重新啟動之前,您需要執行以下命令:
sudo rmmod rt2800pci
然後重新啟動。
為了自動執行重新啟動任務,請建立一個/etc/init.d/rt3290removedriver
包含以下內容的 shell 腳本:
#!/bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d. This example start a
# single forking daemon capable of writing a pid
# file. To get other behavoirs, implemend
# do_start(), do_stop() or other functions to
# override the defaults in /lib/init/init-d-script.
### END INIT INFO
# /etc/init.d/rt3290removedriver
case "$1" in
start)
echo "Removal of driver rt2800pci success" > /home/youruser/rt2800pci.txt
echo "Power Down"
;;
stop)
rmmod rt2800pci
echo "Removal of driver rt2800pci success" > /home/youruser/rt2800pci.txt
echo "Power Down"
exit 1
;;
*)
rmmod rt2800pci
echo "Removal of driver rt2800pci success" > /home/youruser/rt2800pci.txt
echo "Power Down"
exit 1
;;
esac
exit 0
然後使用命令更新腳本
sudo update-rc.d rt3290removedriver defaults
你就完成了。將腳本中的 youruser 替換為您的使用者名稱。在配備 Ubuntu 16.04 和 rt3290 wifi pci 卡的 HP Pavilion 上進行了測試。
答案2
如果您有 Windows 雙重啟動,請嘗試載入 Windows,然後返回 Ubuntu。 Windows 往往會覆蓋某些筆記型電腦上的 BIOS 設定。
我的 ProBook 4540 也有同樣的問題,這解決了它。
當我載入帶有 Ubuntu 14.04 的 live USB 時,我產生了懷疑。我在網路管理員選單中看到了與安裝的 16.04 相同的訊息。
答案3
無法讓它工作。找到解決方案:
http://www.mediafire.com/download/zyfql95clzs24z0/RT3290_u16.tar.gz
sudo ifconfig -a
將列出所有可用的乙太網路介面。現在透過以下方式啟動您的 WIFI 介面:
sudo ifconfig interface-name up
作者:Md Imam Hossain