pythonpython-3.xbluetoothpybluez

OSError on PyBluez 0.22


Running PyBluez on Windows 10 and Python 3.6, I get OSError everytime I call the bluetooth.discover_devices() function.

As of now, the codes only consists in 3 lines:

import bluetooth

print "Searching for devices... \n"
nearby_devices = bluetooth.discover_devices()

Console then gives:

Searching for devices...
Traceback (most recent call last):
  File "D:\Documentos\UFSC\9ª Fase\Projeto Integrador\testeBT.py", line 9, in <module>
    nearby_devices = bluetooth.discover_devices()
  File "C:\Users\Thaler\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bluetooth\msbt.py", line 15, in discover_devices
    devices = bt.discover_devices(duration=duration, flush_cache=flush_cache)
OSError

Any solution? I've never used PyBluez before, and this was supposed to be a simple test program...


Solution

  • This is because PyBluez only works with GNU/Linux and Windows XP with guarantee. And you are trying to use PyBluez on Win10.

    You may try to plug your bluetooth device on a USB 3.0 port as mentioned in this issue.