LinuxMCE Forums

General => Installation issues => Topic started by: cleardata on April 10, 2009, 05:33:53 am

Title: Setup of Wii Remote
Post by: cleardata on April 10, 2009, 05:33:53 am
I have followed the directions on the Wiki for setting up the wii remote.  http://wiki.linuxmce.org/index.php/Nintendo_WiiMote (http://wiki.linuxmce.org/index.php/Nintendo_WiiMote)

However, I'm having some problems.  when the system boots up, I press the 1 and 2 buttons at the same time and it detects a mobile phone.  How should I configure this?

Thanks
Title: Re: Setup of Wii Remote
Post by: tschak909 on April 10, 2009, 07:22:37 am
Tell it to ignore the device.

We need to do a lot of work with bluetooth dongle to allow devices other than cell phones to be recognized by the system properly.

-Thom
Title: Re: Setup of Wii Remote
Post by: cleardata on April 10, 2009, 02:32:27 pm
Ok, when I choose "No, Not at this time" the remote still doesn't work. 

What could I be missing?  when I do the steps on the Wiki it behaves correctly I.E. I can get the Mac address of the Wii controller etc...
Title: Re: Setup of Wii Remote
Post by: cleardata on April 10, 2009, 08:43:37 pm
I was able to resolve it.  As much as you think to type in everything that is on your screen there are some things that are supposed to be edited.  :) 

Modified /etc/wminputd.conf

from
Code: [Select]
#this is the config file for the wminputd
#enter the wiimote mac address, you can find it with
#hcitool scan  and then press the red button
#besides the battery's off the wiimote
#Then place the show'n mac address as follows
WIIMOTE_BDADDR="00:AA:00:BB:AA:FF"


to
Code: [Select]
#this is the config file for the wminputd
#enter the wiimote mac address, you can find it with
#hcitool scan  and then press the red button
#besides the battery's off the wiimote
#Then place the show'n mac address as follows
WIIMOTE_BDADDR="<MY MAC ADDRESS FOR THE WII CONTROLER>"

rebooted, problem solved.  One question though.  It is behaving as a mouse, But when you are looking through your videos, with a mouse you can go to the top of the screen and it will page it up.  Same with the bottom of the screen.  For the Wii Controller, it just stops and nothing happens.  Anyone ran across this?
Title: Re: Setup of Wii Remote
Post by: pigdog on April 10, 2009, 10:36:04 pm
Hi,

Just wondering, are you talking about this?

http://forum.linuxmce.org/index.php?PHPSESSID=20e9889bb836d172e565da8aff657f60&topic=7807.0

Cheers.
Title: Re: Setup of Wii Remote
Post by: cleardata on April 10, 2009, 11:58:09 pm
Sorry, no, When you are on the orbiter screen and you select Media then Videos it comes up with a list of all your videos.  on the right hand side you have the Alphabetical list as well as the first screen of videos to choose from.  So if you take your mouse and drag it over that list, up or down it will provide you up arrows or down arrows and flip the screen to the next 10 or so videos.  I'm unable to do this with the WiiMote.  The cursor will travel to the top of the screen or the bottom but not provide the flipping of the pages.  Only way to get to more videos is to do a search.

Hope that explains better...  the 1/4 of the screen thing is not the problem, although I have already implemented what he suggested because I am using a sensor bar as well.
Title: Re: Setup of Wii Remote
Post by: pigdog on April 11, 2009, 01:34:01 am
Hi,

I've even had problems with that using the mouse.  What I normally had to do was kind of make a run at it.

Swing up, then back down to the bottom right or top left.  Sometimes I took a couple of attempts.

Sometimes I'd have 2 or 3 arrows and the pages would flip past where I wanted.

It took a while to develop the right touch.

Good luck.
Title: Re: Setup of Wii Remote
Post by: cleardata on April 11, 2009, 03:18:48 am
I agree, even with the mouse it is hard to do.  But I thought it might be easier with something that was Gyro based.
Title: Re: Setup of Wii Remote
Post by: piusvelte on April 11, 2009, 04:50:57 am
Glad to see it's working. I've not tried scrolling, but instead select the letters on the right to get to different movies. I'm still working out audio issues, so I've not really gotten to see how usable the wiimote is day to day yet.
Title: Re: Setup of Wii Remote
Post by: cleardata on April 12, 2009, 08:45:51 am
I'm having issues with the Alpha list on the right.  when I click a letter on the right it just takes me to the top of the list.  Anyone heard of that?  I was able to get it to scroll page by page, but it just doesn't work that well.  Searching is much easier.
Title: Re: Setup of Wii Remote
Post by: Che on April 14, 2009, 05:16:44 pm
would GlovePIE work? I don't know if it works on kubuntu, but if it does, then it should solve all problems. Plus it's got really nifty actions, so you could set it up, so thatr a jerk to the right would skip forward, a jerk to the left would skip back, and so much more.
Title: Re: Setup of Wii Remote
Post by: cleardata on April 14, 2009, 05:24:27 pm
I'll check that out.
Title: Re: Setup of Wii Remote
Post by: Marie.O on April 14, 2009, 06:02:48 pm
I'm having issues with the Alpha list on the right.  when I click a letter on the right it just takes me to the top of the list.  Anyone heard of that?

