Wiimote!

Announce/Discuss projects you are working on for MiniMyth

Moderator: Pablo

Post Reply
Dorant
Contributor
Posts: 63
Joined: Sat Apr 22, 2006 11:42 am
Location: Sweden

Wiimote!

Post by Dorant » Mon Jan 28, 2008 9:44 pm

If you have a Wiimote that you want to use as a remote.."just" do this:

Download the scripts:
http://www.dorant.nu/minimyth/wiimote.tar.gz
unpack and place it in your buildfolder: ..gar-minimyth/script/

Add this to your ~/.minimyth/minimyth.conf.mk

Code: Select all

# Bluetooth
mm_USER_PACKAGES += wiimote/dbus wiimote/bluez-libs wiimote/bluez-utils
mm_USER_BIN_LIST += hcitool hciconfig l2ping
mm_USER_LIB_LIST += libdbus-1.so.3.2.0 libbluetooth.so.2.9.4
mm_USER_LIB_LIST += modules/*/kernel/net/bluetooth/bluetooth.ko
mm_USER_LIB_LIST += modules/*/kernel/net/bluetooth/l2cap.ko
mm_USER_LIB_LIST += modules/*/kernel/net/bluetooth/rfcomm/rfcomm.ko
mm_USER_LIB_LIST += modules/*/kernel/drivers/bluetooth/hci_usb.ko

# Wiimote
mm_USER_ETC_LIST += cwiid/
mm_USER_PACKAGES += wiimote/cwiid
mm_USER_LIB_LIST += libcwiid.so.1.0
mm_USER_BIN_LIST += wminput
To enable Bluez you need to patch your kernel config with:

Code: Select all

> CONFIG_BT=m
> CONFIG_BT_L2CAP=m
> CONFIG_BT_SCO=m
> CONFIG_BT_RFCOMM=m
> CONFIG_BT_RFCOMM_TTY=y
> CONFIG_BT_BNEP=m
> # CONFIG_BT_BNEP_MC_FILTER is not set
> # CONFIG_BT_BNEP_PROTO_FILTER is not set
> CONFIG_BT_HIDP=m
>
> #
> # Bluetooth device drivers
> #
> CONFIG_BT_HCIUSB=m
> CONFIG_BT_HCIUSB_SCO=y
> # CONFIG_BT_HCIUART is not set
> # CONFIG_BT_HCIBCM203X is not set
> # CONFIG_BT_HCIBPA10X is not set
> # CONFIG_BT_HCIBFUSB is not set
> # CONFIG_BT_HCIVHCI is not set
Build your minimyth and install it.

Add this to your minimyth.script:

Code: Select all

cp /etc/cwiid/wminput/wminput /etc/rc.d/init.d/
/bin/sed -e "s/%WIIMOTE_ADDR%/00:19:FD:BE:DB:80/" -i /etc/rc.d/init.d/wminput
cd /etc/rc.d/rc.d/
/bin/ln -s ../init.d/wminput S53wminput
/bin/ln -s ../init.d/wminput K32wminput
This starts the application that handles the Wiimote-to-uinput events.

Dont forget to change the bluetooth address to your Wiimote-device!
It can be found by running:

Code: Select all

hcitool scan
If you have the BT-usbdongle connected when booting everything should be fine. Just connect the Wiimote by pressing button 1+2 at the same time...and use it to browse in the mythtv menu.
Good luck!

Next step is to get Frets on Fire to rock :D

Dorant
Contributor
Posts: 63
Joined: Sat Apr 22, 2006 11:42 am
Location: Sweden

Post by Dorant » Tue Jan 29, 2008 4:42 pm

Updated the scripts above:
http://www.dorant.nu/minimyth/wiimote.tar.gz
Installing cwiid works a bit better now..

Pablo
Site Admin
Posts: 4182
Joined: Tue Dec 14, 2004 2:13 am
Location: La Jolla
Contact:

Post by Pablo » Fri Feb 01, 2008 5:44 am

You are evil. :)

I do not have a Wii, but I had to get some parts (a bluetooth USB dongle, a Wii remote and a Wii sensor bar) so that I an try this out. I have the Wii remote and the Wii sensor bar, but the bluetooth USB dongle does not arrive until tomorrow.

