Jump to content


using a WII remote with eeePC


21 replies to this topic

#1 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 25 December 2007 - 04:42 PM

Triggered by this post: http://forum.eeeuser...pic.php?id=5058 I decided to give it a try to use a wii remote with the eeePC.

It was a little bit messy so I do not feel too happy yet to add it to the wiki, but let me tell you what I did.

What you need:
- a wii remote
- a light source
- a usb bluetooth dongle.

I decided to go for the CWiid driver. For that I needed the debian packages lswm and wminput. However these are not in etch yet, so I started off changing /etc/apt/sources.list and add a line
deb ftp:/ftp.nl.debian.org/debian testing main contrib non-free
Of course you should use a debian mirror near you.See http://wiki.eeeuser....:adddebianfeeds for details.
Using testing gives me lenny which does contain these modules.

Next step was as superuser execute:
apt-get install lswm wminput mouseemu
This however dragged in a LOT of other modules (and make sure you did not apt-pin the eeePC feeds), so this is the messy part of it.

Now in order to run it the module uinput.ko is needed. I've build that one as well. It can be found on http://www.eeepc.speedlinq.nl/
Just download, unzip and untar, then put the module somewhere below /lib/modules/2.6.21.4-eeepc
Next:
insmod uinput.ko
to load the module.

You also need to have bluetooth on your system. I seem to recall the modules are already there initially, but unfortunately I have no good way to check that.

Next insert the usb bluetooth dongle.
type the command:
hciconfig hci0 up

Then start wminput; press 1-2 on the remote and wave your wii remote up and down. If you are lucky you now see the cursor move.
With this I managed to get some up/down movement. Left/right could only be done by rotating the remote. Generally the result was not that good.

However the wii remote can use an IR source to improve the movement.
The trick to achieve this is:
put a light source near your eeePC. (I used a portable flashlight pointing towards me).
Then type:
wminput -c ir_ptr

When I did that the tracking was a lot better. My accuracy with the pointer is not as good as with a mouse, but it is quite OK.
Next week I'll probably try to obtain some IR leds and solder them to a USB cable. Any advice on this is appreciated (would it be ok to put 3 IR leds in serial and put 5V over them, or should I add a resistor or something like that)?

If you manage to get this working or if there are questions, please report back.

FM
All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#2 Ian_D

    Member

  • Members
  • 28 posts

Posted 25 December 2007 - 04:57 PM

Have you got any video of this?

#3 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 26 December 2007 - 09:49 AM

Try the LED resistor calculator to see if you'll need to use a resistor.

#4 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 27 December 2007 - 04:19 PM

Sorry no video. I don't think my cam wil give me a good enough quality, let alone that I probably won't manage to operate both the eeepc+wii and the cam at the same time.

@ichbinbored: thanks for the calculator. I'll definitely use it.

One question on this: I found an IR led that is available in a local store. It is 1.3 V. For a 5V power source the calculator proposes 3 in series and a resistor of 22 ohm. Would it be ok to put 4 in series? I 'm planning to get the power from usb.
I have no idea how well those leds work if they only get 1.25V instead of 1.3.
All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#5 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 27 December 2007 - 04:34 PM

They should be fine if it's just under the correct voltage. It's overvoltage you've got to look out for.

#6 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 27 December 2007 - 06:06 PM

Ok, thanks.
Actually meanwhile I dug further into this and I guess I will just buy one of those wireless sensor bars from ebay as they are less than $ 10 including shipping (the wireless actually just means it is battery operated, not cable operated).
Saves the hassle making one and making a nice box to put them into.
All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#7 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 29 December 2007 - 06:42 PM

By the way, I'm guessing that pressing 1+2 on the wiimote syncs it to the eee. Is it possible to sync more than one at a time? And does one of the buttons click the mouse?

#8 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 30 December 2007 - 09:48 AM

I guess you can connect more wiimotes to one eeePC. Might require some work though.. One wiimote to more eeePC's at the same time is probably not possible.

Pressing 1+2 brings the wiimote in discovery mode which eventually leads to pairing the wiimote with the eeePC. The wiimote uses bluetooth to connect to the wii (or eeePC).
With the wminput program you can load your own config file and define the keybindings. I have not really played much with this.