Yes. It happens, if your list of displayed titles contains non-printable characters. It happened to me, when I imported a bunch of MP3 with tags. Some titles where spanish or french, and there were problems with umlauts as well. After fixiing those using the web admin, things went smooth.
Title: Re: Setup of Wii Remote
Post by: mactalla on April 14, 2009, 06:30:46 pm
I'm having issues with the Alpha list on the right.  when I click a letter on the right it just takes me to the top of the list.  Anyone heard of that?

Yes. It happens, if your list of displayed titles contains non-printable characters. It happened to me, when I imported a bunch of MP3 with tags. Some titles where spanish or french, and there were problems with umlauts as well. After fixiing those using the web admin, things went smooth.

I'm seeing the same thing.  Thanks for explaining the cause.  I won't bother with it, then.  (probably at least half my music has non-ASCII characters)
Title: Re: Setup of Wii Remote
Post by: Marie.O on April 14, 2009, 07:01:03 pm
I'm seeing the same thing.  Thanks for explaining the cause.  I won't bother with it, then.  (probably at least half my music has non-ASCII characters)

It is not about non-ASCII characters. It is about tags in the MP3s with a wrong character sets. I have now cleaned up my stuff, and do see all my music, including those with german Umlauts, french accents (or how ever they are called).
Title: Re: Setup of Wii Remote
Post by: cleardata on April 14, 2009, 07:35:33 pm
Sounds about right, I imported a bunch of my videos and that's when it started happening.  when i get home I'll check that as well. 
Title: Re: Setup of Wii Remote
Post by: piusvelte on May 01, 2009, 04:47:37 am
So I figured out how to get scrolling to work with the wiimote. I'm using a sensor bar with /etc/cwiid/wminput/ir_ptr. This includes the buttons config. When I'd try to scroll, the cursor would go to the bottom of the screen and nothing would happen. To get scrolling to work, you have to add in the acc_ptr config. I just added these lines from acc_ptr to the ir_ptr file:
Code: [Select]
Plugin.acc.X = REL_X
Plugin.acc.Y = REL_Y
Now I can scroll through my music/videos etc. I'll add this to the wiki.
Title: Re: Setup of Wii Remote
Post by: tschak909 on May 01, 2009, 05:20:18 am
Instead of hacking it together, why don't some of you spend some time actually properly integrating it into LinuxMCE?

-Thom
Title: Re: Setup of Wii Remote
Post by: piusvelte on May 01, 2009, 05:28:10 am
Thom,

I'd be glad to contribute to LMCE. How do I properly get started? I don't want to cause any disruptions or grief for the real developers! :)

Thanks!
Title: Re: Setup of Wii Remote
Post by: tschak909 on May 01, 2009, 05:52:09 am
Real developers? ;)

the "Real Developers" as you put it, merely are people who just buckle down and do the work to make things better for others.

We have a very basic rule here. "He who does the work, has made the rules."

(yes, that wording is very specific, think about it.)

You need to first spend some time reading the Developers guide on the wiki. Also look at Device Templates

-Thom
Title: Re: Setup of Wii Remote
Post by: pigdog on May 01, 2009, 05:37:58 pm
Hi all,

I've been using the wiimote on alpha 2 and it works much better than on 710.

For scrolling works thru movie pages, just use a light touch or wrist flick for scrolling to the next page.

Keeping it pointed to the bottom/top right will produce multiple scroll arrows.

I had no problems on initial setup. No need to modify plugin.acc.

I've got a ir light bar for tracking.

The only real problem is making sure you have good batteries in the 'mote.

Cheers.
Title: Re: Setup of Wii Remote
Post by: tschak909 on May 01, 2009, 05:46:20 pm
Will somebody do the legwork, based on the HID remote notes I have dumped in the Gyration thread, and make a device template that uses wminput to handle the wiimote? preferrably someone who has a mobile orbiter in use?

