Author Topic: wiimote almost sorted!  (Read 28798 times)

sandos

  • Regular Poster
  • **
  • Posts: 36
    • View Profile
Re: wiimote almost sorted!
« Reply #15 on: September 14, 2007, 02:47:36 pm »
I tried playing around with signal strength in ubuntu, but I was unable to get any readings even though my device supposedl  supports it! Does anybody know if there is a general problem of reading signal strength in BT ?

BTW nice work on the wiimote.

RDAC

  • Veteran
  • ***
  • Posts: 55
    • View Profile
Re: wiimote almost sorted!
« Reply #16 on: September 16, 2007, 07:03:22 am »
Anybody had time to continue playing with this project? Wanted to see if you were workin' on it this weekend. I may start playing with it myself here soon.

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: wiimote almost sorted!
« Reply #17 on: September 17, 2007, 01:41:31 am »
Had a little bit of time to play with it, but not as much as I would have liked.

I am finding connection a little bit inconsistent at the moment - not sure if it is the bluetooth dongle as it is a real cheap one.

Created a C++ device to represent the wiimote. Have only got to the stage where the device is built and starts up in the MD. I havn't actually put any of the code in it yet.
Need to build myself a IR bar as well as sick of candles. Got all the bits just need to put them together.

Will look into signal stength when I get the thing connecting consistently.

Question for someone with a wii (I only have the wiimote), do you need to connect (press 1 +2) every time you use it? I have assumed that you don't, but I havn't used one so thought I better check.

I am trying to do a few things in parallel at the moment and the wiimote is lower on the priority list but hopefully will get more time on it this week.

RDAC

  • Veteran
  • ***
  • Posts: 55
    • View Profile
Re: wiimote almost sorted!
« Reply #18 on: September 17, 2007, 07:08:19 am »
Don't have to press both buttons, normally any button on the remote will make it 'wake up'.

gazlang

  • Guru
  • ****
  • Posts: 210
    • View Profile
Re: wiimote almost sorted!
« Reply #19 on: September 18, 2007, 09:07:55 am »
Been playing around with wminput to get it sticking in search mode without a device enquiry error (so that it can be run auto at boot), but no luck yet.
I installed it on Kubuntu without Lmce, and wminput -w -c ir_ptr will hold forever untill you connect the wiimote (perfect for starting the command auto at boot).

Any suggestions why it fails with LMCE installed?? (or is it just a problem I have?) LMCE bluetooth override?

I have a feeling bluez-utils has something to do with it - I tried to re-compile it (on my LMCE machine) and it failed with errors.
« Last Edit: September 18, 2007, 09:14:06 am by gazlang »
AMD Athlon 5800+ X2
Asus M2N-SLI-Deluxe
2x Corsair XMS6400 DDR2 512mb
Samsung 400GB SATA + 500GB SATA
nVidia GeForce 7300GT
Hauppauge Nova-T 500
Hauppauge PVR-500
Thermaltake low-noise 450w PSU
Thermaltake Bach Case w/ imon vfd
Fiire Remote
UIRT

sandos

  • Regular Poster
  • **
  • Posts: 36
    • View Profile
Re: wiimote almost sorted!
« Reply #20 on: September 19, 2007, 08:35:25 am »
With a Wii, the first thing you do is generally to press the red button in under the battery cover at the same time as pressing the red button under the front hinge on the Wii. This connects the wiimote and from then on it will automatically be detected by the Wii.


There is also the option of bringing your wiimote to a friends place and temporarily connect it to his Wii. I think this might be done with 1+2.

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: wiimote almost sorted!
« Reply #21 on: September 19, 2007, 09:34:01 am »
Sounds like it should be possible to (semi)permanently pair the wiimote with the bluetooth dongle then.
Will have to try stuff out and see what happens in terms of moving rooms etc.

I am starting to think that we might need a better solution than wminput. The things that bother me at the moment are;
* Intermitant connects - I am not getting a reliable connection
* Need to activate connection (1+2 button thing) each time.
* It seems to implement only one interface at a time, by default it is the accelerometer and with the -c ir_ptr option it is infrared. Originally, I had hoped it did both -ie used the acc. always and then enhanced it with IR positioning. The wiimote can obviously convey both, I guess the issue is with simulating mouse movements the two might conflict ???

gazlang

  • Guru
  • ****
  • Posts: 210
    • View Profile
Re: wiimote almost sorted!
« Reply #22 on: September 19, 2007, 11:43:22 am »
Well I decided to try out cwiid (wminput) because it allowed an easy button configuration, and also because the alternative 'wmd' didn't seem to have been met with much success (http://forum.linuxmce.org/index.php?topic=1246.0).

After using the wiimote under wminput for a while I have also decided that it is far from perfect for LMCE.
I don't mind having to connect by pressing 1+2 on boot, and once connected I don't have a problem with losing signal or connection. But I am finding a problem in the use of only one wiimote interface at a time (ir sensor or gyro).

The ir sensor doesn't seem to enable a good navigation of media (scrolling up and down pages in the LMCE TV guide / dvd chapter list etc). In fact, trying to scroll through pages accurately is useless, the wiimote completely overshoots page scrolling.

The gyro mode however, is perfect for up and down page scrolling in LMCE, but useless along the x (horizontal) axis, as this is controlled by roll motion of the wiimote rather than yaw (as when using the ir mode) and is extremely difficult to manipulate accurately.

Therefore, an integration of ir sensing and gyro control is a must really! I'm going to continue playing around with wminput for a while to see if I can at least get gyro for y axis movements and ir sensing for x axis movements, but i'll also be looking out for other wiimote drivers to check out.



