bluetooth - 使用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:接口“org.bluez.Adapter1”上带有签名“a{sv}”的方法“ConnectDevice”不存在
但我不明白这个错误。我这样做正确吗?如果没有,我该怎么办?
解决方案
正如文章中提到的,ConnectDevice 是 BlueZ 5.49 中引入的新适配器 API。有关更多详细信息,请参阅此处的发行说明。
这个 API 仍然被标记为实验性的,所以你需要在实验模式下运行 bluetoothd 守护进程,即在启动 bluetoothd 时传递“-E”作为额外参数。
所以你需要,
- BlueZ 5.49 或更高版本
- 使用“-E”选项运行蓝牙守护程序
推荐阅读
- servicenow - 立即在服务中自动生成新表
- javascript - 从 Service Worker 获取 JavaScript Resource Timing API 中特定 fetch/xhr 调用的资源性能数据
- javascript - 是否可以使用 javascript 从客户端设备获取服务器 ip?
- rdf - 嵌套级别重复键的 JSONLD 上下文
- vert.x - 带有 micronaut 和 vertx 的 Singleton bean 的问题
- compiler-construction - 关于构建编译器扫描器的问题
- android - 如何在android studio中使用mobile-ffmpeg更改视频中的字体文件和文本位置而不改变视频质量?
- php - 登录/注册在本地工作,但在部署项目后不工作 - laravel 8
- reactjs - 如何在 React 中渲染我的函数?我无法渲染这个
- python - python装饰器和kwargs的正确处理