Welcome! Log In Create A New Profile

Advanced

Motion Plus and Wiiuse

Posted by Haichao 
Motion Plus and Wiiuse
September 08, 2009 11:06AM
Hello,

is there someone who has already added motion plus support to the wiiuse library?

I tried myself and now my wiimote does not send any analog (accelerometer) values anymore, after i did some tryouts under linux. The weird thing is that the wiimote sends these values using other libraries and even with wiiuse running in windows, but under linux (ubuntu 9.04) it will not work, even with the original wiiuse...it seems not to be broken but it seems to "remember" what i did to it under linux with wiiuse and resetting it did not help, very weird :(

So before i waste another wiimote, is there anyone who already added motion plus support to the wiiuse library?
Re: Motion Plus and Wiiuse
September 09, 2009 03:08AM
Yes it's in libogc SVN
Re: Motion Plus and Wiiuse
September 09, 2009 03:41AM
It would be cool if someone added motion plus to this demo code.

[wiibrew.org]
Re: Motion Plus and Wiiuse
September 09, 2009 05:36PM
Finally, i got the right sequence in order to activate the motion plus in wiiuse.

The sequence would be:

First use wiiuse_write_data to write 0x55 to 0x4a600f0 in order to initialize motion plus
Second use wiiuse_write_data to write 0x04 to 0x04a600fe in order to enable motion plus.

Now what remains is to get the other extensions to work if plugged in to motion plus, as now motion plus is activated but the extensions do not work. Someone has an idea how to solve this?
Re: Motion Plus and Wiiuse
September 09, 2009 08:30PM
Eh? Check out devkitpro svn on sourceforge. It's already been done.
Re: Motion Plus and Wiiuse
September 10, 2009 09:35PM
Sorry for interrupting the discussion but,

I tested the motion plus patch with the below code but it doesn't seem to work... Code executes just fine but exp structure returns 0, also rx, ry, rz values read 0, however call to WPAD_SetMotionPlus succeeds...

wiimote init part works, I know that because I read the acceleration values in the rest of the program and they reflect the status of accelerometers fine...

Here is the code block :

bool initMotionPlus(s32 wiimote) 
{
	expansion_t exp;
	
	s32 result = WPAD_SetMotionPlus(wiimote, 1);

	if (result == WPAD_ERR_NONE) 
	{
		printf("\nMotion plus is set\n");
		WPAD_Expansion(wiimote, &exp); 
	
		if (exp.type == EXP_MOTION_PLUS) 
		{
			printf("YESS!");
			return true;
		} else 
		{
			printf("NOPEZ! %x", exp.type);
			return false;
		}
		
	} else {
		printf("\nError setting motion plus %d\n", result);
		return false;
	}
	
}

...excerpt from main...

WPAD_Init();
WPAD_SetDataFormat(0,WPAD_FMT_BTNS_ACC);
int retries = 5;
while (!initMotionPlus(WPAD_CHAN_0) && retries--) 
{
  sleep(1);
} 

sleep(1);
WPAD_ScanPads();	
WPADData * wp = WPAD_Data(0);
exp = wp->exp;
printf("\nRX>>%d", exp.mp.rx);
usleep(500);

WPAD_ScanPads();	
wp = WPAD_Data(0);
exp = wp->exp;
printf("\nRX>>%d", exp.mp.rx);

Re: Motion Plus and Wiiuse
September 14, 2009 04:12AM
Hi,

Concerning the use of other extensions through the WMP, I have found very interesting stuff in this thread (they are hacking directly the WMP and the NC with an aduino) :
[www.arduino.cc]

Here is my explanation of how it works (based on the fantastic work of people in the previously mentioned thread) :
[www.assembla.com]

I've tried it with a NunChuck and it seems to run smoothly.

Regards.
Xevel
Re: Motion Plus and Wiiuse
September 30, 2009 04:21AM
well , I have been work out many problems of WMP ,if anyone needs help, you can email me, yes24@126.com

I found WMP has a encrypt option at 50h,60h,70h,80h,Maybe some would meet this problem.


And does anyone konw how does MP's 20h,30h work?
Re: Motion Plus and Wiiuse
October 01, 2009 07:45AM
So, what is the correct way of initializing the MotionPlus extension? I had first similar problems to I.R.on above, but after playing around a bit I got readings from the extension - in not so pretty way:

// in main loop
if(!mpConnected)
{	
	sleep(2);
	WPAD_SetMotionPlus(0, 1);
} 

WPAD_Expansion(0, &exp); 
if (exp.type == EXP_MOTION_PLUS) 
	mpConnected = true;
else
	mpConnected = false;

Without sleep() the MotionPlus doesn't seem to get initialized... So obviously some waiting is needed? Doing it like this succeeds after the second WPAD_SetMotionPlus() call. In any case, any pointers to a better initialization routine are highly welcome. Thanks!



Edited 2 time(s). Last edit at 10/01/2009 07:46AM by melw.
Re: Motion Plus and Wiiuse
October 01, 2009 09:27AM
Quote
melw
So, what is the correct way of initializing the MotionPlus extension? I had first similar problems to I.R.on above, but after playing around a bit I got readings from the extension - in not so pretty way:

// in main loop
if(!mpConnected)
{	
	sleep(2);
	WPAD_SetMotionPlus(0, 1);
} 

WPAD_Expansion(0, &exp); 
if (exp.type == EXP_MOTION_PLUS) 
	mpConnected = true;
else
	mpConnected = false;

Without sleep() the MotionPlus doesn't seem to get initialized... So obviously some waiting is needed? Doing it like this succeeds after the second WPAD_SetMotionPlus() call. In any case, any pointers to a better initialization routine are highly welcome. Thanks!

Hmm, interesting, I'm also doing sleep in between calls and call WPAD_SetMotionPlus but never been able to read data. Maybe it's ios dependent, which version of IOS 36 happens to be in your system?
Re: Motion Plus and Wiiuse
October 01, 2009 01:04PM
I.R.on: I seem to be using:
WPAD_ReadPending(WPAD_CHAN_ALL, countevs);
instead of:
WPAD_ScanPads();

Perhaps that makes the difference?

All the IOS'es I have are directly from Nintendo. Everything on the console has been installed up to System Menu 4.1 (required by WiiSports Resort).
Re: Motion Plus and Wiiuse
October 01, 2009 04:25PM
Hmm strange, WPAD_ScanPads works for reading accelerometer's values... I'll try out WPAD_ReadPending function when I get back home... thanks
Re: Motion Plus and Wiiuse
October 02, 2009 02:07PM
Unfortunately, I'm just stuck in initializiation. WPAD_Expansion never returns an expansion structure with motion plus type...

Could you post or send me a larger snippet of code?

By the way I see WPAD_ReadPending doesn't matter since WPAD_ScanPads is just

s32 WPAD_ScanPads()
{
	return WPAD_ReadPending(WPAD_CHAN_ALL, NULL);
}



Edited 1 time(s). Last edit at 10/02/2009 02:11PM by I.R.on.
Re: Motion Plus and Wiiuse
December 11, 2009 06:12PM
Has someone realise to integrate the MP in wiiuse ?
Do you have ideas about getting back the yaw degrees of it ?
Could changing the adress help me ?
Re: Motion Plus and Wiiuse
December 11, 2009 06:38PM
Oh so it's done :)
I told friend it will be possible but he was so pesimistic <_<
Now I know that I won the bet
Only thing left is to think about good idea for utilising it :)
Re: Motion Plus and Wiiuse
December 11, 2009 09:36PM
Quote
iSubaru
Only thing left is to think about good idea for utilising it :)
Online lightsaber fighting with sound FX ;)
Re: Motion Plus and Wiiuse
December 11, 2009 10:03PM
...That is GREAT idea O_O some real deal sword fighting ;] I wonder if we have enough room space we could in theory do in-game tricks similar to "Sonic and the Black Knight" :P that would be (too) great xD
OK where I put my sword this time ...
Re: Motion Plus and Wiiuse
April 28, 2010 08:18AM
so...did anyone succeed getting WMP working with wiiuse? I noticed the WiiYourself! demo supports WMP.
Re: Motion Plus and Wiiuse
April 28, 2010 04:43PM
Guess I will think of buying it for real this time...but to utilise it in programming I must find better library since MLLib seems to be deprecated...
Re: Motion Plus and Wiiuse
May 18, 2010 08:55AM
I found that fWIIne uses a customized version of wiiuse with support for WM+.
However it just returns the measured angular velocities. Does anyone know of work to normalize these values to improve the wiimote angles?
Sorry, only registered users may post in this forum.

Click here to login