Jared Weinstock-TL

Chau Nguyen

Todd Carpenter

Kyle McArdle

Nick Deimler

Tom Bergamini *NEW*
Tutorial: Connecting a WiiMote to a Computer
30 January 2009 | by kyle

Ok, so since everything about this game requires you to use a Wiimote on your computer, I’m writing up this quick setup guide to help everyone do that. This should take no longer than five minutes to set up. Please note that I’m doing this on Windows, but Mac setup is very similar. The only difference is the version of WiiFlash Server that you need to use.

What you need:
So to start, you’re going to need the following:

Bluetooth:
-Most laptops/desktops come with bluetooth already installed, if you don’t have support for it, I’d recommend just grabbing a USB dongle from Newegg . You can get them for <$20.

Bluetooth Software:
-I’m using BlueSoleil but you should be able to use any software that can pair a device to your system. Your computer probably already has some installed, or your USB dongle probably came with some software.

WiiFlash Server
-WiiFlash

WiiMote
-The whole point of this. Go grab one from your entertainment system. Don’t worry, it’s not like there is anything on Wii that you want to be playing right now anyway.

Setup:
I’m not going to get into how to install your Bluetooth software, there should be instructions with whatever software you chose, but most computers made in the last few years already have this all set up.

Getting the WiiFlash Server
Ok, so the first step is to set up WiiFlash. After you extract the zip file your given a folder that looks like this:
(Once extracted there is a windows and Mac folder, so Mac should be the same)

WiiFlash Folder

This has all the source code and classes that are used for creating WiiFlash programs, what you want is just the server.
So navigate into the Server directory, and you will see WiiFlashServer 0.4.2.exe. You can move this wherever you want, or just leave it. This is the only file you need to get WiiMote connectivity working.
MAC USERS: I believe the file you want is called WiiFlashServerJ

WiiFlash icon

Also note the Examples folder as well, you can use these SWFs to test everything out when you are all done. Just keep the WiiFlash server on the side for now, we’ll come back to it in a few.

Pairing The WiiMote:
This is going to be the most ‘difficult’ part of the whole setup, but once you get this paired, you’re pretty much done.

Ok, so the first thing we need to do is open up our Bluetooth places. This is done either by clicking the Bluetooth icon on your Desktop, tool tray, or through the Start Menu.

Bluetooth Places Icon

Once you are in here, you should have a screen listing all known Bluetooth places, this is the part where we add the WiiMote. Your screen should look something like this:

Empty Bluetooth Places

Now, press buttons 1+2 on the WiiMote, and all four lights should start flashing. Now double-click “Search Devices” and it should find your WiiMote after a few seconds. In this case I found my roommate’s laptop too, but I’ll look through all his personal files later.

Searching For Devices

Now we double-click on the game device, and it should connect and turn green (or do whatever your software does… Hey, I found his printer too…this could be fun later…)

Connected to WiiMote

At this point you should be connected, and the lights on your WiiMote should still be flashing. Now we are going to start up the WiiFlash server. If all goes to plan, you should get a cool splash screen and be greeted by a success message telling you that one WiiMote is connected:

071

The WiiMote should now have just the Player 1 LED lit. You can connect up to four WiiMotes (with Nunchucks) this way, however I found you need to rerun the WiiFlash server to get it to pick up the new ones.
If you click on the WiiMote icon in WiiFlash it will make the controller rumble.

Testing It Out
Go into that Examples folder I mentioned before, and run the file “WiiMote Demo.swf” You should get a cool readout of all the WiiMote’s variables, and an indicator on which buttons you are pressing.

Test Application

NOTE: For some reason I had to recompile the SWF to make it work, so if it’s not working open up the .fla in Flash and just hit Ctrl+Enter.

Conclusion:
I hope this guide helped you get everything set up. Later we will be putting up video and text guides on how to get the WiiMote working with headtracking and the IR detection (Jared has posted up an awesome preliminary guide [HERE] about making IR goggles that are stylish as well as functional…and they even come with a ninja mask…)

On another note, even with this all set up I don’t think the examples I posted before will work on the web. I’m pretty sure they need to be saved locally since I keep getting security warnings about connecting to Bluetooth. This is the reason we chose to make our final project an AIR application.

If you have any questions just post up a comment and I’ll try and help out. If you have any Mac related questions I’m sure Jared will be more than happy to help too since he got this all running on his Mac.


18 Comments

[...] just posted a great tutorial about connecting your Wiimote with [...]

Mick Jackman | 31 January 2009

Hello, I have just started a wiimote project so this tutorial is fantastic, thanks. I am new to computer programming and learning the basics in Flash. I am trying to use the wiimote to run a bowling game simulator. Using the same principle from the Jonny Lee finger tracking game, I have placed two reflective stripes on a bowl which the wiimote picks up, as the bowl rotates i hope to be able to calculate the speed and direction of the bowl. I have only used it with the finger tracking multi grid, I now want to do my own with Flash. I have downloaded the WiiFlash server 0.4.5 that detects the wiimote, however when I try to run the Wiimote Demo from the examples folder the following message appears:

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file:///C|/Users/Michael2/Desktop/WiiFlash%200.4.3/Examples/Wiimote%20Demo.swf cannot load data from 127.0.0.1:19028.
at WiiSocket()
at WiiSocket$/getInstance()
at org.wiiflash::Wiimote()
at WiimoteDemo_fla::MainTimeline/frame1()

