Welcome! Log In Create A New Profile Wiibrew Wiki HackMii Blog

Advanced

Use android device as remote for the WII

Posted by rikmer 
Use android device as remote for the WII
September 11, 2010 05:59PM
Hi,

I am relatively new to this but is there an existing library which allows connecting other Bluetooth devices to the WII? I am asking this because if there is a possibility to do that I probably will begin looking into using an android device for input to the WII. The only sensor on most android devices that is missing compared to a WII remote is the IR sensor. So in principal it would be possible to develop an app which emulates a WII remote.

BR
Re: Use android device as remote for the WII
September 12, 2010 12:43AM
I'm no expert, but I believe messing with the bluetooth is dangerous to the wii. I'd wait for someone smarter to give you some input, but to me, the whole thing doesn't seem worth it.



Edited 1 time(s). Last edit at 09/12/2010 04:56AM by bigmac909.
Re: Use android device as remote for the WII
September 12, 2010 03:35AM
in theory- genuis
in life- not so much
wii and blue tooth dont mix together to many glicthes/and or problems with phone/wii would null and void your phone warranty so pleaze dont try it any one (reffence from modding my previous andriod phone )
Re: Use android device as remote for the WII
September 12, 2010 04:12AM
Quote:
bob123456
in theory- genuis
in life- not so much
wii and blue tooth dont mix together to many glicthes/and or problems with phone/wii would null and void your phone warranty so pleaze dont try it any one (reffence from modding my previous andriod phone )

Well not really the wiimote and wii are bluetoothed, I don't remember which way it is, but either the remote sends to wii or vice versa. I just don't think it could really happen cause one or the other would have to have either same type or bluetooth softwares, or innner workings to communicate with each other. But it might be able to work if some hard long research was done, but in the end I don't it would work that well.
Re: Use android device as remote for the WII
September 12, 2010 05:41PM
No real answer so far.

Bluetooth connection is available between any bluetooth enabled devices, only the right driver needs to be made.

Bluetooth is a hardware technology for devices communication, which relies on high frequency, short range, radio signals. It is full-duplex, which means that communication can always go in both ways, and it must necessarily be implemented in both communicating devices. Hence, bluetooth transmiter-receiver exist in both Wii console and Wiimotes. The proof of it is the rumble in the controllers which is a feedback communication sent to the Wiimote.

I have read some time ago some articles about some guy who successfully connected a Wiimote to his computer via bluetooth, however, it might be more difficult to connect a bluetooth device with the Wii console. It might be achieved by low-level programming on the Wii console. Either that, or programming an application on the Android which fakes the device ID from the Wiimotes, making the Wii believe that it is a Wiimote. I don't own nor have had any experience with Android phones, so I don't know how possible that is.

This is an interesting project indeed, but I'd advice to take some previous step to this, such as first connecting a PC successfully to a Wii via Bluetooth. Or researching on how a Wiimote can be connected to a PC through it.
Re: Use android device as remote for the WII
September 12, 2010 08:55PM
I've been researching this topic for about a month now. The biggest hurdle I'm currently trying to overcome is the fact that I can not trick the Wii into connecting to my Android phone. I changed my bluetooth device name to "Nintendo RVL-CNT-01" and opened what I think are the correct sockets that listen for incoming connections. I then make my phone discoverable and press the sync button on the Wii. Nothing. I've also tried the reconnect option in the Wii home menu. But the Wii will not take the bait. The connection process has to involve more than scanning for devices named "Nintendo RVL-CNT-01". It could either be a device class issue, or a pin issue...
Re: Use android device as remote for the WII
September 12, 2010 11:59PM
Quote:
Greg
I've been researching this topic for about a month now. The biggest hurdle I'm currently trying to overcome is the fact that I can not trick the Wii into connecting to my Android phone. I changed my bluetooth device name to "Nintendo RVL-CNT-01" and opened what I think are the correct sockets that listen for incoming connections. I then make my phone discoverable and press the sync button on the Wii. Nothing. I've also tried the reconnect option in the Wii home menu. But the Wii will not take the bait. The connection process has to involve more than scanning for devices named "Nintendo RVL-CNT-01". It could either be a device class issue, or a pin issue...

