kirosrdz / android-bluez-ime

Automatically exported from code.google.com/p/android-bluez-ime
0 stars 0 forks source link

Support the Wii-mote #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If possible, the Wii-mote should be supported as well.

Original issue reported on code.google.com by kenneth@hexad.dk on 30 Jan 2011 at 9:37

GoogleCodeExporter commented 8 years ago
I am definitely interested in this :) but try the wii classic controller 
because it has more buttons and would be more applicable to most emulators. 
Great app regardless.

Original comment by philipbyrdjr@gmail.com on 30 Jan 2011 at 7:05

GoogleCodeExporter commented 8 years ago
I would also be highly keen for this to work too, bought a Datel wii retro 
wireless gamepad thinking it would work on my galaxy s and have been hunting 
the internet for weeks for something that will make it work.
Thanks

Original comment by foxcade...@gmail.com on 8 Feb 2011 at 10:24

GoogleCodeExporter commented 8 years ago
Any updates or progress? I've read many places that a wii remote (or classic 
one) will not work on most HTC devices unless you root and install a custom 
rom/kernal. But many have also said that the EVO can't have full HDMI mirroring 
and yet that is happening (and should be finished soon!). Thanks again.

Original comment by philipbyrdjr@gmail.com on 12 Feb 2011 at 10:38

GoogleCodeExporter commented 8 years ago
Sorry, I'm quite swamped with work atm, but I might get a quick try tomorrow.

Original comment by kenneth@hexad.dk on 12 Feb 2011 at 10:40

GoogleCodeExporter commented 8 years ago
I just had a quick look at it, and it does not seem easy to get working:
http://mtrr.org/blog/?p=81

According to this, the device uses the HID layer to communicate, which is not 
supported on Android < 2.3 and does not seem to be supported on my custom 2.3.1 
rom either.

Original comment by kenneth@hexad.dk on 13 Feb 2011 at 1:53

GoogleCodeExporter commented 8 years ago
I have looked into it some more, and it is not feasible in any sane way. The 
(first) problem is that the Bluetooth implementation on Android assumes that 
all devices must be paired with a pincode or other. The Wiimote connects 
without any passcode, thus the entire connection fails.

I have looked at the other apps that supports Wiimote, and they basically ship 
their app with a binary component that appears to talk directly to the hardware 
(or at least some kernel functions). This may be possible to replicate, but is 
likely to only work for a subset of the handsets, and particularly the HTC 
models seems to have trouble working this way. And my only test device is a HTC 
(rooted with custom FW).

In short: I won't be able to support this anytime soon, but I will gladly 
provide info to anyone who knows this stuff better than me.

Original comment by kenneth@hexad.dk on 4 Mar 2011 at 8:03

GoogleCodeExporter commented 8 years ago
Wii remote classic controller please :-) 

Original comment by joshhe...@gmail.com on 20 Mar 2011 at 2:22

GoogleCodeExporter commented 8 years ago
Same issue here on sgs see issue 32. Am willing to to wtry beta and work with 
develepors.

Original comment by jonathan...@gmail.com on 12 Apr 2011 at 8:45

GoogleCodeExporter commented 8 years ago
Issue 32 has been merged into this issue.

Original comment by kenneth@hexad.dk on 13 Apr 2011 at 1:25

GoogleCodeExporter commented 8 years ago
my understanding is the wiimote can be connected to unpaired, or paired using a 
pin that's the reverse of the BT mac address of wiimote or host (depending on 
how wiimote pairing was initiated).  I've not seen how to programmatically 
issue your own pin under android, assuming you need to get underneath the 
framework level.

Original comment by daveby...@gmail.com on 15 Apr 2011 at 3:03

GoogleCodeExporter commented 8 years ago
AFAIK, there is no way to use the Android API to set the PIN or pair a device.

I am working on using some internals such as dbus/hidd/hcitool etc. to 
establish the connection, but there is not a lot of Android documentation at 
this level, so it is mostly slow and painfull trial-n-error :).

Original comment by kenneth@hexad.dk on 15 Apr 2011 at 6:46

GoogleCodeExporter commented 8 years ago
Good news on this issue, I have now successfully connected to a WiiMote, 
without using any binary libraries or other tricks. The remaining work is 
fixing up the data to send the right key presses.

I can read the accelerometer as well as buttons. I *think* I can get the 
Classic Controller to work based on the documentation, but I do not have one 
for testing, so it is mostly qualified guessing.

