Welcome! Log In Create A New Profile

Advanced

Use android device as remote for the WII

Posted by rikmer 
Re: Use android device as remote for the WII
April 16, 2011 11:02PM
Nice!!! That is some awesome detective work rikmer! But these kernels are device specific correct? When you say "mainline kernel", do you mean for the Desire? Or for stock Android? I'm not very familiar with all this really low level OS stuff. I guess I'm just trying to figure out what to do with this new info. Do I need to find someone who can compile me a custom Droid kernel?
Re: Use android device as remote for the WII
April 16, 2011 11:08PM
Great news :-)
I'm reinstalling Ubuntu at the moment to get it work on the Blade.

Edit: Greg, you need either someone who can do this for you or a Linux distribution, some time to download the kernel source and little skills in using a command line.



Edited 1 time(s). Last edit at 04/16/2011 11:11PM by FelixL.
Re: Use android device as remote for the WII
April 16, 2011 11:15PM
Quote
Greg
Nice!!! That is some awesome detective work rikmer! But these kernels are device specific correct? When you say "mainline kernel", do you mean for the Desire? Or for stock Android? I'm not very familiar with all this really low level OS stuff. I guess I'm just trying to figure out what to do with this new info. Do I need to find someone who can compile me a custom Droid kernel?

It is the mainline android stock kernel.Unfortunately it means that you have to find somebody who compiles you a custom kernel. But there should be some guys at xda-developers who could provide you with one. I am communicating with thalamus_ at the moment because he found out that the main problem really is in the bluez stack. What we can do about this issue I don't know right now. I will post infos as I get them.

EDIT: It does not depend where the kernel comes from but it is device and rom specific.
@Greg: At least you would need a rooted Droid and modified kernel appropriate to the used rom.
@FelixL: Looking forward to know if this modification also works on the Blade (it should).



Edited 2 time(s). Last edit at 04/16/2011 11:53PM by rikmer.
Re: Use android device as remote for the WII
April 18, 2011 02:27PM
Just for the info: Test App also works on HTC Desire with Android 2.2 Stock Sense.

Also found something in the bluez stack which could be the problem. It is in btio.c in function l2cap_bind(). In Android stock bluez implementaion it reads:

static int l2cap_bind(int sock, const bdaddr_t *src, uint16_t psm, GError **err)
255 {
256 struct sockaddr_l2 addr;
257
258 memset(&addr, 0, sizeof(addr));
259 addr.l2_family = AF_BLUETOOTH;
260 bacpy(&addr.l2_bdaddr, src);
261 addr.l2_psm = htobs(psm);
262
263 if (bind(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
264 ERROR_FAILED(err, "l2cap_bind", errno);
265 return -1;
266 }
267
268 return 0;
269 }

and in HTC Desire bluez:

static int l2cap_bind(int sock, const bdaddr_t *src, uint16_t psm)
{
struct sockaddr_l2 addr;

memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
bacpy(&addr.l2_bdaddr, src);
addr.l2_psm = htobs(psm);

return bind(sock, (struct sockaddr *) &addr, sizeof(addr));
}

I have communicated my findings to thalamus_ and am waiting for his opinion.

The thing is that even if this is the problem that it will depend on the mobile producer if it is implemented. So the easier way will always be through the kernel because this part is much more comfortable to exchange, if the mobile is rooted.

The chance that Google will change this part is, I suppose, rather small. But I could be wrong. At least we should try to contact them an tell them about.

Before anything we have to wait if the this change will produce the wanted behavior.



Edited 1 time(s). Last edit at 04/18/2011 03:21PM by rikmer.
Re: Use android device as remote for the WII
May 13, 2011 10:35PM
Anything new?
I have tried to compile the kernel for the Blade, but didn't work, CM7 was no problem to compile, but has a prebuilt kernel. I will ask some guy from the UK for help this weekend.
Re: Use android device as remote for the WII
May 14, 2011 01:40AM
Not much new on this end. I tried the test app on my Xoom, didn't work there either. Not a surprise.
Re: Use android device as remote for the WII
May 14, 2011 01:56PM
Did you update your Xoom to 3.1 yet? And did you read my email concerning the source-code off the test app?
Thanks!
Re: Use android device as remote for the WII
May 25, 2011 08:36PM
Hi,

I tried to open the L2CAP Server Socket with Reflections. (I have HTC Desire) :

Class ss_class = Class.forName("android.bluetooth.BluetoothServerSocket");

Constructor ss_constructor = ss_class.getDeclaredConstructor(int.class, boolean.class, boolean.class, int.class);

ss_constructor.setAccessible(true);

BluetoothServerSocket serverSocket = (BluetoothServerSocket) ss_constructor.newInstance(3, false, false, 12);

Log.v(TAG, "ServerSocket is null: " + (serverSocket != null));

while(running){

BluetoothSocket socket = serverSocket.accept();
}

...

Howerver, bindListen doesn't throw the acception, but serverSocket.accept() does....

Somehting more, as I was browsing the bluez code I saw this thing:

if (type == BT_IO_L2RAW) {
g_set_error(err, BT_IO_ERROR, BT_IO_ERROR_INVALID_ARGS,
"Server L2CAP RAW sockets not supported");
return NULL;
}

in ../external/bluetooth/bluez/src/btio.c : Line 1264

So, Greg, are you sure you opened the L2Cap ServerSocket !?!!?
Re: Use android device as remote for the WII
May 31, 2011 08:33PM
Well, I created the socket and attempted to call bindListen(), that's as far as I ever get before an exception gets thrown. That brings up an interesting point though...if we do get bindListen() to work without throwing an error, the next problem we may encounter is calling accept().
Re: Use android device as remote for the WII
June 16, 2011 12:24AM
Hey Greg! Any new infos regarding the project. Always looking forward to help out.
Re: Use android device as remote for the WII
September 01, 2011 03:10AM
nope, nothing new. :) I was thinking about installing Linux and compiling me a custom Cyanogenmod kernel. no time right now, maybe when it gets colder. can't wait to pick things up again. don't worry rikmer, I know where to find you!
Re: Use android device as remote for the WII
September 01, 2011 07:56AM
I hope that IceCreamSandwich makes things easier :/

