Ubuntu 20.04 Wifi 无法自动连接

Ubuntu 20.04 Wifi 无法自动连接

我在一台新电脑上安装了 Ubuntu 20.04,并使用 wifi 适配器(https://www.amazon.in/Live-Tech-Nano-Wirless-Adapter/dp/B078SSXTG7) 连接到 wifi。我保存了密码,但每次启动 Ubuntu 时,我都必须手动连接到 wifi 网络并提供密码。它不会自动连接。此外,当我进入可见网络下的 wifi 设置时,我看到我的 wifi 有几个重复的条目 - 每次我输入密码时都有一个。有人能帮我吗?如果需要更多信息,请告诉我。

sudo lsusb 的输出

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04ca:0061 Lite-On Technology Corp. 
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 003: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
Bus 001 Device 002: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

sudo lspci 的输出

00:00.0 Host bridge: Intel Corporation Device 4c43 (rev 01)
00:02.0 VGA compatible controller: Intel Corporation Device 4c8a (rev 04)
00:08.0 System peripheral: Intel Corporation Device 4c11 (rev 01)
00:14.0 USB controller: Intel Corporation Device 43ed (rev 11)
00:14.2 RAM memory: Intel Corporation Device 43ef (rev 11)
00:16.0 Communication controller: Intel Corporation Device 43e0 (rev 11)
00:17.0 SATA controller: Intel Corporation Device 43d2 (rev 11)
00:1c.0 PCI bridge: Intel Corporation Device 43bc (rev 11)
00:1f.0 ISA bridge: Intel Corporation Device 4387 (rev 11)
00:1f.3 Audio device: Intel Corporation Device 43c8 (rev 11)
00:1f.4 SMBus: Intel Corporation Device 43a3 (rev 11)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Device 43a4 (rev 11)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (10) I219-V (rev 11)
01:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. Device 500f (rev 03)

sudo lshw -c network 的输出

 *-network                 
       description: Ethernet interface
       product: Ethernet Connection (10) I219-V
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       logical name: eno1
       version: 11
       serial: d8:bb:c1:64:2b:ae
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=5.11.0-43-generic firmware=0.6-4 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:122 memory:92200000-9221ffff
  *-network
       description: Wireless interface
       physical id: 2
       bus info: usb@1:7
       logical name: wlx82316482c99f
       serial: 82:31:64:82:c9:9f
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=r8188eu driverversion=5.11.0-43-generic ip=192.168.29.132 multicast=yes wireless=IEEE 802.11bgn

答案1

由于某种原因,通过内置方法自动连接 Wi-Fi 仍然不起作用。我找到了一种在启动时连接 Wi-Fi 的替代方法(使用上面 @mchid 提到的已知 BSSID)。

要获取您的 wifi 的 BSSID,请参考以下问题。

获取 BSSID 并连接到它是从这里开始的。

nmcli -f in-use,ssid,bssid,signal,bars  dev wifi

从上面获取 BSSID 后,创建一个 shell 脚本 connect.sh,其中包含以下文本

#!/bin/bash
nmcli d wifi connect xx:xx:xx:xx:xx:xx password "yourpassword"

将 xx:xx:xx:xx:xx:xx 替换为您的 BSSID。保存文件并更改文件权限以使其可执行

chmod +x connect.sh

在 Ubuntu 20.04 中,有一个可以从 GUI 访问的应用程序“启动应用程序”。在启动应用程序中添加上述脚本文件,现在它会在启动时自动连接。

相关内容