Android Wiimote Unity3D Plugin

I have done a bit more research on the possibilities of completing this plugin. Essentially, I would have to move to a lower level in the Android framework (the NDK) in an attempt to either connect to the HID, which isn’t provided at the Java level, or re-implement the L2CAP protocol. I haven’t done enough research yet to determine if this is possible, but it would be a potential avenue for a future incarnation of the project.

Another option would be to create my own controller, likely using an Arduino, Bluetooth, and accelerometers / buttons. The RFCOMM protocol would likely need to be implemented on the Adruino. A 3D printer could be used to create a case for the user to hold.

Either of these approaches would be a project in and of themselves. I suspect creating my own motion controller would have the highest likelihood of success. I am going to save the next incarnation of this project for a summer project.

The source code and documentation for my plugin can be found here: AndroidWiimote

Lessons Learned:

I have become familiar with the Android framework, and the Android way of doing things. This will allow me to get up and running much faster on future Android projects. I previously had no experience in this area. I also learned how to create Android plugins for Unity.

I also learned that when people say something is broken starting with version X, dig until you find what was actually broken. In my investigations of why wiimotes no longer worked with Android 4.2, I had come to the conclusion that they simply changed the way the Bluetooth stack worked, instead of removing functionality altogether.

I also learned that when scoping short projects, I should probably limit them to one technology or aspect that I am unfamiliar with. This would allow the scoping to be more accurate.

This entry was posted in assignments, Project 2.2. Bookmark the permalink.

3 Responses to Android Wiimote Unity3D Plugin

  1. Philippe Germain says:

    Hi,
    I found your experiment very interesting. I’m currently a college student from Montréal in Multimedia. As a final project I wanted to do a game with Unity, using a cardboard and utilize the wii remote and a nunchuck to move around and interract. As I understand, if you use a cellphone that is over android 4.2, it won’t work. So the solutions are using a rom that is prior to android 4.2 or another bluetooth controller ? I haven’t figure out what I wanted to do but it would have been nice to use the gyroscope feature of the wiimote. If you have any informations that could help me or if I could help you to test features I will be a pleasure.

    Thanks and continue your good work.

    Like

    • Hi Philippe,
      I’m glad you have taken interest in my project. You are correct about Android 4.2. I have not found a controller that supports RFCOMM, but it could exist. I outlined several possible approaches in my post, but one I did not mention was that you could potentially use another device, such as a laptop, to bridge the bluetooth connection and translate the protocol to RFCOMM. The risk here would be that because there are so many layers, the latency might be too much.
      If you undertake this project, I would recommend you take the approach that you have the most experience with. I would also recommend starting with making the connection work, and using buttons and gyroscope or accelerometers, before moving on to extensions like the nunchuck.
      I would like to follow your progress if you undertake this, and would be happy to test for you depending on the approach you take.
      Thanks and good luck,
      Josh

      Like

      • Philippe Germain says:

        Thank you,
        I think the biggest difficulty is the pairing itself, I don’t think we can achieve that even with a rooted phone… I also tought using a computer with moonlight and trinus to mirror the computer screen and tethering with a 10 feet usb cable, but you will have to manage a cable… I have used this solution with tridef to play games like GtaV and it worked well without to much lag. But anyway I will continue to look into that.

        Have a great day

        Phil

        Like

Leave a reply to joshkillingerblog Cancel reply