Prerequisits
You will need your WiiU, a WiFi stick that operates in the 5GHz band and is able to operate in AP mode. In this tutorial I will assume that you have a WiFi Stick with the rt2800usb chipset.
To be more specific I used a TP-Link TL-WDN3200. It just costs a couple of bucks and works like a charm with linux kernel >= 3.11 This is the one pictured on the right.
I will not go into details about what is happening here. Please read the official documentations. This is more or less just a log of “how I got it running”. All Kudos go out to the guys that made libdrc possible. I attended their talk at 30c3 and just needed to do this.
Preparations
Create a directory called drc in your home where all needed software will be downloaded and compiled and change into this directory.
mkdir ~/drc cd ~/drc
Install all the needed packages from your repository (this list may not be complete)
sudo apt-get install libnl-dev firmware-ralink software-properties-common yasm libglew-dev
!!! Disable everything that may manage your WiFi devices, like network-manager !!!.
sudo service network-manager stop
If something is not working as expected, this will most likely, be the reason. Also check the trouble shooting section on the bottom if you run into any problems.
Compile and load modified mac80211 stack
I decided I just want to use the modified mac80211 stack when playing around with the pad, so first of all, download the patched module and compile it against your kernel:
git clone https://bitbucket.org/memahaxx/drc-mac80211.git cd drc-mac80211 make -C /usr/src/linux-headers-VERSION M=/home/USERNAME/drc/drc-mac80211/
Where VERSION is your current kernel version. This should compile without any hassle. You now need to unload the current mac80211 module.
sudo rmmod mac80211
Most likely you will first need to unload a couple of other WiFi modules that depend on it. For me, since I was doing this on a notebook, it were the modules for my other WiFi card and the modules for the rt2800usb. Since this can be quite a pain in the ass i wrote a small script to unload the modules in the correct order.
After the mac80211 module was unloaded successfully we can load the patched version and the needed modules for the rt2800usb:
sudo insmod mac80211.ko sudo modprobe rt2800usb
We now check if the stick is up and the patched module is used:
sudo iwconfig test -f "/sys/class/net/$WLAN/tsf" && echo 'Patched mac80211 and rt2800usb loaded.'
Where $WLAN is the name of your WiFi interface, that you should have seen via iwconfig. If “Patched mac80211 and rt2800usb loaded.” is displayed you are good to go.
Obtaining the key
We are now ready to try to pair with the WiiU. Therefore we download and compile the patched wpa supplicant:
cd .. git clone https://bitbucket.org/memahaxx/drc-hostap.git cd drc-hostap/wpa_supplicant/ cp defconfig .config
Open the copied config file in the editor of your choice and set the following options:
CONFIG_WPS=y CONFIG_TENDONIN=y
and then build it:
make
Open get_psk.conf and add
ctrl_interface=/var/run/wpa_supplicant_drc update_config=1
Make sure the WiFi is up and running and then start wpa supplicant.
sudo ifconfig $WLAN up sudo iwlist $WLAN scan sudo ./wpa_supplicant -Dnl80211 -i $WLAN -c get_psk.conf
In another console run the wpa cli:
sudo ./wpa_cli -p /var/run/wpa_supplicant_drc
Now we need to get into sync mode. Press sync once on the WiiU, watch the pad. A message should appear that you should press sync again to pair a pad. Press sync again. On your TV you should now see 4 symbols, note them down. the pad should state stat it is already synced.
In the wpa cli type:
scan
When you see
CTRL-EVENT-SCAN-RESULTS
you can check the results:
scan_results
Depending on the WiFi situation around you, you will see quite some access points. Look for one with an ESSID like this: WiiUAABBCCDDEEFF_STA1 Note down the BSSID.
Now calculate the pin, from the four symbols you noted down before, each symbol is associated with a number:
♠ = 0
♥ = 1
♦ = 2
♣ = 3
So ♥♣♠♠ represents 1300. The pin also has a static part, namely 5678 which is appended to the symbols, so for the previous example the pin would be 13005678. With the BSSID and the pin we can now try to obtain the WPS credentials. In the wps cli type:
wps_pin BSSID PIN
This indicates that we received the credentials:
WPS-CRED-RECEIVED WPS-SUCCESS
Exit the wpa cli and wpa supplicant. Check get_psk.conf, you will need the essid and psk for the next step.
Run the Hotspot
It is time now to let the pad connect to our hotspot. Make sure that all programs using WiFi are closed and compile hostapd:
cd .. cd hostapd cp defconfig .config make -j5
now open
../conf/wiiu_ap_normal.conf
in the editor of your choice and edit interface, ssid and wpa_psk to the values you got in the last step. Then run hostapd with this configuration. It should sit there open and wait for incoming connections:
sudo ./hostapd -dd ../conf/wiiu_ap_normal.conf
In another console type the following to set the appropriate subnet for the pad:
sudo ip a a 192.168.1.10/24 dev $WLAN sudo ip l set mtu 1800 dev $WLAN
Now switch on your pad and you should see it connecting:
wlan1: STA de:ad:be:ef:01:01 WPA: pairwise key handshake completed (RSN)
Node the gamepads BSSID, since you will need it for the next step.
We need to set up a dhcp server to serve the pad a valid IP. Therefore we will use netboot since it is small and easy to use:
cd ~/drc git clone https://github.com/ITikhonov/netboot.git cd netboot gcc -o netboot netboot.c sudo ./netboot 192.168.1.255 192.168.1.10 192.168.1.11 BSSID_OF_PAD
Installing ffmpeg and patched H.264 codec
If you are running Ubuntu you can add the following repository the get a recent version of ffmpeg. It will also work with debian if you adapt the sources manually to use the ubuntu sources.
sudo add-apt-repository ppa:samrog131/ppa sudo apt-get update sudo apt-get install libswscale-ffmpeg-dev libavutil-ffmpeg-dev
Since the WiiU uses a not completely standard H.264 codec we need to obtain and compile a patched version:
git clone https://bitbucket.org/memahaxx/drc-x264/ cd drc-x264 ./configure --prefix=$PATCHED_X264_PREFIX --enable-static sudo make install
Installing libdrc
Before running the demos all that is left, is downloading and compiling the libdrc:
git clone https://bitbucket.org/memahaxx/libdrc cd libdrc PKG_CONFIG_PATH=$PATCHED_X264_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH ./configure make sudo make install
Running the demos
If everything went OK so far, you are now able to run the demos:
cd ~/drc/libdrc/demos/3dtest ./3dtest
You should now see a cube on screen and on your pad, that you may move with the left stick and rotate with the right stick. Try the other demos too.
That’s it, you can now develop your own stuff. Have fun.
Troubleshooting
If your scan in the wpa cli does not reveal any 5GHz Access Points or you get the following error when starting the access point:
channel [0] (36) is disabled for use in AP mode, flags: 0x57 NO-IBSS PASSIVE-SCAN
it means that your need to check your regulatroy domain. First check which one is active:
sudo iw reg get
In my case 00 was active. Set this to your regulatory domain, or for that matter to any domain that works. US, AT were tested to work.
sudo iw reg set DOMAIN
Resources
libdrc
My startup script that loads the patched mac80211 stack and starts the hostappd and netboot so you can directly connect with the pad. All config has to be done before this will work, this is basically a helper to get everything running quickly after it has once been configured.