I have integrated your packages into the the build system. I made some minor changes (e.g. putting them into the lib and utils directories, adding dependencies, etc). In addition, I added wiimote init scripts and wiimote minimyth.conf variables (MM_WIIMOTE_ENABLED, MM_WIIMOTE_ADDRESS_0, MM_WIIMOTE_ADDRESS_1, MM_WIIMOTE_ADDRESS_2 and MM_WIIMOTE_ADDRESS_3). Since I do not have the USB dongle, I am sure that the init scripts are broken. Once the USB dongle arrives I will fix up the init scripts.

If you have the time, I have a couple quesitons.

It appears that the libwiimote package is not used. Is there some reason that you included it?

It appears that wminput creates evdev devices using uinput. LIRC has support for evdev devices. If it were routed through LIRC, then LIRC could be used to create application specific mappings. Did you consider this?
MiniMyth running on an Acer ApireRevo 3610 and a Zotac ZBOX-ID80-U. Find out more at my MythTV page.

Dorant
Contributor
Posts: 63
Joined: Sat Apr 22, 2006 11:42 am
Location: Sweden

Post by Dorant » Fri Feb 01, 2008 9:31 am

Great! Ill give the new build a try too
The libwiimote can be removed, I just added it to test the setup using the test applications. I havn't found any applications that uses it either

Using LIRC could be a great idea, I didnt know anything about evdev, but to be able to map would be useful.
You probably want to hold the wiimote horizontal when playing games in mythgame, so in that case its needed. I have only used it to browse in the menus so far, but I guess controlling xine/mplayer dont work as it is now

Pablo
Site Admin
Posts: 4182
Joined: Tue Dec 14, 2004 2:13 am
Location: La Jolla
Contact:

Post by Pablo » Sun Feb 03, 2008 9:04 pm

The bluetooth dongle arrived, so I was able to get things working.

I have included Wiimote support in test build 39b1.

I was not able to get LIRC to work with the Wiimote. LIRC's irrecord would not work - it couldn't determine the gap time. Therefore, I will need to add configuration files to MPlayer and Xine that map their controls to the same keys used by MythTV.

The included wminput configuration file maps the escape key to the Home button rather than the B button, because I kept hitting the B button by accident. It is not very intuitive, but it is safer for me.

The included wminput configuration file has configuration that creates a joystick and mouse that are tracked using the Wii sensor bar.

The created event, joystick and mount devices are named based on the MM_WIIMOTE_ADDRESS_n variables. They have the names /dev/input/{event,joystick,mouse}-wiimote-n. This allows them to be predicable across reboots. I had to patch wminput to make this work since it was creating devices with no hardware identifying information.

The mouse functionality work reasonably well in MythBrowser.

I have not tested/tried the joystick functionality in any of the MythGame emulators.

I have not tested the multi-wiimote support.
MiniMyth running on an Acer ApireRevo 3610 and a Zotac ZBOX-ID80-U. Find out more at my MythTV page.

Dorant
Contributor
Posts: 63
Joined: Sat Apr 22, 2006 11:42 am
Location: Sweden

Post by Dorant » Tue Feb 05, 2008 2:52 pm

Nice! I tried it last night and it worked for me too, but I had to add the pre-configure (for libtool) in bluez-utils again to be able to cross-compile athlon64->pentium-mmx.
I think it was sdpd that otherwise used my hosts bluetooth lib when linking.

I dont have the sensorbar, but it should be very useful in MythBrowser...maybe I have to buy/build one of those :D

Pablo
Site Admin
Posts: 4182
Joined: Tue Dec 14, 2004 2:13 am
Location: La Jolla
Contact:

Post by Pablo » Tue Feb 05, 2008 7:35 pm

Dorant wrote:Nice! I tried it last night and it worked for me too, but I had to add the pre-configure (for libtool) in bluez-utils again to be able to cross-compile athlon64->pentium-mmx.
I think it was sdpd that otherwise used my hosts bluetooth lib when linking.
Ok. I added it.
MiniMyth running on an Acer ApireRevo 3610 and a Zotac ZBOX-ID80-U. Find out more at my MythTV page.

gtr33m
Contributor
Posts: 67
Joined: Mon Jan 21, 2008 9:23 am
Location: Sydney, Australia

Post by gtr33m » Sun Mar 16, 2008 12:34 pm

Guys, for those of us who are total noobs, would it be possible to get a build with this already added, or some step by step instructions on how to do build with the files added.

I'm seriously out of my depth, but I can follow instructions.

Also, is the sensor bar necessary? I've got a wii remote and a bluetooth dongle, so would be interested in giving it a go without the sensor bar at first and then adding it later.

Thanks,

Mark
GA-PCV2 mini-itx
512 MB RAM
DVico Ultraview Remote

Post Reply