I'm trying to write a python backend for the Wii Remote using lightblue on OS X. Sometimes I get a very strange error that I can't figure out:
Traceback (most recent call last):
File "wiipy_backend.py", line 634, in <module>
w.connect()
File "wiipy_backend.py", line 254, in connect
self.setled(self.number)
File "wiipy_backend.py", line 432, in setled
self._led_command()
File "wiipy_backend.py", line 571, in _led_command
self._send_command(CMD_SET_REPORT,RID_LEDS,[self.ledmask])
File "wiipy_backend.py", line 612, in _send_command
self.cx.send(chr(cmd) + chr(report) + "".join([chr(d) for d in data]))
File "/Library/Python/2.5/site-packages/lightblue/_bluetoothsockets.py", line 530, in send
raise _socket.error(result, "Error sending data")
Sometimes, everything works as exptected, but I couldn't even find out when this is the case.
Could someone point me into the right direction?
I found the error: It was not in the code, but a bug in OS X. I installed OSCulator from osculator.net, that includes a patch for OSX to fix the problem!
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey,
I'm trying to write a python backend for the Wii Remote using lightblue on OS X. Sometimes I get a very strange error that I can't figure out:
Traceback (most recent call last):
File "wiipy_backend.py", line 634, in <module>
w.connect()
File "wiipy_backend.py", line 254, in connect
self.setled(self.number)
File "wiipy_backend.py", line 432, in setled
self._led_command()
File "wiipy_backend.py", line 571, in _led_command
self._send_command(CMD_SET_REPORT,RID_LEDS,[self.ledmask])
File "wiipy_backend.py", line 612, in _send_command
self.cx.send(chr(cmd) + chr(report) + "".join([chr(d) for d in data]))
File "/Library/Python/2.5/site-packages/lightblue/_bluetoothsockets.py", line 530, in send
raise _socket.error(result, "Error sending data")
Sometimes, everything works as exptected, but I couldn't even find out when this is the case.
Could someone point me into the right direction?
The complete Python-code can be found here:
http://klasseonline.dyndns.org/hg/?raw-file/ee1f06740ab8/wiipy/wiipy_backend.py
Use it with:
./wiipy_backend.py -a bt-address-of-wiimote
Thanks
I found the error: It was not in the code, but a bug in OS X. I installed OSCulator from osculator.net, that includes a patch for OSX to fix the problem!
Thanks