bluetoothctl 不显示蓝牙低功耗 (BLE) 设备

时间:2021-01-03 12:55:59

标签: raspberry-pi bluetooth-lowenergy bluez pairing

我想将我的低功耗蓝牙运动手表 (Suunto Ambit 3) 与我的 Raspberry PI 3 B V1.2 配对 我正在使用带有内核版本 5.4.79-v7+ 的 RaspianOS 版本 10 buster 此操作系统包含 5.50 版中的 bluez 堆栈,该堆栈是通过 apt-get 从预定义包安装的。

通常 ble 配对是在 android 和 IOS 下与智能手机完成的。在进行配对过程时,手表会提供一个密码,必须由智能手机输入。 使用 Android 下的 nRFConnect 应用程序,配对工作正常。 当我在覆盆子上运行 hcitool 并且手表处于配对模式时,它会出现。

sudo hcitool -i hci0 lescan

但是当我尝试使用 sudo bluetoothctl 运行 scan on 命令时,我的设备没有出现并且与正确的 mac 地址配对也不起作用。 其他设备仍然出现在 bluetoothctl 我还研究了 https://github.com/raspberrypi/linux/issues/3689,但这似乎只与较新的树莓派模型有关。

不知道是什么阻碍了我的设备在 bluetoothctl 扫描模式下被找到,或者我可以做些什么来配对我的设备并启用 PIN 码?

1 个答案:

答案 0 :(得分:1)

我自己找到了解决方案。

bluetoothctl 内调用以下序列

menu scan
transport le
back
scan on

终于让 bluetoothctl 找到了我的手表。 然后连接命令也起作用了。