using wiimote based guitars with Rock Band on the Playstation

A number of Guitar Hero games were released for the Nintendo Wii that provided a wireless link by plugging into a Wiimote's expansion port. These controllers appear to the console as something like a Nintendo Classic Controller. The Wiimote uses bluetooth, and the protocol is well understood. If you have access to a Raspberry Pi Zero with onboard bluetooth (you can't use a USB Bluetooth dongle as we'll be reconfiguring the USB system to operate in slave mode), you can use it as a guitar dongle for Playstation 3 and 4. A normal Raspberry Pi won't work for this purpose as it needs to be able to act as a USB slave device (aka "gadget mode").

Note - I plan to redo this project in the future to base it on a microcontroller. This should make it simpler to setup and more reliable.

setting it up

The above video is the product of following these steps:

Performed a clean install of Raspbian on my Pi Zero W. After reinstalling, I set the password, wifi settings, set it to boot to the CLI (as it won't have a screen plugged in) and enabled ssh. I also updated the packages and firmware. Rebooted and disconnected my keyboard, mouse, and display. I installed python-cwiid and wminput ( apt-get install python-cwiid wminput ). WMInput is an input manager that will allow us to access the wiimote as a Linux joystick. I added libcomposite and dwc2 to /etc/modules, and dwc2 to /boot/config.txt . dwc2 lets the Pi operate as a USB slave device. Rebooted the system. Unzipped the files in this zip file into /home/pi/wiig/ . If you change the path, you'll need to update some of the directory names in wiig-startup.sh too. Built the guitar proxy software included in the zip file: gcc guitar-proxy.c -o gp . Made sure that both shell scripts ( setup-gadget.sh and wiig-startup.sh ) and the gp executable have their execute bits set. Note: If you look at the contents of wiig-startup.sh you'll see that it will wait forever for the Pi's bluetooth adapter to come online. If the bluetooth adapter will never come online (e.g. you're running this on an ordinary Zero instead of a Zero W), and ssh hasn't started before rc.local runs, your Pi will be stuck and you'll have have to mount the SD card on another computer to fix it. So, you may want to test running it (as root) to see if it works before taking the next step. Added /home/pi/wiig/wiig-startup.sh to /etc/rc.local . Rebooted and held my breath. Once you have it working properly with no user intervention required, you should reconfigure the Pi to boot in read only filesystem mode so that cutting the power doesn't risk corrupting the SD card. I used the script from this Adafruit tutorial. I enabled the read/write jumper option, although it is easy enough to remount the file system r/w once you have logged in via ssh (after the Adafruit script has run, have a look in the updated /etc/rc.local for a hint as to how this is done.)

A word of warning - if you use your Pi for anything else at the same time (file server?), wminput really slows down performance when it's looking for a wiimote in wait/reconnect mode, as we do here. It's fine once it finds one to connect to.

usage instructions

Plug the Pi into external power on its power jack, and the Playstation of your choice using its other USB cable. Once the Pi has booted up, it should appear in Rock Band as a guitar controller waiting for you to hit start / option. Now press the 1 + 2 buttons on your wiimote to put it in sync mode (if it won't connect to the Pi, you may need to check your batteries, or to use the red sync button inside the battery compartment.) You can tell it's connected if the wiimote lights up its "Player 1" indicator. On a Playstation 3, you can now use it to navigate the Playstation dashboard menus before you've gotten into Rock Band, but on PS4 it will only work once you've started the game. Button mapping is what you likely expect - the guitar should have "+" and "-" buttons that serve as "start" / "select" respectively. You can use the joystick on the guitar, or the dpad on the wiimote to navigate.

things I couldn't seem to get working

I couldn't work out how to get the wiimote's tilt sensors to come through in wminput as an axis - I'm afraid if you want to activate overdrive you'll have to do it with the button. I couldn't work out how to read the touch-strip on the particular guitar I built this with, a Wii Guitar Hero: Metallica unit. Let me know if you work it out. The Playstation button doesn't work on faked controllers without a bunch of extra work I couldn't put in. Keep a real controller around if you want to, say, ever quit the game.

does this work with multiple guitars?