ユーザ用ツール

サイト用ツール


linux:debianetch:wii-remote

WiiリモコンをLinux(Debian-Etch)で使ってみた時のメモ

WiiリモコンをLinux(Debian-Etch)で使った時のメモ書き。正しいかどうかは知らない。。。

1. BlueZ をインストール

Synapticパッケージマネージャ から [検索] ボタンで 「bluez」と入力して検索。“bluez-gnome” だけが有効になっていた。で、以下を追加。

"bluetooth"
"bluez-hcidump"
"bluez-utils"
"libbluetooth2"
"libbluetooth2-dev"

2. USB Bluetooth アダプタを挿入

手元にあった USB Bluetooth のアダプタが使えるか、早速テスト。ちなみに使ったUSB Bluetooth のアダプタは、PLANEX製の “BT-01UDE” というもの。Debian-EtchのPCに差し込んで、

hcitool dev

と入力したら、

Devices:
        hci0    00:0A:94:02:82:DF

と出てきた。認識はされているらしい。OKと。

3. Wiimote Library をダウンロード

http://libwiimote.sourceforge.net/ から、Wiimote Libraryをダウンロード。簡単な説明があるが、とりあえず一番下の [Download] 先から、“libwiimote-0.4.tgz” をダウンロードした。

4. ダウンロードした "libwiimote-0.4.tgz" を解凍。

tar xvzf libwiimote-0.4.tgz

“libwiimote-0.4/“というディレクトリが出来たのでそちらへ。

cd libwiimote-0.4

5. autoconf をインストール

一発 make と思って make したら、怒られた。

make: *** ターゲットが指定されておらず, makefile も見つかりません.  中止.

autoconf を使って、”configure” を作ればいいらしい。って autoconf が無いぞ。

apt-get install autoconf

こんどは、apt-get を使ったりして、一貫性ないの。

6. autoconf で configure を作成

libwiimote-0.4 の下で、

autoconf

するだけ。“configure” ファイルが生成された。

7. configure を実行

./configure

を実行。Makefile等ができました。

8. make 一発

おもむろに make を実行。テスト用の実行ファイルが生成されます。libwiimote-0.4/bin/ 以下にある、“test1” ~ “test4” を実行してみよう。

あれ、、libcwiimote.so が無いって。

9. /usr/lib にシンボリックリンク

上で make して出来た場所が見えないみたい。で、/usr/lib/ にシンボリックリンク

ln -s /usr/local/lib/libcwiimote.a libcwiimote.a
ln -s /usr/local/lib/libcwiimote.so.0.4.0 libcwiimote.so

10. BDアドレスを調べないと

“test1” ~ “test4” の実行時に、BDアドレスを入れないといけないが、WiiリモコンのBDアドレスがわからない。

hcitool scan

と入力して、Wiiリモコンの“1”と“2”のボタンを当時押しっと。 しばらく待つと、“Nintendo RVL-CNT-01” と共に BDアドレスが出てきた。

11. おもむろに実行

./test1 XX:XX:XX:XX:XX:XX

やった、成功成功。 それぞれの test でできることは以下の通り。テストしているうちにこの説明が流れていってしまうので、ここに写しといた。

test1 - libwiimote test application
   A    - Enable accelerometer
   B    - Enable ir-sensor
   1    - Enable rumble
   +    - Increment leds
   -    - Decrement leds
   Home - Exit
  
  test2 - speaker test
 A      - Play sample
 TILT_X - Modulate frequency
 TILT_Y - Modulate volume
 HOME   - Exit

test3 - multiple libwiimote test application
 1    - Enable rumble
 Home - Exit

test4 - libcwiimote test application
 Will scan MII slots and save them as files

P.S. Wiimote って言葉が良く出てくるが、どおやら Wiiリモコン そのものを示しているらしい。。。英語なのかな?

linux/debianetch/wii-remote.txt · 最終更新: 2023/08/14 10:21 by hohog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki