我在我的Nano上有过这样的问题:
profiles = [ SERIAL_PORT_PROFILE ],
File "/usr/lib/python2.7/site-packages/bluetooth/bluez.py", line 176, in advertise_service
raise BluetoothError (str (e))
bluetooth.btcommon.BluetoothError: (2, 'No such file or directory')我尝试在bluetooth.service文件中添加兼容性模式,重新加载守护进程,重新启动蓝牙,然后通过
sudo sdptool add SP这些步骤在我的ubuntu20.04笔记本电脑上运行得很好,但在jetpack 4.5.1上却不起作用,而且我也检查过,它们也不能在jetson上工作。
我真的很好奇如何解决这个问题,否则,另一种在python代码中使用蓝牙的方法是受欢迎的。
谢谢
发布于 2022-02-04 22:59:41
该解决方案位于蓝牙配置文件的路径中(受此https://developer.nvidia.com/embedded/learn/tutorials/connecting-bluetooth-audio启发)
这个答案:bluetooth.btcommon.BluetoothError:(2,“没有这样的文件或目录”)
对于jetson设备(jetpack)来说是不够的。虽然我没有测试它是否工作,但没有更改这个链接中提到的文件。
还有一个需要更改的.conf文件:/lib/systemd/system/bluetooth.service.d/nv-bluetooth-service.conf
修改:
ExecStart=/usr/lib/bluetooth/bluetoothd -d --noplugin=audio,a2dp,avrcp致:
ExecStart=/usr/lib/bluetooth/bluetoothd -C在此之后,有必要:
sudo systemctl daemon-reload
sudo systemctl restart bluetoothjetson Nano和NX上的jetpach 4.5.1测试
谢谢你的帮助!
发布于 2022-02-03 07:13:45
您可能想看看下面的文章,这篇文章展示了如何使用核心Python库https://blog.kevindoran.co/bluetooth-programming-with-python-3/进行连接。
BlueZ现在这样做的方式是使用配置文件 API。
在https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/test-profile上有一个使用Profile的Python示例
hciattach、hciconfig、hcitool、hcidump、rfcomm、sdptool、ciptool和gatttool是2017年的被BlueZ所反对项目。如果您正在学习使用它们的教程,那么它可能已经过时,Linux系统可能会选择不支持它们。
https://stackoverflow.com/questions/70964456
复制相似问题