Copied from http://www.nslu2-linux.org/wiki/HowTo/ConnectWiimoteDebian
Edited for the Debian Slug
In this page I will describe how to connect a Nintendo wiimote on your slug.
This Document is based on
My Hardware is
- NLSU2 with Debain (Linux version 2.6.18-5-ixp4xx (Debian 2.6.18.dfsg.1-13etch4) (dannf@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)))
- Nintendo Wiimote (http://www.wiili.org/index.php/Wiimote)
- Bluetooth adapter
- USB key 2GB with Debian
The USB key is connected to "disk2".
On "disk1" there is my bleutooth adapter
Basic Installation
- Install Debian and update via:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
- Then reboot
- Run the following to install the needed packages:
sudo apt-get install autoconf automake gcc pkg-config libbluetooth2 libbluetooth2-dev bluez-utils
Setup Bluetooth Adapter
Plugin your bluetooth adapter.
You should now be able to do:
hciconfig hci0 up
to make the Bluetooth interface available to the Bluetooth protocol stack.
Run hciconfig by itself again should give something like this:
hci0: Type: USB
BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:8567 acl:125 sco:0 events:409 errors:0
TX bytes:4518 acl:128 sco:0 commands:130 errors:0
Config Bluetooth
sudo vim /etc/bluetooth/hcid.conf
change the security auto; to security none;
You'll need to restart bluetooth adapter:
/etc/init.d/bluetooth stop
/etc/init.d/bluetooth start
! Find the wiimote
You can scan for the presence of the Wiimote. You must first Press A and B buttons on the wiimote. The leds of the wiimote will fash after you can type:
hcitool inq
Please note the address of the wiimote is returned. This number is the address of the wiimote.
Install the libwiimote
Download from sourceforge
# You can download the library from here: http://downloads.sourceforge.net/libwiimote/libwiimote-0.4.tgz
wget http://downloads.sourceforge.net/libwiimote/libwiimote-0.4.tgz
# extract to a folder
tar -xzvf libwiimote-0.4.tgz
cd libwiimote-0.4
autoconf
./configure
make
sudo make install
Pair the wiimote
Now we pair the wiimote.
hcitool cc xx:xx:xx:xx:xx:xx
Where the xx:xx:xx:xx:xx:xx use the address of the wiimote.
Run the test program
From the bin directory launch test1 with the wiimote address.
./bin/test1
To know
I think you can't use a bluetooth adapter from a USB hub.
I should test this.
To do
I should actualy connect a wiimote.
Note
all but connecting a wiimote have been done.
Done
All Done