通过蓝牙与bluez连接两个树莓派 [英] Connecting two raspberry pi through bluetooth with bluez
问题描述
我正在尝试使用以下API: https://www.linumiz .com/bluetooth-connectdevice-without-scanning/在两个Raspberry PI之间建立连接.我正在像服务器这样的服务器上使用该程序:
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect
适配器已打开电源
然后在客户端:
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect B8:27:EB:9F:91:A7
适配器已打开"电源无法获得结果: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod:方法 接口上带有签名"a {sv}"的"ConnectDevice" "org.bluez.Adapter1"不存在
但是我不明白这个错误.我这样做正确吗?如果没有,我该怎么办?
如本文所述,ConnectDevice是BlueZ 5.49中引入的新适配器API.有关更多详细信息,请此处.
此API仍被标记为实验性的,因此您需要在实验性模式下运行bluetoothd守护程序,即,在启动bluetoothd时通过传递"-E"作为额外的参数.
所以你需要
- BlueZ 5.49或更高版本
- 使用"-E"选项运行蓝牙守护程序
I'm trying to use this API: https://www.linumiz.com/bluetooth-connectdevice-without-scanning/ to make a connection between two Raspberry PI. I'm using this program like a server such as:
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect
Adapter is Powered "on"
and then, in the client side:
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect B8:27:EB:9F:91:A7
Adapter is Powered "on" Unable to get result: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist
But I don't understand this error. I'm doing this correctly? If not, what I have to do?
As mentioned in the article, ConnectDevice is the new adapter API introduced in BlueZ 5.49. Refer release notes here for more details.
This API is still marked as experimental, so you need to run bluetoothd daemon in experimental mode, i.e by passing "-E" as extra argument when starting bluetoothd.
So you need,
- BlueZ 5.49 or later
- Run bluetoothd daemon with "-E" option
这篇关于通过蓝牙与bluez连接两个树莓派的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!