Original comment by kenneth@hexad.dk on 11 May 2011 at 10:20

GoogleCodeExporter commented 8 years ago
Great news but will this include my HTC Evo too? I don't have my hopes up so 
don't worry lol

Original comment by philipbyrdjr@gmail.com on 11 May 2011 at 10:25

GoogleCodeExporter commented 8 years ago
I have a classic controller, I would be happy to help test. I have a Samsung 
Captivate which has been known to not work with other Wiimote apps due to 
Samsung's bluetooth stack. But if it works with this app I can help test.

Original comment by superblo...@gmail.com on 11 May 2011 at 10:29

GoogleCodeExporter commented 8 years ago
Attached is a fresh build with Wiimote support.

I assume it works on any Bluetooth enabled Android device (it works on my HTC 
desire), but please try it and let me know.

I have tested it as much as I could, and found no problems. I also tested it 
with the Nunchuck and that works too. The attached build will produce a lot of 
debugging output, which can help me diagnose any issues, but may cause it to 
run a little slower.

Since I do not have the Classic Controller, I have implemented it based on 
whatever documentation I could find. I most likely made some mistakes, such as 
swap left/right, mixed up buttons, wrong reading of the thumbsticks, etc.

If you try this out, and find that something is not working correctly, please 
let me know. If possible, please also include a logcat dump.

If any developers are trying this out, it is possible to activate the 
accelerometers as well, but they flood the Bluetooth channel with data, so they 
are deactivated by default.

Original comment by kenneth@hexad.dk on 14 May 2011 at 12:10

Attachments:

GoogleCodeExporter commented 8 years ago
Hi, thanks for the update. Unfortunately the new build doesn't work with my HTC 
Desire HD. When I run it I receive the message: "Unknown error: 0". I've 
attached a logcat output.

Original comment by Matt.Lov...@gmail.com on 14 May 2011 at 12:48

Attachments:

GoogleCodeExporter commented 8 years ago
That is a weird message "out of wsock blocks", the only thing I can find on 
google about it is some chinese forum message, but there is no solution.

Could you try to reboot the device and then start logcat before connecting, to 
see if the wsock errors occur on first connection attempt?

Original comment by kenneth@hexad.dk on 14 May 2011 at 1:20

GoogleCodeExporter commented 8 years ago
Done.

Original comment by Matt.Lov...@gmail.com on 14 May 2011 at 1:38

Attachments:

GoogleCodeExporter commented 8 years ago
I'm guessing you have a Samsung device:
http://forum.xda-developers.com/showthread.php?p=13701143

The error message is "ERROR : blz20_wrp_close: protocol BTPROTO_L2CAP not yet 
supported", meaning that the binary stuff underneath does not support the L2CAP 
connection which is used by the Wiimote Driver.

Unfortunately this means that it will not work on all devices, as I had hoped. 
I don't see any way to fix without putting a custom ROM on the device.

Original comment by kenneth@hexad.dk on 14 May 2011 at 1:53

GoogleCodeExporter commented 8 years ago
My phone is actually a HTC Desire HD, so it's strange how it works for your HTC 
Desire, but not my HTC Desire HD. Thanks anyway trying.

Original comment by Matt.Lov...@gmail.com on 14 May 2011 at 1:59

GoogleCodeExporter commented 8 years ago
Wiimote fails on my HTC Thunderbolt. Reads as "Unknown Error: 0" What exactly 
is logcat and does it work on unrooted devices? Just tried your 1.6 build 
listed. I anticipate a working version. I greatly appreciate your steps in 
trying to get unsupported devices support for Human Interface devices.

Original comment by ExtremeY...@gmail.com on 14 May 2011 at 5:08

GoogleCodeExporter commented 8 years ago
I figured out what logcat is. I attached a log. Here you go.

Original comment by ExtremeY...@gmail.com on 14 May 2011 at 9:42

Attachments:

GoogleCodeExporter commented 8 years ago
@Matt: I use a custom ROM (Oxygen) with Android 2.3.3, so that is probably why 
it works on mine.

@ExtremeY: You have the same problem as Matt "blz20_wrp_close: protocol 
BTPROTO_L2CAP not yet supported"

I assume that you are both on an Android version less than 2.3. I will look 
into the source for Android to see if I can identify the changes that made this 
work, and then determine if I can backport them somehow. But given that others 
have failed before me, I fear that it is not possible to do in user-space (i.e. 
you need a new ROM).

