Bluez 5.50 Gatt 服务器终止后出现 D-Bus 连接错误

问题描述 投票:0回答:1

我正在运行基于 BlueZ V5.50 的 BlueZ Gatt 服务器以及 BlueZ 测试目录中包含的 example-gatt-server.py 文件。很多时候,当服务器程序退出/终止时,D-Bus 会处于不稳定状态,并且我无法在不重新启动的情况下再次成功执行该程序。

收到的错误消息如下。此错误一直持续到系统重新启动为止。

('adapter (val/add) = ', dbus.ObjectPath('/org/bluez/hci0/dev_62_D9_BD_2F_9D_DB/service0018/char0019/desc001b'), '/', '0x75e2a020')
('service_manager (val/loc) = ', <Interface <ProxyObject wrapping <dbus._dbus.SystemBus (system) at 0x75dbbea0> :1.7 /org/bluez/hci0/dev_62_D9_BD_2F_9D_DB/service0018/char0019/desc001b at 0x75e5bf90> implementing 'org.bluez.GattManager1' at 0x75db9f70>, '/', '0x75e168a0')
ERROR:dbus.connection:Unable to set arguments (dbus.ObjectPath('/'), {}) according to signature None: <type 'exceptions.ValueError'>: Unable to guess signature from an empty dict

休息时蓝牙适配器电源关闭/打开没有任何影响

错误与程序异步发生,因此 pdb 没有帮助


系统信息:

  • GNU/Lunix 4.19.42-v7 #1219
  • 带有实验标志设置的 Bluez 5.50
linux dbus bluez
1个回答
0
投票

我遇到了同样的问题,但是我工作的环境与你略有不同。我试图设置一个外围设备来广播广告数据。我尝试过的两件事是:

首先,我在终端中运行:

rfkill
,查看我的设备是否阻止了蓝牙设备。我的输出如下:

ID TYPE      DEVICE      SOFT      HARD
 0 bluetooth hci0   unblocked unblocked
 1 bluetooth hci1   unblocked unblocked
 2 wlan      phy0     blocked unblocked

如果您的任何蓝牙设备被阻止,只需运行:

rfkill unblock bluetooth

请注意,在我的示例中,有两个设备:hc10 和 hci1。我运行

gdbus introspect -y -d "org.bluez" -o "/org/bluez/hci0"
来查看实际实现了哪些接口。分析 hci0 的输出是:

    node /org/bluez/hci0 {
};

hci1 的输出更长、更详细。这让我相信我在代码中使用了错误的设备。当我从 hci0 切换到 hci1 时,问题似乎已经解决了。

我发现非常有用的资源是:https://punchthrough.com/creating-a-ble-peripheral-with-bluez/

我对 Bluez 和一般编码都很陌生,但我希望这对某人有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.