gpt4 book ai didi

蓝牙.btcommon.蓝牙错误: (2, 'No such file or directory')

转载 作者:行者123 更新时间:2023-12-02 14:41:42 25 4
gpt4 key购买 nike

我只是尝试运行 https://code.google.com/p/pybluez/source/browse/trunk/examples/simple/rfcomm-server.py 处的 RFCOMM 服务器示例

$ python2 rfcomm-server.py
Traceback (most recent call last):
File "rfcomm-server.py", line 20, in <module>
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')

我收到此错误。我的代码可以在 Windows 上运行,但无法在 Ubuntu 15.10 上运行。

最佳答案

我在 Raspbian 上遇到了同样的问题,并通过以下方式解决:

  • 在兼容模式下运行蓝牙,

    通过修改/etc/systemd/system/dbus-org.bluez.service

    改变

    ExecStart=/usr/lib/bluetooth/bluetoothd

    进入

    ExecStart=/usr/lib/bluetooth/bluetoothd -C

  • 然后添加串口配置文件,执行:sudo sdptool 添加 SP

引用文献:

关于蓝牙.btcommon.蓝牙错误: (2, 'No such file or directory'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36675931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com