首页 > 解决方案 > 从 Raspberry Pi 到 Parani SD100 的蓝牙连接 - 无可用服务

问题描述

我正在尝试将我的树莓派连接到 Parani SD1000 RS232 串行适配器。我已经配置了 Parani,我可以在使用我的 Macbook 时成功连接到它并检索数据。我想使用我的树莓派建立连接。我有一个树莓派 3 型号 b+ 32 位。我编写了一个使用 Pyserial 的脚本,并通过sudo rfcomm bind /dev/rfcomm0 XX:XX:XX:XX:XX:XX 1. 但是,当我使用 Raspberry PI OS 接口连接到蓝牙时,我收到一条消息,表明'Paired successfully, but this device has no services with can be used with the Raspberry Pi连接已中止。

我已经寻找其他建议并尝试更新我在其他地方列出的软件。无济于事。

sudo apt-get update
sudo apt-get dist-upgrade
sudo rm /etc/udev/rules.d/99-com.rules
sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall raspberrypi-sys-mods
sudo systemctl reboot

我不确定我应该看哪个方向。我知道 Parani 配置正确,所以它一定是树莓派上的东西。先感谢您

标签: python-3.xbluetoothraspberry-pi

解决方案


rfcomm早在 2017 年就被BlueZ 项目弃用了,所以我建议不要使用这种方法。

Linux 上的 Python3 支持通过其套接字库连接到具有串行端口配置文件 (SPP) 的蓝牙经典设备。

以下博客中有更多信息:https ://blog.kevindoran.co/bluetooth-programming-with-python-3/

Bluedot Python 库中还支持 SPP:https ://www.stuffaboutcode.com/2017/07/python-bluetooth-rfcomm-client-server.html


推荐阅读