-Thom
Title: Re: Setup of Wii Remote
Post by: mactalla on May 07, 2009, 05:45:22 am
Will somebody do the legwork, based on the HID remote notes I have dumped in the Gyration thread, and make a device template that uses wminput to handle the wiimote? preferrably someone who has a mobile orbiter in use?

First of all, please forgive me for any noob questions.  I can get around Linux and C++ well enough, but I'm very new to LinuxMCE with a recently setup core, MD, wiimote and no orbiter.  Ideally these questions are already answered somewhere and you can just point.  However I have not yet found them.  When things make sense, I think a clear step-by-step wiki page is in order.  I can certainly help with that.

I appreciate the valuable info you put in the other thread.  Could you point me to additional information for creating device templates?

I took a stab at a device template based on what I could find in the wiki, which sadly wasn't much.  I looked at the webadmin for creating device templates and aside from not understanding many of the fields, based on comments in the forums here it seems clear that's only one piece of the puzzle.

As a starting point, I would like to know the top-level flow of events and from there can ask more informed questions / more likely to figure things out on my own.

Let's take our case here of the Wii remote.  I assume there are two levels of polish for the device template for lack of a better term.  The first would be to have the buttons do what we want (ala create a Play/Pause key being the top priority here, methinks).  The more complete version would also handle creating the wminputd script, wminputd.conf, etc as described on the wiki so that when it's detected all those things are setup automatically.  Am I correctly understanding the scope of responsibility for device templates?

Let's focus on the first level of polish as the remainder is clearly laid out on the wiki and should be easy to automate.

My first question is associating a device with a template.  When creating the template I see you can specify a MAC range, etc.  How can I tell that the device has been associated with the template?  I assume one of the log files would contain that info?  Where/which one?

When a template is loaded it reads the mapping and configuration as you pointed out in your post.  Mapping is irrelevant for the Wiimote task as the wminputd.conf is doing the mapping.  So configuration is the only one we're interested in for this case.

You mentioned the syntax for configuration is:
RemoteMapping_Entry,x scancode,UDH,Y

The UDH,Y portions are clear (thanks to your post).  x scancode is the same as keycode, correct?  For some reason I thought scancodes were more raw than even keycodes, but xev is only showing the keycode and keysym, so perhaps I'm mistaken there.

The RemoteMapping_Entry I'm not clear on.  You provided an example of a RemoteMapping entry early in your post, but I missed where this is actually defined, whether this needs to be defined for every template, or where to find the list of existing mappings for standard actions (like Play/Pause).

Now with those pieces, it looks like making the right entries in #59 Configuration - Default Value would do the trick (assuming there's an existing RemoteMapping to point to).

So where do the changes for bluetooth & bluetooth_dongle code enter the picture?  (Your post here: http://forum.linuxmce.org/index.php?topic=4755.msg51423#msg51423 said those are needed too).

Long post, but I hope it makes sense.  I'll write a wiki article when I understand things myself.
Title: Re: Setup of Wii Remote
Post by: tschak909 on May 07, 2009, 01:43:42 pm
Sorry, I will write more when I get a free moment, but to ansewr a quick question, scancode = x key code.

I will try to explain other bits better when I get the chance.

But basically, you have a device template, this contains the following:

* Device name
* How it relates to other devices (can it be attached to a core, or a MD, to other devices, etc?)
* A package for this device driver, so that it can install what it needs for drivers, etc.. This is explained on the Packages wiki page.

Once you have this, you then have, Device Data. Think of this as a place to store configuration for a device. These fields are arbitrary, and are used by different parts of the system at different times by database queries. These are parameters, and states, some of them can be changed by user, some should be hard set, etc.

You then have a set of commands that the device can respond to. This only makes sense if you're making a DCE device to wrap things and want to send commands to it.

This brings me to another point, some device templates are not DCE devices, but are indeed places to store information in templates. Sometimes our scripts check for the presence of certain devices, and do things based on it. Such templates also have pointers to various scripts to set things up when needed.

You then have events that the device can emit to the system. Again, for the DCE devices.

After this, you have the PNP subsystem, this basically allows you to put records in the database that the Plug and Play Plugin will match. In the case of bluetooth devices, plug and play events come from the Bluetooth Dongle, and match fields in this area. The relevant info is the MAC address field. If you put 0 and 0 in the from to, it will match all MAC addresses like our other bluetooth devices, and you'll have to explicitly select WiiMote from the device list like with other phones.. if you KNOW that there is a range for a particular device, you can limit it to those devices, and get a simpler screen....

also keep in mind there are other device data parameters that will cause the PNP screens not to appear, look at the bluetooth dongle device template. If you can determine enough data, configuration screens will not appear.

-Thom