这是一个非常常见的问题。每次奇数次重启或重新启动都会导致 Wi-Fi 连接正常,偶数次重启则会导致连接失败。
HP 笔记本电脑 15-g018dx,全新安装 Ubuntu 桌面并进行升级/更新。
版本:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
适配器:
$ lspci -vvnn | grep Network
03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8188EE Wireless Network Adapter [10ec:8179] (rev 01)
Subsystem: Hewlett-Packard Company RTL8188EE Wireless Network Adapter [103c:197d]
NetworkManager工作时的状态:
$ sudo service NetworkManager status
NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-01-19 18:39:51 PST; 7min ago
Main PID: 940 (NetworkManager)
CGroup: /system.slice/NetworkManager.service
├─ 940 /usr/sbin/NetworkManager --no-daemon
├─1142 /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /var/run/dhclient-wlo1.pid -lf /var/lib/NetworkManager/dhclient-ead33c49-08dd-4240-ae63-1edec65394f6-wlo1.lease -cf /var/lib/NetworkManager/dhclient-wlo1.conf wlo1
└─1154 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
dhclient[1318]: XMT: Info-Request on wlo1, interval 940ms.
dhclient[1318]: RCV: Reply message on wlo1 from fe80::a62b:8cff:fed2:ab22.
NetworkManager[940]: <info> nameserver '2001:578:3f::30'
NetworkManager[940]: <info> nameserver '2001:578:3f:1::30'
NetworkManager[940]: <info> dhcp6 (wlo1): state changed unknown -> bound
NetworkManager[940]: <info> dhcp6 (wlo1): client pid 1318 exited with status 0
NetworkManager[940]: <info> dhcp6 (wlo1): state changed bound -> done
NetworkManager[940]: <info> WiFi hardware radio set enabled
NetworkManager[940]: <info> WWAN hardware radio set enabled
NetworkManager[940]: <info> manager: startup complete
NetworkManager 不工作时的状态:
$ sudo service NetworkManager status
NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-01-19 18:49:12 PST; 1min 6s ago
Main PID: 917 (NetworkManager)
CGroup: /system.slice/NetworkManager.service
└─917 /usr/sbin/NetworkManager --no-daemon
NetworkManager[917]: <warn> failed to enumerate oFono devices: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
NetworkManager[917]: <info> ModemManager available in the bus
NetworkManager[917]: <info> supplicant: wpa_supplicant running
NetworkManager[917]: <info> device (wlo1): supplicant interface state: init -> starting
NetworkManager[917]: <info> device (wlo1): supplicant interface state: starting -> ready
NetworkManager[917]: <info> device (wlo1): state change: unavailable -> disconnected (reason 'supplicant-available') [20 30 42]
NetworkManager[917]: <info> device (wlo1): supplicant interface state: ready -> inactive
NetworkManager[917]: <info> manager: startup complete
NetworkManager[917]: <info> WiFi hardware radio set enabled
NetworkManager[917]: <info> WWAN hardware radio set enabled
最后,当 Syslog 良好时(以及当 Syslog 不好时,常用以下星号标记):
* kernel: rtl8188ee 0000:03:00.0 wlo1: renamed from wlan0
* NetworkManager: <info> devices added (path: /sys/devices/pci0000:00/0000:00:02.4/0000:03:00.0/net/wlo1, iface: wlo1)
* NetworkManager: <info> device added (path: /sys/devices/pci0000:00/0000:00:02.4/0000:03:00.0/net/wlo1, iface: wlo1): no ifupdown configuration found.
* NetworkManager: <info> (wlo1): using nl80211 for WiFi device control
* NetworkManager: <info> device (wlo1): driver supports Access Point (AP) mode
* NetworkManager: <info> manager: (wlo1): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/2)
* NetworkManager: <info> device (wlo1): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
* kernel: IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
* kernel: IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
* NetworkManager: <info> device (wlo1): supplicant interface state: init -> starting
* NetworkManager: <info> device (wlo1): supplicant interface state: starting -> ready
* NetworkManager: <info> device (wlo1): state change: unavailable -> disconnected (reason 'supplicant-available') [20 30 42]
* kernel: IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
* NetworkManager: <info> device (wlo1): supplicant interface state: ready -> inactive
NetworkManager: <info> device (wlo1): Activation: starting connection 'My-Wi-Fi' (ead33c49-08dd-4240-ae63-1edec65394f6)
NetworkManager: <info> device (wlo1): state change: disconnected -> prepare (reason 'none') [30 40 0]
NetworkManager: <info> device (wlo1): state change: prepare -> config (reason 'none') [40 50 0]
NetworkManager: <info> device (wlo1): Activation: (wifi) access point 'My-Wi-Fi' has security, but secrets are required.
NetworkManager: <info> device (wlo1): state change: config -> need-auth (reason 'none') [50 60 0]
NetworkManager: <info> device (wlo1): state change: need-auth -> prepare (reason 'none') [60 40 0]
NetworkManager: <info> device (wlo1): state change: prepare -> config (reason 'none') [40 50 0]
NetworkManager: <info> device (wlo1): Activation: (wifi) connection 'My-Wi-Fi' has security, and secrets exist. No new secrets needed.
NetworkManager: <info> sup-iface[0x248fa10,wlo1]: config: set interface ap_scan to 1
wpa_supplicant: wlo1: SME: Trying to authenticate with a4:2b:8c:d2:ab:23 (SSID='My-Wi-Fi' freq=2462 MHz)
kernel: wlo1: authenticate with a4:2b:8c:d2:ab:23
NetworkManager: <info> device (wlo1): supplicant interface state: inactive -> authenticating
wpa_supplicant: wlo1: Trying to associate with a4:2b:8c:d2:ab:23 (SSID='My-Wi-Fi' freq=2462 MHz)
kernel: wlo1: send auth to a4:2b:8c:d2:ab:23 (try 1/3)
kernel: wlo1: authenticated
当这些靴子不工作时,做一个sudo /etc/init.d/network-manager stop
然后...start
不能解决问题。
当情况不好时,面板应用中不会显示任何 Wi-Fi 区域。它认为该面板中启用了网络和 Wi-Fi。切换键盘 Wi-Fi 也无济于事。
由于这篇文章已经很长了,我不会再添加对 good->suspend->re-awaken 的分析。
有什么想法吗?我考虑过把链接放到 /etc/rc6.d 中,但我自己不太会尝试。