But great to hear that you guys are not going to give up!
Re: Use android device as remote for the WII
November 13, 2011 06:33AM
Is there an .apk that I can work with?
Re: Use android device as remote for the WII
February 20, 2012 05:25AM
For those keeping score, IceCreamSandwich did not improve the Bluetooth API. I've also tried the Bluetooth reflection hack on both my Xoom (4.0.3) and Galaxy Nexus (4.0.4). No luck. Here's looking forward to JellyBean! Or CM9 perhaps?

technologiclee - I did create an .apk, but it only tests a device to see if the Bluetooth reflection hack works on it.
Re: Use android device as remote for the WII
May 03, 2012 04:32AM
The real question is, why would you want to? Unless your plan is to use it like a faux Wii U, I don't see any point to it.
Re: Use android device as remote for the WII
May 03, 2012 05:37PM
Quote
sl1ck
The real question is, why would you want to? Unless your plan is to use it like a faux Wii U, I don't see any point to it.

Well clearly these people do seeing as this topic is four pages long, which is quite lengthy for this forum. No one would force you to use it, you don't need to express an opinion on every thread you read.
Re: Use android device as remote for the WII
July 28, 2012 06:14AM
Quote
sl1ck
The real question is, why would you want to? Unless your plan is to use it like a faux Wii U, I don't see any point to it.

This stuff is great for parties, especially for nerd gamer, moneyless college students like myself. Imagine if people didn't have to bring extra controllers, so long as they had a (like most everyone) smartphone.

If you guys get this working, hunt me down please, as I would love to get a few tricks working in here that would let the Android device have more complete Wiimote functionality.
Re: Use android device as remote for the WII
July 28, 2012 01:41PM
Hi all,

If you're interested, here is my work I've done one year ago. The aim was to connect a Wii Balance Board to an Android device in order to display your weight. I didn't have time do finish it, and I had no more motivation since it didn't work on Samsung an HTC ROMs. Actually it works on all devices using a custom ROM based on Google stock ROM, like CyanogenMod. But on the Android Market, the main users don't use such custom ROMS.

The fact is I access to the bluetooth library throught the linux kernel, using Android NDK to make a dll linked to libbluetooth.so. This libray is modified on Samsung and HTC ROMs and it doesn't work, but I developped it on a HTC Hero with a CynogenMod ROM and it works.

This was my first project on Android, so the code might not be good at all and I didn't return on it since I abandoned. Maybe it doesn't even compile...

The code to understand is in jni\androidWiiBridge.c interfacing with WiiUse library [sourceforge.net]

and src\com\droidprod\wiiweight\WiiboardManager.java to have a Java API.

It can work with Wiimote, you just need to adapt the code.

I hope it can help.

Johan

Mirrors:
[s02.worldupload.net]
[www.fichier-zip.com]
[depositfiles.com]
Re: Use android device as remote for the WII
December 29, 2012 06:34AM
Hi,

Did anyone had success connecting to a Wii console using a PC? (Instead of an android device.)
Did anyone check if it's possible to connect with the Jelly Bean?

I wrote two programs trying to connect to the Wii, one of them is for jailbroken iDevices, the other is for PC.

The PC program starts by deleting all other SDP entries, and puts the Wiimote entries, it clones the output
of "sdptool browse" and "sdp records --tree" nearly perfectly, the only thing it misses is a sdp record with handle 0x00
(I guess the SDP's server own sdp record), since it's a special handle, and I couldn't add it like the others...
Despite cloning bluetooth sdp record so good, the Wii still fails to connect... =/

Both programs are a bridge between an UDP connection for Dolphin Wii emulator (http://forums.dolphin-emu.org/Thread-patch-udpwii-use-iphone-as-wiimote-new-nunchuck-and-ir-support) and the bluetooth connection for the real Wii. They can already connect to the Dolphin emulator faking a real wiimote (i.e., through bluetooth, and not UDP).

If anyone manages to connect a Wii to a PC, please let me know, I would love to see an android device controlling a Wii, even if a PC is necessary as a proxy. As I said, I already have a program that implements the protocol, all I need is to make the initial connection.

I developed an Android application working with UDP, using Dolphin:
Screenshot: [dl.dropbox.com]
APK: [dl.dropbox.com]
Re: Use android device as remote for the WII
February 05, 2013 01:39PM
hey u guys if u use an alcatlel v455 it will work and maybe some other phones and the wii remote sends info to the wii and the wii sends info to the wii remote so you can use a phone but not an android



Edited 1 time(s). Last edit at 02/05/2013 01:40PM by zakmiah984.
Sorry, only registered users may post in this forum.

Click here to login