我正在使用 PyBluez,在最近的 Ubuntu 更新之后,我无法再在蓝牙适配器之间建立(低能耗)连接。
以下是更新日志:
Start-Date: 2022-07-06 15:28:01
Commandline: aptdaemon role='role-commit-packages' sender=':1.88'
Upgrade: libqmi-proxy:amd64 (1.28.6-1~20.04.1, 1.30.4-1~ubuntu20.04.1), gnupg-utils:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), gpg-wks-client:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), openssl:amd64 (1.1.1f-1ubuntu2.15, 1.1.1f-1ubuntu2.16), gnupg-l10n:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), update-notifier-common:amd64 (3.192.30.10, 3.192.30.11), azure-cli:amd64 (2.37.0-1~focal, 2.38.0-1~focal), snapd:amd64 (2.54.3+20.04.1ubuntu0.3, 2.55.5+20.04), ubuntu-advantage-tools:amd64 (27.8~20.04.1, 27.9~20.04.1), libqmi-glib5:amd64 (1.28.6-1~20.04.1, 1.30.4-1~ubuntu20.04.1), google-chrome-stable:amd64 (103.0.5060.53-1, 103.0.5060.114-1), gpg-wks-server:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), gpg:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), mainline:amd64 (1.0.15-0~202110201909~ubuntu20.04.1, 1.0.15-0~202204070351~ubuntu20.04.1), isc-dhcp-common:amd64 (4.4.1-2.1ubuntu5.20.04.2, 4.4.1-2.1ubuntu5.20.04.3), dirmngr:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), firefox-locale-en:amd64 (101.0.1+build1-0ubuntu0.20.04.1, 102.0+build2-0ubuntu0.20.04.1), gpgv:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), libmm-glib0:amd64 (1.16.6-2~20.04.1, 1.18.6-1~ubuntu20.04.1), libmbim-proxy:amd64 (1.24.8-1~20.04, 1.26.2-1~ubuntu20.04.1), libssl-dev:amd64 (1.1.1f-1ubuntu2.15, 1.1.1f-1ubuntu2.16), firefox:amd64 (101.0.1+build1-0ubuntu0.20.04.1, 102.0+build2-0ubuntu0.20.04.1), modemmanager:amd64 (1.16.6-2~20.04.1, 1.18.6-1~ubuntu20.04.1), libssl1.1:amd64 (1.1.1f-1ubuntu2.15, 1.1.1f-1ubuntu2.16), libssl1.1:i386 (1.1.1f-1ubuntu2.15, 1.1.1f-1ubuntu2.16), gnupg:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), isc-dhcp-client:amd64 (4.4.1-2.1ubuntu5.20.04.2, 4.4.1-2.1ubuntu5.20.04.3), libmbim-glib4:amd64 (1.24.8-1~20.04, 1.26.2-1~ubuntu20.04.1), gpg-agent:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), update-notifier:amd64 (3.192.30.10, 3.192.30.11), gpgconf:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2), gpgsm:amd64 (2.2.19-3ubuntu2.1, 2.2.19-3ubuntu2.2)
End-Date: 2022-07-06 15:28:55
例如,我使用 hciconfig(而不是 PyBluez)展示了这个问题,其中发生了相同的情况。使用 hciconfig,我们可以看到连接从未建立,并且 btmon 也证实了这一点,我在其中看到了蓝牙生成的事件。
$ sudo hcitool lecc --random 04:42:1A:57:16:91
Could not create connection: Connection timed out
我想将更新的软件降级,但依赖项太多,担心会破坏系统。
以下是更多可能相关的信息:
$ lspci -knn | grep Net -A3
03:00.0 Network controller [0280]: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter [168c:003e] (rev 32)
Subsystem: Lenovo QCA6174 802.11ac Wireless Network Adapter [17aa:0827]
Kernel driver in use: ath10k_pci
Kernel modules: ath10k_pci
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 10)
script /tmp/bluetooth.txt
Script started, file is /tmp/bluetooth.txt
marko@marko-Lenovo-Y520-15IKBN:/$ bluetoothd -d -n
bluetoothd[16987]: Bluetooth daemon 5.53
bluetoothd[16987]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “AlwaysPairable” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “Name” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “Class” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group “General”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have group “GATT”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have group “GATT”
bluetoothd[16987]: src/main.c:parse_config() Key file does not have group “GATT”
D-Bus setup failed: Connection ":1.131" is not allowed to own the service "org.bluez" due to security policies in the configuration file
bluetoothd[16987]: Unable to get on D-Bus
机器默认蓝牙适配器与外置蓝牙适配器之间无法建立连接,两个外置蓝牙适配器之间也无法建立连接。外置蓝牙适配器为 5.0,机器中的适配器为 4.2 蓝牙版本。
蓝牙本身工作正常(我可以连接到我的手机,发送文件,音频给我带来了麻烦,但我不知道这是否与此有关),但是,我正在做一个关于蓝牙的研究项目,我正在使用 PyBluez 与蓝牙适配器交互(执行命令,监听事件等)。除了连接之外,似乎没有什么受到更新的影响。
有人知道如何解决这个问题吗?或者可能是什么问题?我不太熟悉操作系统。