I'm trying to connect a Wii remote to the Pi and use it in a python script. I've tried XWiiMote, but I can't get it to compile. All of the other libraries for Wiimotes I've found don't even work anymore (Wiican, CWiid). Has anyone had any luck with this? XWiiMote has python bindings, it's perfect.
Start by installing cwiid:
sudo apt-get install python-cwiid
Next set your bluetooth adapter to discoverable mode:
sudo hciconfig hci0 piscan
next open a python console by entering python at the command line.
import the cwiid module:
press 1 and 2 on you wiimote to make it discoverable
then create a reference to the wiimote and save it for later access:
wm = cwiid.Wiimote()
Further details and info on making the connection more reliable are available here.