Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Forum to discuss the new Dual Core Rikomagic MK802 IIIS (bluetooth) Mini PC

Moderators: KEgg, twjordo, tatubias

Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby rartino » Wed Jan 16, 2013 12:43 am

Update Jan 19: There is now a working howto! See here: http://www.dewmill.com/rikomagic.html

See below for the original post, and all the gory details on how I worked this out.
------------------------

I want to control my MK802 IIIS with the wiimote. I can't imagine why anyone who has this thing connected to their TV would NOT peruse this.

I have gotten thus far: the USB/BT Joystick center 6 with Joy2Touch on the android market can pair with a wiimote, decode the IR input and translate it to touch events (!)

The software sadly fails on the M802IIIS complaining over "missing touchscreen" when activating the joy2touch root-only server that is supposed to inject the touch events into the Android system. This error message seems correct - the stick indeed has no touchscreen, and apparently joy2touch needs one to inject touch events.

In a stroke of blind luck, I discovered that connecting an unpaired PS3 controller over USB does *something* inside the android kernel that makes joy2touch think a touchscreen is present. Using this setup I can control a wiimote IR cursor on screen (!) However, the event injection is not working, i.e., I cannot click or drag anything with the wiimote cursor.

I think what goes on here is that the PS3 controller creates a PS3-related /dev/input/event* that looks like a touchscreen to joy2touch. However, this means the touch events gets injected into the PS3 controller device rather than into anything that would be read as touch events by the android system.

