【问题标题】:raspberry pi3 BLE connecting issues树莓派 3 BLE 连接问题
【发布时间】:2017-04-03 15:57:55
【问题描述】:

我正在尝试将我的 Raspberry pi3 连接到我的智能手机,但它失败了。在我的 RP 上,我输入以下命令:

bluetoothctl
connect B8:08:D7:AC:CC:42

但我有以下错误:

Attempting to connect to B8:08:D7:AC:CC:42
Failed to connect: org.bluez.Error.Failed 

有人可以帮助我吗?

【问题讨论】:

  • 检查“journalctl -xe”日志并分享有关蓝牙的错误消息。这有助于进一步缩小实际原因。

标签: bluetooth-lowenergy raspberry-pi3 bluez


【解决方案1】:

尝试以下步骤。在分享步骤之前,请分享来自“journalctl -xe”的日志。如果您看到“a2dp-source profile connect failed for : Protocol not available”,则您的 R-Pi 不支持或实施 A2DP 配置文件。一种快速的选择是运行 pulseaudio bluez 模块。

systemctl start bluetooth
hciconfig hci0 up

打开智能手机中的蓝牙

bluetoothctl
[bluetooth]# discoverable on
[bluetooth]# pairable on
[bluetooth]# scan on
>>> Wait for your device to appear during scanning process.
[bluetooth]# scan off
[bluetooth]# trust <Device MAC>
[bluetooth]# pair <Device MAC>
[bluetooth]# connect <Device MAC>

如果你还看到, 正在尝试连接到 44:D8:84:02:A3:17 连接失败:org.bluez.Error.Failed

启动pulseaudio,

pulseaudio
pactl load-module module-bluetooth-discover

返回 bluetoothctl 并再次尝试连接。但是您仍然可以将手机连接到 R-Pi,而无需启用 A2DP 支持,只需从智能手机而不是 R-Pi 命令行连接即可。

【讨论】:

  • 当我尝试 pactl load-module module-bluetooth-discover 我有这个错误:连接失败:连接被拒绝 pa_context_connect() 失败:连接被拒绝
  • 确保 pulseaudio 正在运行。检查“ps -ef | grep pulseaudio”。如果 pulseaudio 运行良好,请尝试使用“sudo”加载模块
猜你喜欢
  • 2016-11-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-24
  • 2022-01-05
  • 2019-04-04
相关资源
最近更新 更多