Hi. Thanks for your post.
I have just purchased the same Wifi Device and I am starting to follow your instructions but i am getting an error while configuring libdrc.
./configure: line 94: g++: command not found
error: could not compile a test ffmpeg/libavutil C++ source file
error: this usually means your ffmpeg/libav version is not up to date
What s wrong here? I followed the installation of ffmpeg with success.
Well, the error message forgot to tell that the g++ could not be installed. I have a fresh install of Ubuntu and the g++ was not installed.
sudo apt-get install g++
Install the build essentials package, this should give you everything you need for compiling.
sudo apt-get install build-essentialThanks for the information.
I have a problem with the command wps_pin BSSID PIN
I get the message UNKNOWN COMMAND every time.
Can you help me? please
Can you provide some output from the console?
Got the same problem had to re-install the drc-hosthap from the fork ;
didn’t go very far after because i couldn’t get WPS credential!!
So if you got through with the pairing, Betauser, would love some tips
Regards Cusmar
I can not get the gamepad to connect to my pc. It never shows “wlan1: STA aa:bb:cc:dd:ee:ff WPA: pairwise key handshake completed (RSN)”
Hey Stylesuxx, great article! I even purchased the same TP-LINK usb that you used.
I am trying to replicate the work you have done here however when I edit CONFIG_WPS=y
CONFIG_TENDONIN=y
then make i get the following error:
root@debian:/home/dan/drc/drc-hostap/wpa_supplicant# make
../src/drivers/driver_nl80211.c:19:31: fatal error: netlink/genl/genl.h: No such file or directory
#include
^
compilation terminated.
Makefile:1615: recipe for target ‘../src/drivers/driver_nl80211.o’ failed
make: *** [../src/drivers/driver_nl80211.o] Error 1
I am admittedly, a total newbie but if you could offer any help I would be eternally grateful.
(I understand you haven’t commented on this thread in 8 months, I hope you could make a little time to help a fan)
Hey Daniel,
if you take a look at the error code, it indicates that he is missing a file namely netlink/genl/genl.h
I am not sure what Linux distro you use, but if it is something with debian roots, aka you install packages with apt-get, there is a nice tool that allows you to search for files in packages, named apt-file – you may need to install it and then you can run
apt-file update
apt-file search genl.h
This will tell you in which package you can find the file, in your case I think you are missing libnl-3-dev, just install and recompile.
Also I see you are compiling as root. Try not to. You only need to be root for the make install step. If you work as root all the time, you run the risk of fucking something up sooner or later,…
Thank you for the speedy response and the tips! Yeah I am using Debian 8, I will try what you have suggested and let you know how it goes.
Thanks again!
I am at the part about opening the config file with your editor of choice and setting the WPS and TENDONIN settings, and I have opened up the defconfig file and found the WPS portion, but not the TENDONIN one. I am pretty new to Linux and am using Xubuntu. Am I doing something wrong or what?
Just copy paste it to the config, it is not there by default – if I remember correctly.
Alrighty, thank you, I just copied those lines to the bottom of the file. Appreciate the help!
I should have been editing the .config file right? Not the defconfig? Because I got it to run the make command finally, but I do not see the get_psk.config file at all, so I assume I fucked something up.
If make ran without errors, just create the file and copy paste the content 😉
You can’t really fuck up anything there, just read the output in case of doubt – you should recognize make errors by just looking at the last lines of output.
Ah ok. Thank you. I managed to get that part working. I know this doesn’t have anything to do with this blog, but since I posted last I have been trying to get my machine to see my TP-Link device, during the ‘sudo ifconfig $WLAN up’ step. I’ve been messing with the rt2870 device drivers for Linux and such; nothing seems to work. Do you have any ideas by chance? I am doing this through a virtual machine, which could be the issue.
Hmm, well that highly depends on the type of VM you use. You need to route USB to your VM and this depends on the VM you are using. You should be able to see the device when running lsusb in the VM if everything worked correctly.
I’m using VirtualBox, another tutorial online told me to run lsusb and it does indeed show up there, version and model is right and everything. Yet the command specified here gives me an error telling me the device is not found. I found on the forums for VirtualBox that I should 1 to 1 tie the USB device to my virtual machine, so only the guest OS has use of it, which I am working on now. It would also seem the driver software for the TP-Link does not like Linux, but hopefully I won’t end up needing to install that.
Seems I will need the driver software. I got VirtualBox to capture the TP-Link so the guest OS can use it, it just can’t see it still. Hopefully with enough digging I can find someone who has a workaround for the Linux driver.
Ok, managed to get VirtualBox to see my USB dongle. Got it connected up to my home WiFi to confirm it is working. Still getting error “up: error fetching interface information: Device not found” when running ‘sudo ifconfig $WLAN up’. Any thoughts? Sorry to be such a bother.
What is the output of ‘sudo ifconfig’ ?
Hi! I am trying to follow your guide on how to set up the WDN3200 but I’m running into some issues.
First of all, the libnl-dev and firmware-ralink packages do not seem to exist in the repositories on Ubuntu 15.10. I’ve installed libnl-3-dev but I’m not sure that’s sufficient.
Secondly, I can’t seem to compile the patched mac80211 driver. Running make in the drc-mac80211 causes a lot of compile errors and running make with the kernel specified results in kernel configuration errors: http://pastebin.com/7dK0aqLM
Is the patched mac80211 driver too dated, is it incompatible with current versions of Ubuntu, am I doing something wrong or am I missing something?
Ther error message says: Run ‘make oldconfig && make prepare’ on kernel src to fix it.
DId you try that?
Since quite some people seem to have problems with that I am currently working on an updated version of this article, so stay tuned.