LoginSignup
30
31

More than 5 years have passed since last update.

Raspberry pi3 をiPhoneとbluetooth接続しようとしてかなりハマった話

Last updated at Posted at 2017-08-17

 Raspberry Pi 3でiPhoneとbluetooth接続のテストをした時にネットの情報と違って思いの外ハマったので備忘録兼ねての。

行った環境

  • Raspberry Pi3(Raspbian Jessie lite)
  • Macbookpro(ここからssh)
  • iPhone5S

順調だったこと

幾つかのサイトを参考に以下のコマンドを打つもののすでに入っていた。

$ sudo apt-get bluetooth bluez pi-bluetooth 

いざ繋げるべく

$ bluetoothctl -a
Argent registered
[bluetooth] scan on
[bluetooth] discoverable on
[NEW] Device xx:xx:xx:xx:xx:xx iPhone

のこのこiPhoneが現れたので

[bluetooth] pair xx:xx:xx:xx:xx:xx
Attempting to pair with xx:xx:xx:xx:xx:xx
[CHG] Device xx:xx:xx:xx:xx:xx Connected: yes
Request confirmation
[agent] Confirm passkey 123456 (yes/no): yes

となりあっさりPairing完了。
ここからが地獄だった。。。。

ハマったところ

Pairingがあっさり完了したのだがiPhoneの表示は"Not Connected"のまま。
おかしいと思いタップしてiPhone側から再度接続を試みるも5秒ほど"Connected"となりすぐに”Not Connected"に戻る。

どういうことだよ。

sshしてるMacBook Pro側のTerminalにも

[CHG] Device xx:xx:xx:xx:xx:xx connected:yes
[CHG] Device xx:xx:xx:xx:xx:xx connected:no
[CHG] Device xx:xx:xx:xx:xx:xx connected:yes
[CHG] Device xx:xx:xx:xx:xx:xx connected:no
以下略

と永遠に表示されパニックに陥った回数だけこれが増えていく始末。

ここでGoogle先生に助けを求めるもみんなあっさりつながっている模様でここから抜け出す情報がない。

  • Bluetooth関連パッケージの削除と再投入>>失敗
  • 試しにpulseaudioの再投入と再起動>>失敗
  • pulse audioの個別パッケージの再投入>>すでに最新

抜け出し方

https://github.com/blueman-project/blueman/issues/677
最終的にここを見ているときにふと"gnome-bluetoothでも入れてもっかい試してみるか”と思い。

$ sudo apt-get install gnome-bluetooth

そんで再トライしたらあっさり繋がりましたとさ。

謎。

そんで

[bluetooth] trust xx:xx:xx:xx:xx:xx

で接続切れても認証無しで再接続可能に。

さまよってるときに"gnome-bluetooth入れてみれば?”っていう情報を得られなかったのでもしここでハマった方がこれを見つけて解決できたらなと。

discoverable on の状態でiPhone側から見つけてpairingすることにも成功。

結論

gnome-bluetooth入れたらなんか繋がった!

trustの手順を自動化する方法を探そうかな。

30
31
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
30
31