Original comment by kenneth@hexad.dk on 15 May 2011 at 11:57

GoogleCodeExporter commented 8 years ago
Well. I am not exactly willing to root over something as trivial as wiimote 
support. It isn't a necessity. I'll wait until 2.3 is released for my phone and 
then see what happens. Thanks.

Original comment by ExtremeY...@gmail.com on 15 May 2011 at 2:37

GoogleCodeExporter commented 8 years ago
GREAT WORK!

just so you have the data, this works on stock Xoom latest OTA update.  which 
one could infer means it'll work on most every HC tablet...

however... the nunchuk doesn't do anything right now.  I assume that's just an 
oversight, a couple of hours of further enhancement to the code.

And yeah, I'd love to find a way to push accelerometer data.  At some point, 
what I want is the ability to start pushing data using the new NativeActivity 
input support, so these things map as joysticks/gamepads/etc., not just 
keyboard keys. :)

Original comment by daveby...@gmail.com on 16 May 2011 at 8:26

GoogleCodeExporter commented 8 years ago
Hooray! It works for someone other than me :)

The Nunchuck thumbstick and C+Z buttons works for me?
Do you get any logcat messages if you unplug and re-connect it?

Original comment by kenneth@hexad.dk on 16 May 2011 at 8:50

GoogleCodeExporter commented 8 years ago
Can one of you who has a non-working device try to connect to the Wiimote
 with this application while collecting logcat output:

 http://www.teksoftco.com/index.php?section=blueinputandroid

I know it will not work, but I am curious to see if they managed to get HID 
working.

If it appears to connect in some way, that means that it is actually possible. 

Original comment by kenneth@hexad.dk on 18 May 2011 at 5:03

GoogleCodeExporter commented 8 years ago
Hi everyone, I'd like to join the discussion because I'm very interested in 
getting the wiimote working.

I downloaded aLogcat and set the threshold to "Warning" and then tried to 
connect with BlueInput. Please find the log attached.

Hope this helps.

I have an HTC Flyer with Android 2.3.3 by the way.

Original comment by sHiRoKKo1337@googlemail.com on 19 May 2011 at 7:51

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, could you try again with level set to "Debug" ?
Does it appear to connect?

Also, I thought that the attached 1.6 apk would work on all 2.3 devices. Do you 
get the mentioned "L2CAP not yet supported" error on Android 2.3 ?

Original comment by kenneth@hexad.dk on 20 May 2011 at 7:49

GoogleCodeExporter commented 8 years ago
The 1.6 apk from above works for step 1, but when I select bluez IME (in step 
2) I get "ERROR: Unknown Error: 0".

The BlueInput App can discover the Controller but fails to establish a 
connection.

The attached Log contains what happened when switching from TouchInput IME to 
BluezIME and back (with Debug level this time).

Original comment by sHiRoKKo1337@googlemail.com on 20 May 2011 at 4:41

GoogleCodeExporter commented 8 years ago
No file is attached? 

Original comment by kenneth@hexad.dk on 20 May 2011 at 5:01

GoogleCodeExporter commented 8 years ago
Pardon, here it is.

Tried to upload from the Android browser but looks like I did something wrong :/

Original comment by sHiRoKKo1337@googlemail.com on 20 May 2011 at 5:29

Attachments:

GoogleCodeExporter commented 8 years ago
i tried my wiimote on htc desire cyanogenmod 7 and it works great!!! fantastic 
work!!! haven't tried nunchuk yet

Original comment by kisames...@gmail.com on 21 May 2011 at 2:10

