python-3.x - 从 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 配置正确,所以它一定是树莓派上的东西。先感谢您
解决方案
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
推荐阅读
- javascript - 两页上的 Javascript
- c# - 在 VSTS 构建代理中构建解决方案时出现错误 CS0246
- sql-server - 错误传输:必须指定源连接 SSIS
- azure - 如何将我的本地 Azure Function App 项目上传到 Azure Function Run time?
- c++ - 无法在 Visual Studio 2017 (Native c++) 中禁用数据断点
- node.js - child_process - windowsHide 无法使用分离:true
- ios - 如何在 Swift 4 中使用 Alamofire 上传具有其他参数的多个图像
- c# - Linq 方法不适用于实现 IEnumerable 的集合
- c# - 服务总线消息 反序列化 System.String 类型的对象时出错,但消息格式是正确的 json
- yii2 - 在 Yii2 hasMany 关系中使用 viaTable 应该如何包含列名?