Connecting two raspberry pi through bluetooth with bluez

痴心易碎 提交于 2019-12-13 03:55:49

问题


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?


回答1:


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,

  1. BlueZ 5.49 or later
  2. Run bluetoothd daemon with "-E" option


来源:https://stackoverflow.com/questions/51494246/connecting-two-raspberry-pi-through-bluetooth-with-bluez

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!