GoogleCodeExporter commented 8 years ago
CM7 doesn't use the same bluetooth drivers as HTC Sense uses so of course it 
works the problem is Sense and Touchwiz lacking proper bluetooth support :(

Original comment by LinkofHy...@gmail.com on 23 May 2011 at 9:16

GoogleCodeExporter commented 8 years ago
Ok, I had some time to look at the log.

Did you only try it with BluezIME? 

I can see no trace of the TouchInput in the log, so if you did try that, it 
looks like TouchInput has the same problem.

Original comment by kenneth@hexad.dk on 24 May 2011 at 7:03

GoogleCodeExporter commented 8 years ago
I tried BlueInput, Wiimote controller and BluezIME. So far, all of them were 
able to discover the wii controller but unable to connect to it. The controller 
just keeps turning off because it's not connected.

"I can see no trace of the TouchInput in the log, so if you did try that, it 
looks like TouchInput has the same problem."

Not sure if I understand that correctly. TouchInput is not an app, it's the 
default input method which I must select in order to make the onscreen keyboard 
appear.

Original comment by sHiRoKKo1337@googlemail.com on 24 May 2011 at 7:33

GoogleCodeExporter commented 8 years ago
Sorry, my bad, I confused "TouchInput" with BlueInput.

Based on that log, it seems that they all attempt first the Rfcomm, and then 
the L2CAP, and neither works, so it does not look easy/possible to get working 
on Sense based devices.

Original comment by kenneth@hexad.dk on 25 May 2011 at 7:30

GoogleCodeExporter commented 8 years ago
how about TW4's like the sgs2? got the phone, the controller and bluez ime. 
then im stuck

Original comment by HampusDy...@gmail.com on 31 May 2011 at 6:30

GoogleCodeExporter commented 8 years ago
I think Samsung has the same problem as HTC, that they compile the Android 
kernel without support for L2CAP.

If it works, you should first press "Select Device", then "Scan...". Press 1+2 
down on the Wiimote and it should appear on the device list. Select it and it 
should go back to the previous screen. Now press "Select device driver" and 
choose the "Wiimote" option. Finally press "Select IME" and select "Bluez IME", 
and it should connect. If all goes well, the Wiimote will stop flashing and the 
blue "1" will stay lit. Otherwise an error message will appear on the phone. If 
the message is "Unknown Error", you can try logcat to see what the problem is, 
but most likely you will see that it states "L2CAP is not yet supported".

Original comment by kenneth@hexad.dk on 31 May 2011 at 6:53

GoogleCodeExporter commented 8 years ago
have to try it when i get home from work, i have the Datel classic retro 
controller if it makes any difference. didn't see any wiimote option in the 
device driver section by the way. 

Original comment by HampusDy...@gmail.com on 1 Jun 2011 at 6:44

GoogleCodeExporter commented 8 years ago
You need to download and install the apk attached to this issue.
I have not put it on market yet, because it does not work on all models, and I 
have not had any feedback on the classic controller support.

Original comment by kenneth@hexad.dk on 1 Jun 2011 at 6:46

GoogleCodeExporter commented 8 years ago
yupp that's exactly whats happened, do you want the log? dunno if i's to any 
help but hey here it is

Original comment by HampusDy...@gmail.com on 1 Jun 2011 at 2:15

Attachments:

GoogleCodeExporter commented 8 years ago
and here's one from blueinputandroid

Original comment by HampusDy...@gmail.com on 1 Jun 2011 at 2:19

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for those, as far as I can see, blueinputandroid does not work either 
because it hits the same " L2CAP is not supported" limitation.

Original comment by kenneth@hexad.dk on 4 Jun 2011 at 8:59

GoogleCodeExporter commented 8 years ago
from what I understand it's a kernel thing..
does this mean it can be fixed with a custom kernel?

if so, would it work with a custom kernel on a TouchWiz or Sense ROM?

would really like the Datel Retro Wireless to work on my SGSII :)

Original comment by TheW...@gmail.com on 4 Jun 2011 at 11:28

GoogleCodeExporter commented 8 years ago
Yes, that is my understanding, a custom ROM will enable L2CAP and thus this. As 
I understand it, Sense and TouchWiz are "just" homescreens + some bundled apps. 
But since HTC/Samsung own these, it may be hard to get/make a custom ROM with 
Sense/TouchWiz.

Original comment by kenneth@hexad.dk on 6 Jun 2011 at 8:59

GoogleCodeExporter commented 8 years ago
I'll get specifics for you later on, but from when I tested it, the official 
Classics Controller did not function. Oddly enough, a PS2>Classics Controller 
adapter I have that fails to register on another Wiimote IME did take button 
inputs, but the wrong physical buttons were pressing the wrong virtual buttons. 
I'll get a more exact mapping typed up to specify.

Original comment by ChicoK...@gmail.com on 11 Jun 2011 at 3:33

GoogleCodeExporter commented 8 years ago
@ChicoK: Could you post me a Logcat showing what happens when you connect the 
classic controller? Are you using the MotionPlus plugin?

Original comment by kenneth@hexad.dk on 12 Jun 2011 at 7:06

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]