0

I am trying to connect my Lenovo S10E to a Nintendo Wiimote via bluetooth. I am using a simple Python script, reproduced below. I am calling it from the Linux Mint (version 16, "Petra") command line using python3 find_wii.py

My goal is to connect a wiimote to Mint, then output MIDI (eventually). I am using Python due to its cross-platform advantages.

Script:

import bluetooth

target_name = "Nintendo RVL-CNT-01"
target_address = "00:1C:BE:29:75:7F"

nearby_devices = bluetooth.discover_devices()

for bdaddr in nearby_devices:
    if target_name == bluetooth.lookup_name( bdaddr ):
        target_address = bdaddr
        break

if target_address is not None:
    print("found target bluetooth device with address "), target_address
else:
    print("could not find target bluetooth device nearby")

I am receiving the error

Traceback (most recent call last):
  File "find_wii.py", line 1, in <module>
    import bluetooth
ImportError: No module named 'bluetooth'

I have installed bluez and python wrappings for it (sudo aptitude install python-bluez). I have upgraded my system (sudo apt-get update, sudo apt-get upgrade). I did consulted Google, and the only official bugs I could find are here and here, and neither of the answers worked for me.

How can I get the Bluetooth module to work with Mint?

[Note: Question cross-posted to stackoverflow]

1

I believe the bluetooth module is for python2 and not yet for python3. You can verify this by trying to load the module with python2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.