Edited by eFfeM, 30 December 2007 - 09:48 AM.

All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#9 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 30 December 2007 - 07:43 PM

I seem to remember that it's possible to have more than one mouse on Linux at the same time. If the wiimote is just coming up as a human interface device then it should work. I've only got one wiimote at the moment (and no eee at all) so I probably won't be able to try it for a while though. I'll take a look at wminput to see what other stuff it'll do while I'm waiting.

*edit* the WiiLi.org wiki has instructions on binding buttons to events at http://www.wiili.org/index.php/Wminput.

Edited by ichbinbored, 30 December 2007 - 07:48 PM.


#10 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 03 January 2008 - 10:02 PM

By the way, I tried this method out on another PC using Ubuntu 7.04 live cd (7.10 wouldn't boot for some reason) and when I added the Debian repository it said it couldn't find the packages lswm, wminput and mouseemu. I ended up using this method which worked, although I needed to install autoconf, flex and some other stuff which I can't remember, and I had to compile a few of the packages myself. This method seems a lot easier, hope it works!

#11 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 04 January 2008 - 07:35 AM

No, the needed modules are not in 7.04, but they are in 7.10 They are also not in etch, that's why I moved to lenny.
Actually I went back to my etch version yesterday, after a brief experiment with another os, not to be named here (let's call it os x :) ). I was planning to rebuild for eeePC on my own and one way or another make the resulting stuff available. If anyone has a good reference to how to make a .deb file I'll use that, otherwise it probably will be a tar file with the resulting output.
All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#12 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 04 January 2008 - 05:57 PM

http://ubuntuforums....ead.php?t=51003 is a good guide on how to make a deb, and you can skip writing most of the changelogs, copyright notices etc. because this probably won't be going into an official repository. I don't mind compiling from a tar though.

#13 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 06 January 2008 - 05:21 PM

I have added a wiki page on how to install the wii driver software.
It is at http://wiki.eeeuser.com/howto:wiimote
Feel free to improve :)

I decided not to go for a deb. If someone feels challenged, be my guest.
All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#14 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 06 January 2008 - 09:29 PM

Thanks for making the tar file, I've updated the wiki entry with some info about wminput etc.

#15 silurius

    Senior Member

  • Members
  • 350 posts

Posted 11 January 2008 - 05:39 PM

Any tips on how to get this working under Windows, assuming that is even possible?

#16 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 11 January 2008 - 08:11 PM

You can use GlovePIE to use the Wiimote under Windows, as long as you have the right Bluetooth drivers (eg. bluesoleil) installed. There's a good tutorial at http://www.wiili.org/GlovePIE. That said, I couldn't get bluesoleil installed at all with Vista and my £2 bluetooth adapter wouldn't work properly under XP. Worked perfectly on Ubuntu though.

*edit*

There are loads of scripts available at http://www.wiili.org...ripts-t360.html so you can get it working emulating the mouse etc.

Edited by ichbinbored, 11 January 2008 - 08:19 PM.


#17 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 14 January 2008 - 10:12 AM

i have had it running under xp as well, but did not record my steps. Basically I followed one of Johnny Lee's instructions.
I used bluesoleil
All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#18 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 14 January 2008 - 04:19 PM

I followed Johnny's instructions, but it just kept randomly disconnecting before I could even get it set up as a human interface device.

#19 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 15 January 2008 - 10:49 AM

Ah, maybe I should have worded things better.
I did this on XP, but not on my eeePC, but on a Dell laptop.
It was indeed somewhat tricky to connect. I think I used pair device in bluesoleil. pin is 0000
But I recall I needed some tries as well.

Btw: for those who do not know it: Johnny's website is at http://www.cs.cmu.ed...y/projects/wii/
All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#20 ichbinbored

    Senior Member

  • Members
  • 171 posts

Posted 15 January 2008 - 11:06 AM

Yeah this was on XP, Bluesoleil just kept coming up with a message saying the "hardware was disconnected" (as in the actual dongle), while XP randomly made those irritating bell noises that you get when you plug in + unplug stuff. I think the dongle itself is ok because it worked perfectly on ubuntu, but it could mean that there was something wrong with my computer. It doesn't matter anyway because I should (hopefully) have an eee in the next few days :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users