Discovering bluetooth devices IOError: The RPC server is unavailable

不想你离开。 提交于 2019-12-12 14:00:07

问题


I just tried to implement bluetooth from Python in PyCharm, using PyBluez. I am stuck with this particular error. I tried to search this error but could not find it. Can anybody help ?

This is my code

>>> from bluetooth import discover_devices
>>> nearby_devices = discover_devices()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\bluetooth\msbt.py", line 15, in discover_devices
    devices = bt.discover_devices(duration=duration, flush_cache=flush_cache)
IOError: The RPC server is unavailable.

回答1:


I had the same error and managed to fix it.

The Bluetooth Radio device was disabled on my laptop.

I opened Device Manager, selected the device, and enabled it.

Now my output is:

>>> from bluetooth import discover_devices
>>> discover_devices()
['2C:4A:05:96:27:01']


来源:https://stackoverflow.com/questions/32389334/discovering-bluetooth-devices-ioerror-the-rpc-server-is-unavailable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!