Very interesting. Is there any way I could help you? Please let me know every news you got.
Re: Use android device as remote for the WII
September 13, 2010 05:06PM
Quote:
rikmer
Very interesting. Is there any way I could help you? Please let me know every news you got.

Without knowing what the Wii is looking for when discovering devices, its going to be tough to simulate a remote. For all I know the Wii will only connect to devices with a very specific bluetooth chip. If I could only get the Wii to initiate the connection, then I think it would be no problem. So I guess that's what I need help with. :)
Re: Use android device as remote for the WII
September 13, 2010 05:50PM
Quote:
Greg


Without knowing what the Wii is looking for when discovering devices, its going to be tough to simulate a remote. For all I know the Wii will only connect to devices with a very specific bluetooth chip. If I could only get the Wii to initiate the connection, then I think it would be no problem. So I guess that's what I need help with. :)

Have you tried to use hcidump from the bluez project. I found a reference to that in the homebrew wiki ( http://wiibrew.org/wiki/Wiimote/Library ) under requests. But as it is still a request, perhaps it is not that easy to do so. I also will try to analyse the data which the wiimote is sending while connecting. I will tell you my results if I get some interesting information.
Re: Use android device as remote for the WII
September 13, 2010 07:26PM
Quote:
rikmer
Have you tried to use hcidump from the bluez project. I found a reference to that in the homebrew wiki ( http://wiibrew.org/wiki/Wiimote/Library ) under requests. But as it is still a request, perhaps it is not that easy to do so. I also will try to analyse the data which the wiimote is sending while connecting. I will tell you my results if I get some interesting information.

No, I haven't tried that. However, I have successfully connected to the Wii remote from an Android phone and the first packet of data it sends is:

a1 30 0 0

which is a simple data report indicating no buttons are pressed. So my plan was to do the same thing as soon as the Wii connected to my phone. But the problem is, the Wii never attempts to connect to my server sockets that are blocking waiting for the connection. So even if I knew what data to send, which I believe I do, I can't.
Re: Use android device as remote for the WII
September 18, 2010 03:50PM
I think I know what's wrong. Before the Wii connects to the remote, it uses SDP to determine the services provided by the device. So, even though I've opened up both L2CAP sockets to listen for connections, I am not updating my phone's SD database with the appropriate info. The Android API (even the private API) does not support adding L2CAP entries to SD. I'm thinking the only way to do this would be to interact with bluez at a much lower level. Still looking...
Re: Use android device as remote for the WII
September 19, 2010 12:47PM
I found something on http://wiki.wiimoteproject.com. I dont know if this will help but ...

Name Nintendo RVL-CNT-01
Vendor ID 0x057e
Product ID 0x0306

this is what the wiimote is sending.
Also this http://wiki.wiimoteproject.com/Bluetooth_Specs could be helpful. I will try some things and report if anything new evolves.
Re: Use android device as remote for the WII
September 19, 2010 02:19PM
One other question ... How do you test? Did you write an experimental app for android? Or do use an emulator? Or do you try to connect through linux, windows or mac? If you have some basic code I really like to look into it. Hopefully you or we will manage to connect to the WII. It would be awesome.
Re: Use android device as remote for the WII
September 19, 2010 03:40PM
Quote:
Greg
I think I know what's wrong. Before the Wii connects to the remote, it uses SDP to determine the services provided by the device. So, even though I've opened up both L2CAP sockets to listen for connections, I am not updating my phone's SD database with the appropriate info. The Android API (even the private API) does not support adding L2CAP entries to SD. I'm thinking the only way to do this would be to interact with bluez at a much lower level. Still looking...

Perhaps I am completely wrong but wouldnt it be possible to add services manually with sdptools when rooted.
Re: Use android device as remote for the WII
September 19, 2010 07:37PM
Quote:
rikmer
Perhaps I am completely wrong but wouldnt it be possible to add services manually with sdptools when rooted.

That is certainly an option. I was hoping to a find a back door that did not require being rooted. But I'm out of ideas. I've run a couple tests and I am able to execute sdptool as root. Now to figure out just the right commands to add a record with all the attributes that the Wii requires to be present. Sounds like a fun trial and error process!
Re: Use android device as remote for the WII
September 20, 2010 03:06AM
Hmm, didn't notice these other posts until just now...

Quote:
rikmer
I found something on http://wiki.wiimoteproject.com. I dont know if this will help but ...

Name Nintendo RVL-CNT-01
Vendor ID 0x057e
Product ID 0x0306

this is what the wiimote is sending.
Also this http://wiki.wiimoteproject.com/Bluetooth_Specs could be helpful. I will try some things and report if anything new evolves.

I have changed my device name to Nintendo RVL-CNT-01. As far as the other values, I don't know how to set those on my device. I'm not even sure if they can be changed.

Quote:
rikmer
One other question ... How do you test? Did you write an experimental app for android? Or do use an emulator? Or do you try to connect through linux, windows or mac? If you have some basic code I really like to look into it. Hopefully you or we will manage to connect to the WII. It would be awesome.

I'm testing using a very simple experimental app on my rooted Moto Droid. The emulator won't work because it does not support Bluetooth. The app I wrote is not very polished and has zero error checking. It basically just opens up the ports and listens. My first step is to just see if the connection gets established, which it's not. I figure...why go any further if I can't even make the connection happen.
Re: Use android device as remote for the WII
September 20, 2010 03:10AM
This is so funny. When executing the sdptool command in a terminal emulator, the help page says you can add a WIIMOTE service to the database. So I tried this command:

sdptool add WIIMOTE

And it registered my phone as a Nintendo RVL-CNT-01 with all the attributes that a real remote advertises!

However, the Wii still will not connect! :( So frustrating!
Re: Use android device as remote for the WII
September 20, 2010 02:38PM
Quote:
Greg


I have changed my device name to Nintendo RVL-CNT-01. As far as the other values, I don't know how to set those on my device. I'm not even sure if they can be changed.

I'm testing using a very simple experimental app on my rooted Moto Droid. The emulator won't work because it does not support Bluetooth. The app I wrote is not very polished and has zero error checking. It basically just opens up the ports and listens. My first step is to just see if the connection gets established, which it's not. I figure...why go any further if I can't even make the connection happen.

As far as I know you can change the DeviceID which consists of the VID and PID in the main.conf of the bluetooth settings under /system/etc/bluetooth .

Could you provide your experimental code?

I also managed to add the service but when I compare the wiimote services to the phone services ...

Service RecHandle: 0x0
Service Class ID List:
"SDP Server" (0x1000)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 1
"SDP" (0x0001)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x0100)
Version: 0x0100

... is missing.



Edited 3 time(s). Last edit at 09/20/2010 02:57PM by rikmer.
Re: Use android device as remote for the WII
September 20, 2010 04:23PM
Maybe it is time to move this thread to a more appropriate forum such as Coding.

This definitely does not belong to Getting Started anymore :)
Re: Use android device as remote for the WII
September 20, 2010 04:28PM
Quote:
rikmer
As far as I know you can change the DeviceID which consists of the VID and PID in the main.conf of the bluetooth settings under /system/etc/bluetooth .

Oh man, that would be horrible if you had to do that to make it work. It would kill any chances of your app being successful in the Android Market. Who would want to do that to their phone? Requiring root is bad enough...but needing to edit system config files...

Quote:
rikmer
Could you provide your experimental code?

Sure. I might not have a lot of time during the week, but I'll try to get to it.

Quote:
rikmer
I also managed to add the service but when I compare the wiimote services to the phone services ...

Service RecHandle: 0x0
Service Class ID List:
"SDP Server" (0x1000)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 1
"SDP" (0x0001)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x0100)
Version: 0x0100

... is missing.

I think this is just the entry for the SDP server. Can't imagine this block would be required by the Wii. Actually, this entry is there, you just have to ask for it specifically:

sdptool get 0

When you queried the phone, were you doing so locally or from another device? Maybe when you're querying locally it doesn't show you the SDP server? But you will see it when querying from another device?

Another thing I didn't try, when I added the WIIMOTE service, it added it as 0x10007. Maybe I should have forced it to match the remote's handle for the same service.

And if that doesn't work, I'll remove all the other services 0x10001 - 0x10006. They show back up again after you turn off/on bluetooth.
Sorry, only registered users may post in this forum.

Click here to login