LoginSignup
2
2

More than 5 years have passed since last update.

Intel Edisonでbluetoothテザリング

Last updated at Posted at 2015-11-23

スマートフォンやPCに対してbluetoothテザリングを行います。大枠は Edison Bluetooth Guide のPAN(Personal Area Network)周りの設定を参照してください。connmanを使用するのがポイントです。
http://www.intel.com/support/edison/sb/CS-035381.htm

荷物を減らしてスマートフォンとEdisonのみの持ち歩きとしたいとき、かつ、人混みの環境下だとwifiより通信が安定するのがメリットでしょうか。筆者はiOSのSSHクライアントよりコンソール画面に出力する歩数計サンプルを作成した時に使用したりしています。

また、connmanを起動に組み込むと、Edison起動時にbluetoothの接続先がいれば自動的に接続します。(これ重要)

デメリットとして、出先でEdisonの接続を見失うとどうにもならなくなるときがあるので、wifiのテザリングも別途登録しておく、APモードへの切り替え等、その場でリカバリーする手段を用意しておいておいたほうがいいです。

用意するもの

BluetoothテザリングをONにしたスマートフォンまたはPCを用意します。
Macを使う場合、bluetoothを有効にした後、設定>共有>インターネット共有>bluetooth PANにチェックを入れ、インターネット共有を開始しておきましょう。

最初はシリアル接続経由でEdisonにログインして以下の設定を行い、割り振られるIPアドレスをメモ等しながら行ったほうがよいです。ちなみにiOS9のテザリングを使った時のIPアドレスは172.20.10.xxxになります。

connmanの起動

2行目は起動時に登録するか否かです。登録後、解除するにはenableをdisableに変更して実行します。

# systemctl start connman
# systemctl enable connman

bluetoothの有効化

# rfkill unblock bluetooth

デバイスのペアリング(初回のみ)

# bluetoothctl
> agent DisplayOnly
> default-agent
> discoverable on
> scan on
> pair 00:11:22:33:55:77 ※デバイスに合わせて変更
> trust 00:11:22:33:44:77
> exit

※コマンドやアドレスはタブ補完が効きます。pairがうまくいかない場合、接続先側でペアリングしてみましょう。

テザリング接続

# connmanctl
> services ※ペアリングしたbluetoothと周囲のwifiが見えるはず
> connect bluetooth_001122335577_001122335566 ※テザリング側bluetoothデバイスの名前
> config bluetooth_001122335577_001122335566 autoconnect yes
> agent on *wifiの接続設定開始
> connect wifi_001122335577_001122335566 *この後、パスフレーズを聞かれるので入力
> config wifi_001122335577_001122335566 autoconnect yes
> services
*AO bluetooth_001122335577_001122335566
*AR wifi_001122335577_001122335566
> exit

※接続設定を保管したネットワークは先頭に’*’、自動接続する場合は’A’、接続中は’O’、接続可能は’R’が出ます。
※こちらも入力中にタブ補完が効きます。

ifconfigの出力にbnep0がIPアドレスが割り振られた状態で存在し、ネットワーク接続できることを確認して下さい。
また、この状態で再起動し、Edisonが起動時にbluetooth経由で再接続したら成功です。

参考
https://wiki.archlinux.org/index.php/Connman
https://01.org/connman/documentation

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2