So this is going to be a many part series for a robot project i’m working on. This first one covers writing a program that runs on the Raspberry Pi. This program is going to connect through bluetooth to a Nintendo Wii controller and allow you to control the data via Python. Cool I know!

So what I did first was familiarize myself with connecting my Wii controller to my PC (virtual desktop running Ubuntu) and using Cwiid as a module I was able to write a small program to grab the data. Once I knew I could connect and communicate all I needed to do was port this over to my Raspberry Pi.





Parts list:

Raspberry Pi

bluetooth USB dongle – I bought this one SABRENT at Frys Electronics for $10

Wii Remote – Black

Standard Raspberry Pi cables (power, keyboard, monitor)

Make sure you first have debian installed and up to date on your Raspberry Pi. I did a ‘how to’ earlier that can be found HERE, the only difference is I installed the BETA ‘Wheezy’ version. Once you have your board up and working make sure you update everything.

sudo apt-get update

sudo apt-get upgrade

This could take hours depending…

Installing the Bluetooth Dongle and drivers



The first thing is to plug your Bluetooth dongle into one of the USB ports of the Pi.

Once you have your Raspberry Pi booted up install the bluetooth package for it. Mine tool about an hour to download. To reduce this time install it without the GUI started.

sudo apt-get install bluetooth

Once it is installed, make sure you can see the bluetooth device and scan for your Wii Remote.

sudo service bluetooth status

If it isn’t connected type this to start up your bluetooth, or reboot your Pi:

/etc/init.d/bluetooth start

To get your bluetooth address type,

hcitool dev This will show your dongle address. Something like this: Next you can scan for devices. Type the following in, then press the 1+2 on your Wii remote to make it searchable. By pressing the one and two this will put the controller into discovery mode. hcitool scan You should see something like this, representing your Wiimote address and name. Installing CWiiD for Python Next we need to download CWiiD, this is a great python module that allows us to control a Wii remote in Python, it has been ported to the ARM, x86, and AMD. To download and install type: