Bluetooth 树莓皮;混合微量:罐装';t连接蓝牙

Bluetooth 树莓皮;混合微量:罐装';t连接蓝牙,bluetooth,arduino,raspberry-pi,Bluetooth,Arduino,Raspberry Pi,最近有一个混合微型项目,我需要一个树莓pi启动蓝牙连接与它 为此,我在raspberry上安装了BlueZ 5.2,并使用此命令检测混合微: sudo hcitool -i hci0 lescan 我正确检测到混合微粒,然后使用gatttool命令: sudo gatttool -i hcitool hci0 -b XX:XX:XX:XX:XX:XX -I (where the XX corresponds to the Blend MAC address) 但当我通过键入connect

最近有一个混合微型项目,我需要一个树莓pi启动蓝牙连接与它

为此,我在raspberry上安装了BlueZ 5.2,并使用此命令检测混合微:

sudo hcitool -i hci0 lescan
我正确检测到混合微粒,然后使用gatttool命令:

sudo gatttool -i hcitool hci0 -b XX:XX:XX:XX:XX:XX -I  
(where the XX corresponds to the Blend MAC address)
但当我通过键入connect启动连接时,它会显示“主机已关闭”:

你知道怎么解决吗?虽然尝试了很多事情却没有任何结果


尊敬的RaZZeR

当您连接时,您需要将“-t random”添加到命令行中。

谢谢您,这为我解决了bluez 5.33的问题。此外,我的BT适配器不是从操作系统启动的,在运行hcitool或gattool之前,我必须手动执行“hciconfig device up”
$ sudo gatttool -i hci0 -b XX:XX:XX:XX:XX:XX -I
[   ][XX:XX:XX:XX:XX:XX][LE]> connect
Connecting... connect error: Host is down (112) 
[   ][XX:XX:XX:XX:XX:XX][LE]>