笔记本电脑屏幕关闭时 WI-FI 连接断开

笔记本电脑屏幕关闭时 WI-FI 连接断开

我在一台用作服务器的笔记本电脑上运行 Ubuntu LTS 22.04。几天以来,每当我的笔记本电脑屏幕关闭时,我的 Wi-Fi 连接就会断开。2 分钟后,电源设置中的屏幕会关闭以节省电量,因为它主要只是作为服务器工作,但只要笔记本电脑由适配器供电,它就不会切换到低功耗模式。(正常情况)(自 22.04 发布时安装以来,它一直以这种方式稳定运行,直到现在都没有出现任何问题。)每当我移动鼠标时,Wi-Fi 连接就会重新建立,服务器又可以正常工作了。问题是现在服务器显然无法运行,因为它大多数时候都无法访问。最近更新后还有其他人遇到过这个问题吗?或者您能给我一些关于如何调试或修复这个问题的建议吗?谢谢

我有一些来自 DMESG 的提示,有人建议我运行它,它粘贴在下面...所以看起来我有一个以前在搜索中看到的问题。我还没有找到解决方案,我也不清楚为什么它最近开始出现,而我的硬件没有发生任何变化,但我刚开始搜索错误,我偶然发现了解决方案。但是,如果有人有好的提示,请随时帮助我 ;-)

[106559.442845] wlx2cd05a59734b: associated
[106559.506142] wlx2cd05a59734b: Limiting TX power to 30 (30 - 0) dBm as advertised by 3c:84:6a:90:07:b2
[108019.154016] wlx2cd05a59734b: disconnect from AP 3c:84:6a:90:07:b2 for new auth to 3c:84:6a:90:07:c6
[108019.274182] wlx2cd05a59734b: authenticate with 3c:84:6a:90:07:c6
[108019.274222] wlx2cd05a59734b: 80 MHz not supported, disabling VHT
[108019.282464] wlx2cd05a59734b: send auth to 3c:84:6a:90:07:c6 (try 1/3)
[108019.485528] wlx2cd05a59734b: send auth to 3c:84:6a:90:07:c6 (try 2/3)
[108019.487949] wlx2cd05a59734b: authenticated
[108019.489504] wlx2cd05a59734b: associate with 3c:84:6a:90:07:c6 (try 1/3)
[108019.494782] wlx2cd05a59734b: RX ReassocResp from 3c:84:6a:90:07:c6 (capab=0x1431 status=0 aid=2)
[108019.497010] usb 1-1.4: rtl8xxxu_bss_info_changed: HT supported
[108019.500141] wlx2cd05a59734b: associated
[108019.580866] wlx2cd05a59734b: Limiting TX power to 30 (30 - 0) dBm as advertised by 3c:84:6a:90:07:c6
[108022.601033] wlx2cd05a59734b: deauthenticated from 3c:84:6a:90:07:c6 (Reason: 2=PREV_AUTH_NOT_VALID)
[113139.317091] perf: interrupt took too long (7864 > 7848), lowering kernel.perf_event_max_sample_rate to 25250
[126718.134276] audit: type=1400 audit(1677312009.899:269): apparmor="DENIED" operation="capable" class="cap" profile="/usr/sbin/cupsd" pid=27108 comm="cupsd" capability=12  capname="net_admin"
[158703.591538] wlx2cd05a59734b: authenticate with 3c:84:6a:90:07:b2
[158703.606391] wlx2cd05a59734b: send auth to 3c:84:6a:90:07:b2 (try 1/3)
[158703.612001] wlx2cd05a59734b: authenticated
[158703.614917] wlx2cd05a59734b: associate with 3c:84:6a:90:07:b2 (try 1/3)
[158703.629781] wlx2cd05a59734b: RX AssocResp from 3c:84:6a:90:07:b2 (capab=0x1431 status=0 aid=4)
[158703.631633] usb 1-1.4: rtl8xxxu_bss_info_changed: HT supported
[158703.634487] wlx2cd05a59734b: associated
[158703.685622] IPv6: ADDRCONF(NETDEV_CHANGE): wlx2cd05a59734b: link becomes ready
[158703.739770] wlx2cd05a59734b: Limiting TX power to 30 (30 - 0) dBm as advertised by 3c:84:6a:90:07:b2

好的,我已经更新了我认为我的情况已经得到解决的进展情况,祝好运。

首先我通过更改此文件的内容来更改网络设置,以避免电源设置影响我的 WIFI:/etc/NetworkManager/conf.d/default-wifi-powersafe-on.conf

其中有一个部分,在我的情况下是这样的:[连接] wifi.powersave = 3

我将其更改为:[connection] wifi.powersave=2

根据我在搜索结果中发现的内容,3 表示省电功能已启用,2 表示已禁用。这有助于在笔记本电脑进入睡眠状态时保持连接,但我仍然会不时地断开与互联网的连接。

幸运的是,有一次我正坐在笔记本电脑前,突然它断开了连接,此时我输入了这个命令:

sudo journalctl  --since="-5 minutes"

给了我一个至关重要的提示:

kernel: wlx2cd05a59734b: Limiting TX power to 30 (30 - 0) dBm as advertised by 3c:84:6a:90:07:c6
kernel: wlx2cd05a59734b: deauthenticated from 3c:84:6a:90:07:c6 (Reason: 2=PREV_AUTH_NOT_VALID)
wpa_supplicant[1162]: wlx2cd05a59734b: CTRL-EVENT-DISCONNECTED bssid=3c:84:6a:90:07:c6 reason=2
wpa_supplicant[1162]: wlx2cd05a59734b: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wpa_supplicant[1162]: wlx2cd05a59734b: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="WIFI" auth_failures=1 duration=10 reason=WRONG_KEY
wpa_supplicant[1162]: BSSID 3c:84:6a:90:07:c6 ignore list count incremented to 2, ignoring for 10 seconds
wpa_supplicant[1162]: wlx2cd05a59734b: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
NetworkManager[1130]: <info>  [1677521293.5474] device (wlx2cd05a59734b): supplicant interface state: 4way_handshake -> disconnected
NetworkManager[1130]: <info>  [1677521293.5476] device (wlx2cd05a59734b): Activation: (wifi) disconnected during association, asking for new key
Feb 27 10:08:13 christia-Lenovo-IdeaPad-Yoga-13 NetworkManager[1130]: <info>  [1677521293.5479] device (wlx2cd05a59734b): state change: activated -> need-auth (reason 'supplicant-disconnect', sys-iface-state: 'managed')

此后,我将路由器加密更改为 WPA3(后来又改回 WPA2,因为并非所有设备都支持 WPA3),以重置网络密钥,至少在过去 4 个小时里,这种方法似乎奏效了。(我可能只是选择忘记网络并重新申请,但我会告诉你我到底做了什么,以防万一会有所不同)

希望这能帮助面临同样问题的人。

相关内容