Please can you help me get the wiimote working with a Flash game. Thank you. Mick

Riley | 2 February 2009

I got to this point also, and got the error. I don’t know if just using the Windows software worked for anyone else, but the “Skip” button didn’t work when I went to finish the pairing. I downloaded the BlueSoleil software, and that seems to have done the trick. However, I can’t run the examples locally or on the website. I looked through the security settings on Flash Player 9, but no dice. Is there something that I’m missing? Let me know and I’ll give you a shiny penny :)

Thanks in advance.

kyle | 5 February 2009

Hey all, thanks for the comments and I think I know what your problems are.
First of all, I didnt mention it, but you need the latest version of flash to use this, so go upgrade to Flash 10.

Secondly, for the security errors, it sounds like you are trying to run the swf file through the browser, or possibly without Admin access. I got a similar error when trying to run the test app in FireFox. Just try opening it in the latest Flash Player, or run the FLA in Flash (i used CS4, but CS3 should work fine as well) and just hit Crtl+Enter. I have not looked into it, but there is some error of using bluetooth through the browser…I’m not sure.

Hope this helped, and if you have any more questions feel free to ask.

marocchino | 19 February 2009

hi,1st of all, thax for your post.
it`s so helpful for me.
bytheway, i can`t start “WiiFlashServer 0.4.5.exe” file.

An unhandled exception (’System.IO.FileNotFoundException’) occurred in WiiFlashServer 0.4.5.exe[4560].

what i missing, any dll or file need more?
or comfile something? or because my nation code is KR?

Jared | 21 February 2009

marocchino,

Do you have the Microsoft .NET Framework 3.0 installed?
If not, you can download it here.

[...] Wii Remote (required) and Nintendo Nunchuk (optional) 2. Follow this guide to get connected: http://thefourmation.com/2009/01/30/tutorial-connecting-a-wiimote-to-your-computer/ 3. Download WiiFlashServer from http://wiiflash.bytearray.org/ if you want the full package, else [...]

[...] quieres intentarlo aquí tienes un manual que contempla todas las cosas que requieres, Bluetooth, WiiFlashServer, etc. Ahora [...]

Harlan | 5 April 2009

Crap… I have windows xp and I tried pairing with Bluetooth places, it can detect the wiimote, but then it asks me for a passcode and there is no “skip” button.

kyle | 22 April 2009

If there is no option to skip passcode authentication try installing BlueSoleil or another bluetooth suite. Over the past few months I’ve figured out some older bluetooth software packages simply don’t let you skip this step.

Thivy’s Portfolio | 19 May 2009

[...] 3. Follow these steps to connect your wiimote with the Wii Flash server [...]

Tap | 7 July 2009

Kyle, these posts have been fan-freakin’-tastic. I’ve managed to connect my wiimote and build the IR glasses. I’m playing with building a simple head tracker using this setup. I was wondering if you could post some sample code for working with the IR stuff. Thanks much for documentating all this great work on the web.

-Tap

Kivanchi | 16 July 2009

Harlan, i’m sure you’ve figured this out by now but just in case, i had no “Skip” when I first tried setup, but I had things in the wrong order. Once your device is in the “Bluetooth Places” list, select it and then click “Add Device” in the left hand menu, you should find that “Skip” is now available. For some reason I have to go through this every time to hook up, but at least it works.

Kivanchi | 16 July 2009

I also have an issue. I’ve setup my wiimote so that it is detected and I can see it sending packets across the bluetooth. Strangely, wiiflash server still says there are no devices connected when it loads up. Does anyone have any ideas as to what i should try next?

titojoe | 12 September 2009

Hi and congratulations for your work.

I’ve done all steps to run wiiflash and i just have wiiflash server detecting my wiimote. But the problem is that when I run the demos it dispatches an error connection like if wiiflash server wasn’t running.

I’m on vista ultimate, with fp9 and using the o.s bluetooth program. Any idea?

MarkOB | 18 September 2009

Привет! Недавно я писал на этом форуме о зубной боли, но тему прежнюю не нашел. Может ее удалили ? Что за люди ? Может у них нет зубов ?:)
Сейчас у меня все гуд. Все вылечил, так что стоматология Нижний Новгород - тот еще рулез :) Если интересно прочитать всю историю можно покапаться на dentalnn.ru. Там много тех, у кого есть зубы….:)

[...] 3. Follow these steps to connect your wiimote with the Wii Flash server [...]

Leave a Comment

Copyright © 2009 | The Fourmation | All Rights Reserved.