ToadKing/wii-u-gc-adapter

Use on RetroPie?

Opened this issue · 13 comments

Hello,

I have a raspberry pi running RetroPie and a GameCube controller to Wii-U adapter. I have tried to use this adapter to use gamecube controllers I already have in an attempt to not have to buy new usb controllers. When I tried to run "make" it came up with an error concerning my "libusb". I then attempted to find an update but my raspberry pi said I already had the newest version. I then downloaded the newest version (1.0.19 is the newest I think) on my raspberry pi via SSH and compiled it. Then when I attempted to run the make file again it gave this error message:
cc -c -o wii-u-gc-adapter.o wii-u-gc-adapter.c -Wall -Wextra -pedantic -Wno-format -std=c99 -I/usr/local/include/libusb-1.0 -O2
wii-u-gc-adapter.c:44:4: error: ‘BTN_SOUTH’ undeclared here (not in a function)
wii-u-gc-adapter.c:45:4: error: ‘BTN_WEST’ undeclared here (not in a function)
wii-u-gc-adapter.c:46:4: error: ‘BTN_EAST’ undeclared here (not in a function)
wii-u-gc-adapter.c:47:4: error: ‘BTN_NORTH’ undeclared here (not in a function)
wii-u-gc-adapter.c:48:4: error: ‘BTN_DPAD_LEFT’ undeclared here (not in a function)
wii-u-gc-adapter.c:49:4: error: ‘BTN_DPAD_RIGHT’ undeclared here (not in a function)
wii-u-gc-adapter.c:50:4: error: ‘BTN_DPAD_DOWN’ undeclared here (not in a function)
wii-u-gc-adapter.c:51:4: error: ‘BTN_DPAD_UP’ undeclared here (not in a function)
Makefile:16: recipe for target 'wii-u-gc-adapter.o' failed
make: *** [wii-u-gc-adapter.o] Error 1

I think the new libusb needs to be placed where the previous version is or else re-route the program to find it where it is currently but I'm not certain. I was hoping you could help me get this figured out. I am a college student learning hardware and software and I can't seem to get it on my own.

I get this error too when I download and compile the latest libusb-1.0.19

Your libc headers are probably out of date. If you're not running the latest Debian version try upgrading.

I'm running RetroPie 3 beta 3 on a Pi 2 which is running Debian Wheezy, not Jessie.

Linux retropie 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux

It might be that Wheezy doesn't have the latest version of the Linux headers, which is why those symbols are missing. Can you try upgrading to Jessie and see if that works?

@ToadKing can you tell us what the minimal required Linux Kernel is? Perhaps we could get the RetroPie team to backport some of the features, since getting this working would be a significant boost to their project.

Hi,
I have upgrade my retroPie to Jessie and manage to install the driver. Now Wii-U adapter work perfectly find on my RetroPie. The only issue was auto login at boot was diseable after Jessie upgrade. Fix it, editing /etc/systemd/system/getty.target.wants/getty@tty1.service. I added a script to launch the driver at boot and i'm ready for play. Thank you ToadKing and thank you RetroPie team. I can upload a working image if someone is interested.

Hi @baddger ,
I have updated my retroPie to Jessie and compiled latest libusb, I've also done the auto login fix.
What script did you add to launch the driver at boot?

Hi @jjmakin ,
I added this script in the /etc/init.d folder :

#! /bin/sh
### BEGIN INIT INFO
# Provides:          blah
# Required-Start: 
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: launch wiiu controler driver
# Description:
### END INIT INFO

# /etc/init.d/blah
#

# Carry out specific functions when asked to by the system
case "$1" in
  start)
    /home/pi/wii-u-gc-adapter-master/wii-u-gc-adapter
    ;;
  stop)
    ;;
  *)
    echo "Usage: /etc/init.d/blah {start|stop}"
    exit 1
    ;;
esac

exit 0

Hi all, I have followed all of your instructions but have not had any success. I have a rp2 with retropie 3.0 installed from the image file. I have successfully switched to Jessie, fixed the autologin, fixed the eth0 issue which cropped up, was able to make Toadking's driver, and placed the above script in the init.d folder pointing towards where I stored the driver. Emulation station still does not even recognize any controller that I hook up to gc adapter. I have tried wavebirds as well as nes and snes controllers with gc connection adapters. This would be great if I could just get it to work.

When i go into /dev/input, I don't see any joystick values populate. When I plug the device in I see a new event0 and mouse0. I don't have any other devices plugged into the usb ports of the raspberry pi.

pi@retropie /dev/input $ ls
mice
pi@retropie /dev/input $ ls
by-id by-path event0 mice mouse0

Hello,
I have the same problem as bigredsign.
There do not show new "js's" in the /dev/input/

Anyone any ideas?
Greets

I have ran 'make' and all seemed to go great. No errors. After running make, is there anything I am supposed to do to allow retro pi to see the GC Adapter?

Im new to raspberry pi, but learning loads! :)

Just got this working on my Raspberry Pi 3. You are going to want to be on the latest RetroPie (3.6+) which uses Debian Jessie (as opposed to Wheezy).

Using the latest RetroPie image, I did a clean install on my SD card followed by the obligatory update:

sudo apt-get update
sudo apt-get -y upgrade

After that, you will need to pull the code from here via git. Here's what I do to clone, build, and install the adapter driver.

cd ~
git clone https://github.com/ToadKing/wii-u-gc-adapter
cd wii-u-gc-adapter
make
chmod +x wii-u-gc-adapter
sudo cp wii-u-gc-adapter /usr/local/bin
sudo chown root /usr/local/bin/wii-gc-adapter

The above commands will build the adapter driver, make it executable, and move it to a standard location (out of the home folder).

Debian Jessie has migrated to systemd, so I made a basic service file to allow the driver to run on boot (and as root):

sudo touch /etc/systemd/system/gamecube.service
sudo chown root:root /etc/systemd/system/gamecube.service
sudo nano /etc/systemd/system/gamecube.service

Paste this into the file and save it:

[Unit]
Description=Wii U Gamecube Adapter
Before=systemd-user-sessions.service

[Service]
TimeoutStartSec=0

ExecStart=/usr/local/bin/wii-u-gc-adapter
User=root

[Install]
WantedBy=multi-user.target

Then to enable and start the service:

sudo systemctl enable /etc/systemd/system/gamecube.service
sudo systemctl start gamecube.service

Reboot and check that the service is running:

sudo systemctl status gamecube.service

You should get something like this:

● gamecube.service - Wii U Gamecube Adapter
   Loaded: loaded (/etc/systemd/system/gamecube.service; enabled)
   Active: active (running) since Wed 2016-03-16 23:08:34 EDT; 11min ago
 Main PID: 363 (wii-u-gc-adapte)
   CGroup: /system.slice/gamecube.service
           └─363 /usr/local/bin/wii-u-gc-adapter

The remaining issue is when RetroPie shows console dialogs (similar to what raspi-config looks like), I'm unable to use the controller to navigate them properly. It acts erratic at times, sometimes moving down, other times moving down many options and back up to the first.