python调试蓝牙适配器_我不得不重置适配器后,蓝牙的Python代码抛出错误

我在python中尝试蓝牙编程.它一直工作到昨天.今天早上有停电,由于某种原因,蓝牙模块被禁用,无法打开.所以,我做了一个sudo hciconfig hci0 reset,然后打开它.从那时起,最简单的程序无法执行.就拿这一次的例子.它卡在advertise_service中bluetooth模块中并抛出以下错误(仅供参考:virtualenv在这里不是问题.系统范围的python也做同样的事情).

Traceback (most recent call last):

File "bt.py", line 17, in

advertise_service( server_sock, "SampleServer", service_id = uuid, service_classes = [ uuid, SERIAL_PORT_CLASS ], profiles = [ SERIAL_PORT_PROFILE ])

File "/home/machinename/.virtualenvs/py27/local/lib/python2.7/site-packages/bluetooth/bluez.py", line 242, in advertise_service

raise BluetoothError (str (e))

bluetooth.btcommon.BluetoothError: (2, 'No such file or directory')

有时在编译和重新安装Bluez驱动程序时出现了不同的错误:

Traceback (most recent call last):

File "build/bdist.linux-x86_64/egg/bluetooth/bluez.py", line 268, in advertise_service

bluetooth.btcommon.BluetoothError: error no advertisable device.

但所有这些在这台机器之前就像一个魅力; 事实上,当我写这篇文章的时候,所有的程序都可以和我的其他ubuntu(14.04LTS)机器一起工作.我检查了源代码,并追溯到一个_bluetooth.so文件 - 这是一个编译的代码,因此我无法弄清楚该做什么.

任何指针都将受到高度赞赏.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值