PyBluez 未检测到内置蓝牙适配器
我想开始开发一些工具,让我可以通过蓝牙在手机和计算机之间进行通信,并且我想使用 Python。我安装了 python 蓝牙模块 (PyBluez),但它没有检测到我的内置 BT 适配器(我使用的是东芝 Satellite A300)。
import bluetooth
nearby_devices = bluetooth.discover_devices()
print(nearby_devices)
返回以下错误:
Traceback (most recent call last):
File "C:/Python26/bt.py", line 3, in <module>
nearby_devices = bluetooth.discover_devices()
File "C:\Python26\lib\site-packages\bluetooth\msbt.py", line 9, in discover_devices
return bt.discover_devices (flush_cache, lookup_names)
IOError: No Bluetooth adapter detected
有帮助吗?
I want to start developing some tools that let me communicate between my phone and computer via bluetooth, and I want to use Python for it. I installed the python bluetooth module (PyBluez), but it does not detect my built in BT adapter (I'm on a Toshiba Satellite A300).
import bluetooth
nearby_devices = bluetooth.discover_devices()
print(nearby_devices)
returns the following error:
Traceback (most recent call last):
File "C:/Python26/bt.py", line 3, in <module>
nearby_devices = bluetooth.discover_devices()
File "C:\Python26\lib\site-packages\bluetooth\msbt.py", line 9, in discover_devices
return bt.discover_devices (flush_cache, lookup_names)
IOError: No Bluetooth adapter detected
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PyBluez 对于 Windows 使用 MS 蓝牙驱动程序堆栈和 Widcom,对于 Linux,它使用 BlueZ。如果您的笔记本电脑具有不同的堆栈,则无法工作是正常的。
PyBluez uses MS Bluetooth driver stack and Widcom for Windows, for Linux it uses BlueZ. If your laptop has a different stack it is normal not to work.
您可以卸载驱动程序(如果可能),然后重新启动 Windows 并让它安装默认驱动程序。
如果你管理得当,PyBluez 会工作得更好。
You could uninstall the driver (if it is possible), then restart Windows and let it install the default drivers.
If you manage it, PyBluez will work better.