AMD Athlon 5800+ X2
Asus M2N-SLI-Deluxe
2x Corsair XMS6400 DDR2 512mb
Samsung 400GB SATA + 500GB SATA
nVidia GeForce 7300GT
Hauppauge Nova-T 500
Hauppauge PVR-500
Thermaltake low-noise 450w PSU
Thermaltake Bach Case w/ imon vfd
Fiire Remote
UIRT

gazlang

  • Guru
  • ****
  • Posts: 210
    • View Profile
Re: wiimote almost sorted!
« Reply #23 on: September 19, 2007, 08:52:06 pm »
Ok, got one little piggy sorted (I think):
to add gyro function to existing ir motion sensing simply:

sudo nano /usr/local/etc/cwiid/wminput/ir_ptr

and add

Plugin.acc.X    = REL_X
Plugin.acc.Y    = REL_Y

such that the page now looks like:

#ir_ptr

include buttons

Plugin.ir_ptr.X = ABS_X
Plugin.ir_ptr.Y = ABS_Y

Plugin.acc.X    = REL_X
Plugin.acc.Y    = REL_Y

Haven't tested how this works in LMCE for page scrolling yet - have it working on KDE (on my non LMCE PC).

Still trying to get it running auto on boot though.

Thinking that modding /etc/init.d/bluetooth to search for the wiimote using its mac address may work / help?? Or even adding wminput in there somewhere?? Not sure where.....hoping someone else can shed some light.

see here http://ubuntuforums.org/showthread.php?t=432013

« Last Edit: September 19, 2007, 08:55:04 pm by gazlang »
AMD Athlon 5800+ X2
Asus M2N-SLI-Deluxe
2x Corsair XMS6400 DDR2 512mb
Samsung 400GB SATA + 500GB SATA
nVidia GeForce 7300GT
Hauppauge Nova-T 500
Hauppauge PVR-500
Thermaltake low-noise 450w PSU
Thermaltake Bach Case w/ imon vfd
Fiire Remote
UIRT

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: wiimote almost sorted!
« Reply #24 on: September 20, 2007, 01:14:26 am »
Good stuff gazlang, hopefully I will be a ble to help you out a bit more soon. Struggling for any time this week.

Stingly

  • Veteran
  • ***
  • Posts: 51
    • View Profile
Re: wiimote almost sorted!
« Reply #25 on: September 27, 2007, 11:58:38 am »
Has there been any further developments with this? I must admit that reading through the thread has made me rather excited by the prospect of using my wiimote to control LMCE!

atreidae

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: wiimote almost sorted!
« Reply #26 on: October 06, 2007, 04:50:23 am »
I got it working with gyro out of the box, cwiid is awesome, unfortunately my son and missus (as well as moving house0 is delaying development, you guys have flown straight past what i started, Whoa!

Ill see what i can do to get cwiid -w to run when a bt device is discovered.

something i noticed in the binaries i downloaded it helps ALOT if you specify the mac of the wiimote on the cwiid command line.

(all the commands escape me at the moment... im at work)

atreidae

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: wiimote almost sorted!
« Reply #27 on: October 06, 2007, 04:53:35 am »
of worthy note (i have checked the guides posted but most of them assumed uinput was running) the DVD install has uinput deactivated by default.

a "modprobe uinput" is required to get everything up and running PRIOR to cwiid.
can you CAN run cwiid as a normal user, you need to change the properties for uinput to all users (cant remember that one either)

Im sudoing because im slack.

gazlang

  • Guru
  • ****
  • Posts: 210
    • View Profile
Re: wiimote almost sorted!
« Reply #28 on: October 06, 2007, 02:57:42 pm »
I've been playing with it this morning, and kinda made some progress, while also taking a step back!

I have the wiimote kinda working on boot...

do hcitool scan in konsole and copy the mac address

then start wminput with the mac address. eg.

wminput -d -c ir_ptr 00:19:1D:84:CB:DD

the -d daemonises wminput and retries to connect after a disconnect.

THis is very stable in terms of maintaining a connection.

I then added:

@reboot /usr/local/bin/wminput -d -c /usr/local/etc/cwiid/wminput/ir_ptr 00:19:1D:84:CB:DD

to crontab -e

and the wiimote works at boot (of course you still have to press 1+2 to connect)
However, now it seems ir_ptr is ignored, as none of the configured buttons work, and neither does the ir sensing. Only the accelerometer motion and 'A' for enter!

I think something needs loading before wminput for this functionality. I don't know what though  :)

AMD Athlon 5800+ X2
Asus M2N-SLI-Deluxe
2x Corsair XMS6400 DDR2 512mb
Samsung 400GB SATA + 500GB SATA
nVidia GeForce 7300GT
Hauppauge Nova-T 500
Hauppauge PVR-500
Thermaltake low-noise 450w PSU
Thermaltake Bach Case w/ imon vfd
Fiire Remote
UIRT

atreidae

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: wiimote almost sorted!
« Reply #29 on: October 09, 2007, 08:41:42 am »
sorry, can you go into this step in a little more detail..

Quote
I then added:

@reboot /usr/local/bin/wminput -d -c /usr/local/etc/cwiid/wminput/ir_ptr 00:19:1D:84:CB:DD

to crontab -e

never done it that way before, might be why i cant load stuff.

Check the permissions of the configuration file, try sticking your command in quotation marks

Im building a new machine tonight (MD) so ill have a play (moved my core to the cupboard when we moved.. the missus aint happy :D )