Wiimote Access Violation While Panda is Active

I’ve spend the last several days fighting the most bizarre conflict, trying to access wiimotes from Panda script code.

I’ve been using the PyWiiuse wrapper for Wiiuse v0.9, which works great. (Uses ctypes to access functions of the C++ library.) I can easily connect wiimotes and write a python script that interfaces with them however I want. However, if I import DirectStart, making zero changes to the actual script otherwise, polling the wiimote crashes with the following error line:

WindowsError: exception: access violation reading 0x00000004

I have no idea what the core of Panda could be doing that interferes with reading events from the bluetooth stack. I can run two entirely separate python processes (one Panda and one polling wiimote data) and there is no crash, but that obviously isn’t much help given that we want our program in Panda to be using the Wiimote data.

The original idea of course was to just poll the wiimotes as a Task in Panda. However, as stated, the poll function crashes even if python was just imported.

Any idea what could possibly be causing this conflict?

Maybe panda3d is recognizing this as in import device but fails to read this properly?