I am trying to read the button states and accelerometer and IR camera values with Python 3.3 but none of the ways that I have tried work. The first way is through Bluetooth sockets with this code:
import socket
if __name__ == '__main__':
MAC = '00:1F:C5:35:91:5A'
blue = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
wm = blue.connect((MAC,1))
But this always generates errors. When the computer is already paired to the WiiMote I get No route to host
, when I'm not connected but visible I get Operation now in progress
and when I'm not visible I get Connection reset by peer
.
I'm able to read the button states with pygame.joystick
and cat /dev/input/js0
but this leaves me unable to send requests to the WiiMote which allow me to read the accelerometer and IR camera values.
The are also modules such as CWiiD and PyWiiUse but are only compatable with Python 2.x. I have also tried using the HID to send these requests but the modules install for Python 2.7 even though I don't have that version of Python installed.
Is there any way that this task can be accomplished? I'm running Ubuntu 13.10 on a 64 bit Intel i5 and the solution doesn't need to platform independent.