This is where I am stuck. Can I somehow create a "virtual" /dev/input/event* on the MK802IIIS into which joy2touch can inject touch events? Is there any /dev/* on the system that mimics a touchscreen? If there just is any device *somewhere* under /dev I can do a simple 'ln -s /dev/something /dev/input/event6'.

Does anyone know where the rikomagic remote controller daemon (remote control from phone) injects its touch events?!

Otherwise, is there a kernel module I can load that implements a fake touchscreen device under /dev/input/event*?

Or, if all else fails, has anyone had success with plugging in a physical USB touchscreen into the MK802IIS? I'm thinking that if that works, it would create the device I need.
Last edited by rartino on Sat Jan 19, 2013 8:27 pm, edited 2 times in total.
rartino
 
Posts: 21
Joined: Wed Jan 16, 2013 12:00 am

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby addisj » Wed Jan 16, 2013 8:55 am

rartino wrote:I want to control my MK802 IIIS with the wiimote. I can't imagine why anyone who has this thing connected to their TV would NOT peruse this.


With the brilliant Measy Rc11 (2.4G) there really isn't any need to use any other pointing device.
It's really quite accurate when using the mouse/pointer and the keyboard is perfect and it's made for Android.
Picked mine up for £13 delivered from China.
addisj
 
Posts: 5
Joined: Thu Jan 10, 2013 3:51 pm

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby rartino » Wed Jan 16, 2013 8:14 pm

addisj wrote:With the brilliant Measy Rc11 (2.4G) there really isn't any need to use any other pointing device.


Oh, thanks for that hint, it looks neat. IMO not quite as elegant as the wiimote if you don't need the keyboard, but if my attempts fail, I may go for it.

As per my continued attempts with the wiimote, I found the touch analyzer debug tool from the guy behind Joy2Touch server,
http://goo.gl/U1M85
and running this I see that /dev/input/event1 is rkxx-remotectl, which I assume is used to inject touch events from the rikomagic remote client. However, it appears this device does not look like a touchscreen/touchpad, so then there is no easy way to inject the joy2touch events into that. Possibly I could write my own translator that opens a FIFO under its own /dev/input/event* and then translate and re-inject the events into /dev/input/event0, but that seems a lot of work, especially since I have no idea about the protocol for rkxx-remotectl.

I'm starting to think the easiest solution is to connect a physical usb touchpad just to get the kernel to create the needed /dev/input/event*. But, again, has anyone connected a touchpad to the MK802 III/IIIS and found it to work? I'm a bit reluctant to buy one only to find out that the kernel has no idea what to do with it.
rartino
 
Posts: 21
Joined: Wed Jan 16, 2013 12:00 am

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby rartino » Thu Jan 17, 2013 4:45 pm

Sorry for the bad form of replying to my own posts, but I have been making some good progress that may be interesting for others.

First, this thread at armtvtech is GOLD:
http://www.armtvtech.com/armtvtechforum ... f=66&t=835
by following this I can now compile kernel modules that loads into the mk802IIIS and works! I am absolutely sure they work, because I compiled the wacom driver, and after insmod:ing the MK802IIIS picks up a usb wacom pen tablet and lets me control the mouse pointer with it (!)

Sadly, the wacom tablet does not look enough like a touchscreen to fool joy2touch. So I found this nice driver:
https://github.com/vi/virtual_touchscreen
which compiles and gives a virtual_touchscreen.ko that loads cleanly (I think an extra .h file was needed inside the source, just google the compile error.)

This creates a /dev/input/event* that joy2touch picks up as a touchscreen! I now really have a virtual touchscreen (!) and I can see the joy2touch events be injected into it using the 'event' command.

Sadly, the MK802IIIS don't react to these touch events :(. For some reason the virtual_touchscreen driver is not passing the events into the kernel in a way that pass them on to the Android system. I know this has to be fixable, because the rikomagic remote control manage to create touch events inside android.

Any ideas on how to fix virtual_touchscreen.c are most welcome.
rartino
 
Posts: 21
Joined: Wed Jan 16, 2013 12:00 am

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby twjordo » Thu Jan 17, 2013 6:46 pm

thanks! i am catching up now....
mk802IV w/ mk702IIair mouse ~ mk802+ 1gb ram 4 gb storage ~ mk802II 1gb ram 4gb storage ~ mk802IIIs 1gb ram 8gb storage with 4port usb running wireless mouse/kboard and red samurai bt gaming controller ~ mk808b 1gb ram 8gb storage
check out TechKnow
twjordo
 
Posts: 406
Joined: Fri Jul 06, 2012 6:07 am
Location: tennessee usa

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby rartino » Fri Jan 18, 2013 1:56 am

Yay!, it sort of works for me now (!), but will require more tweaking.

Everything was "right" as per my last post, wiimote movement generates multitouch events which are injected into android. The only issue is that joy2touch doesn't inject any BTN_TOUCH events. Hence, android just reads the wiimote event as "non swipe" invisible cursor movements.

By adding some code into the virtual touchscreen kernel driver initialization that just outright set BTN_TOUCH=1 and keeps it so, I get an android 'touchpoint' drawn on screen that I can move around, and through some magic I don't yet fully understand still allows me to "click" on things by pushing the wiimote button (it cannot be BTN_TOUCH events, but rather android must read the finger tracking events as "clicks")

But now I am left wondering - is this a bug in joy2touch, or just that the virtual touchscreen defines too ambiguous features which confuses the part of android that interpret touch events? Should a normal android "swipe" in multitouch protocol B include a BTN_TOUCH down + up or not?

Currently my best guess is that it is a joy2toch bug. Since the author of the software has locked his forums and apparently gone completely off map, my best chance appear to try to re-write the virtual_touchscreen driver so that it is detected as a multitouch protocol A device instead; hoping that this is a more tested configuration.
rartino
 
Posts: 21
Joined: Wed Jan 16, 2013 12:00 am

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby daemonium » Fri Jan 18, 2013 8:02 am

Wow, that's a lot of good info! Thank you!!
Are you working on stock ROM or Finless?
Regards
daemonium
 
Posts: 5
Joined: Fri Jan 18, 2013 7:55 am

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby rartino » Fri Jan 18, 2013 10:07 pm

Thanks for the appreciation! I just really want this to work and thought posting may either help someone else, or even find someone who wants to help.

I'm on stock rom;
Code: Select all
Kernel: 3.0.8+ ant@test-desktop #170, SMP PREEMPT Thu Dec 20 17:42:03 CST 2012.
Build: MK802IIS_ANDROID4.1.1-SDK-v1.00.1015 MK802IIIS-eng 4.1.1 J003H eng.ant.20121220.184300 test-keys


I have figured out why the pointer behaves so odd for me, and thus also likely why the joy2touch events are being somewhat misunderstood (which required me to force down the BTN_TOUCH). The MK802IIIS android system thinks my virtual_touchscreen is a TOUCHPAD! It took me forever to realize that I had touchpad-like semantics, because this behavior with a wiimote pointer is very, very non-intuitive. You get two cursors, and "drag" one with the other. To click or drag you need to double-tap the wiimote button. It is hilarious to try to get used to this :)

Aside from this, I actually think everything is working perfectly now. The diagram of the working setup is:
USB/BT Joy Center 6 -> Joy2touch -> injects into /dev/input/event* created by my virtual_touchscreen kernel module -> kernel -> android

So, how do I get android to assign touchscreen rather than touchpad sematics to a device? I'm thinking this should be doable with an idc file, but I had one in place while testing and it didn't help, so there must be something I still don't understand.

But even better would be if I could just setup the deice to make android automatically assign touchscreen semantics. Does anyone know how android auto-classify between these two? I don't see that info in here:
http://source.android.com/tech/input/touch-devices.html

---

edit: I think I actually found the info in the link. And apparently android docs use somewhat different language, what I call touchpad = pointer in their language.
rartino
 
Posts: 21
Joined: Wed Jan 16, 2013 12:00 am

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby rartino » Fri Jan 18, 2013 10:40 pm

It works, it works!, I can't believe it! This feels extremely rewarding :D

And its exactly as amazing as I thought it would be! I'm in my sofa playing cut the rope HD in 1080p right now, and it absolutely rocks!

Now, I wonder if I can run two wiimotes for actual multitouch. I mean, some day I will want to zoom and rotate in google earth...
rartino
 
Posts: 21
Joined: Wed Jan 16, 2013 12:00 am

Re: Wiimote control; USB/BT Joy Center 6, Joy2Touch Server

Postby hellvy » Sat Jan 19, 2013 1:20 am

hello, it's really great job you've done here :)

I'm interesting on using DualShock 3 joy pad with Sixaxis application. But we're suffering from lack of touch input on Mini PC so we can not use Siaxis's touch profile. Do you think your virtual touchscreen driver can use with Sixaxis application? So we can connect DualShock 3 with Mini PC and assign touch profile directly instead of using it via DroidMote.

If possible, could you please share some procedure and your driver source you're using to make this thing (actually i have plan to use it on UHost2 but i also have MK802IIIs in hand too)? I'm very exiting to try it :)
hellvy
 
Posts: 16
Joined: Sat Jan 19, 2013 12:52 am

Next

Return to Rikomagic MK802 IIIS Forum

Who is online

Users browsing this forum: No registered users and 3 guests