Sunday 27 May 2012

Getting Started with WiiRemoteJ



What You Need
  • A bluetooth dongle. This is a USB stick that will plug into your computer to work with the Wii Remotes.

  • Avetana Bluetooth needs to be installed on your machine and configured correctly. If it is not you can easily follow my tutorial here

  • I highly suggest you use a computer with a Linux operating system that has a graphical user interface, such as Xubuntu (ie. you can see pretty icons and a desktop rather than just a black screen with text). This is because Avetana is free with Linux and so that is what I used.


Downloading WiiRemoteJ

To download WiiRemoteJ, go here, and click the little orange download box as shown.


Once you have downloaded WiiRemoteJ, we need to extract it. Place the zip folder in an empty directory that you create, and name it something like WiiRemoteJ so you remember it.




Extracting WiiRemoteJ


Double click the file to open up the zip.



Drag the wiiremotej folder to the file manager to extract it.



Installing WiiRemoteJ

Go into the extracted directory and copy the Wiiremotej.jar file



Open up the terminal and type 'sudo thunar' in order to open up the file browser as the root user. You may need to enter the root user password (whatever you type to log in). This will allow us to paste the file where we need it.

The thunar file manager will open. Navigate to your Java extensions folder. Mine is located at '/usr/lib/jvm/java-6-openjdk/jre/lib/ext' and yours will be somewhere similar (probably just something different after the ' /jvm/ ' bit).



Paste the file into this directory.



It is very important that after doing this close that file manager immediately, due to the reason in red stated at the top of the file manager.

Testing/Playing with WiiRemoteJ

Now that you have installed WiiRemoteJ we should be able to run the WRLImpl.java file within the WiiRemoteJ folder that we extracted. Navigate to the WiiRemoteJ file within the command line in linux and type 'javac WRLImpl.java', press enter, then type 'java WRLImpl'. The following should pop up once you have connected the Wii remote by pressing both the 1 and 2 buttons on it after the program has started up. (note that the screen capture didnt work too well in this case so there is the white rectangle.)




Troubleshooting
If you don't have Avetana or WiiremoteJ installed correctly, when you try to compile the WRLImpl.java file provided by WiiRemoteJ, it will not compile properly and you will get a screen like this:



If you have WiiRemoteJ installed correctly but have not set up Avetana then the WRLImpl.java file will compile but will not run correctly and you will get an error like this:

No comments:

Post a Comment