bluetoothをRaspberry Piに接続

グリーンハウス Bluetooth 4.0 USBアダプタ Class2 GH-BHDA42

グリーンハウス Bluetooth 4.0 USBアダプタ Class2 GH-BHDA42

GH-BHDA42ってBluetoothをつないだら簡単に認識しました。
なので、後は必要ツールをインストールして、コマンド打つだけで、設定が完了しちまった。

apt-get install bluetooth bluez-utils blueman

下記のコマンドを実行すると対象機器のPINがでます。

hcitool scan

PINがAA:BB:CC:DD:EE:FFだった場合は

bluez-simple-agent hci0 AA:BB:CC:DD:EE:FF
bluez-test-device trusted AA:BB:CC:DD:EE:FF yes
bluez-test-input connect AA:BB:CC:DD:EE:FF

途中でパスコードの入力がありますが
正常終了したら、使えるようになります。
ただ、自動接続がなんか、うまくいかないのでちょっと困っています。

参考
http://www.ctheroux.com/2012/08/a-step-by-step-guide-to-setup-a-bluetooth-keyboard-and-mouse-on-the-raspberry-pi/