lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

bluetooth has no discover_devices

Thu Nov 27, 2014 7:10 pm

i install bluez, python-bluez

Code: Select all

 bluetooth.discover_devices()
python complains no attributes of discover_devices for the module

User avatar
Douglas6
Posts: 4861
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: bluetooth has no discover_devices

Thu Nov 27, 2014 9:46 pm

I'm pretty sure I have working code that uses discover_devices(); I'll have to check later. But it sounds like a referencing problem to me.

User avatar
Douglas6
Posts: 4861
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: bluetooth has no discover_devices

Sun Nov 30, 2014 9:41 pm

Sorry. Holidays. This is tested:

Code: Select all

# Dependencies:
# sudo apt-get install python-bluetooth
import bluetooth

print("Searching for Bluetooth devices....")
devices = bluetooth.discover_devices()
for addr in devices:
    print("Found device: {}".format(addr))

Return to “General discussion”