LoginSignup
1
3

More than 5 years have passed since last update.

MacからRaspberry Pi3をSSHで繋いで、Bluetoothの情報も拾いたい

Last updated at Posted at 2018-12-27

MacからRaspberry Pi3にSSHで接続する

条件:MacとRaspberry Pi3がローカルネットワーク上に存在すること

Raspberry Pi3でIPアドレスを確認する

RaspberryPiのコンソールで以下のコマンドを実行する。
ifconfig
IPアドレスが表示されます。

MacからSSHで接続する

Macのターミナルで以下のコマンドを実行する。
ssh pi@Raspberry PiのIPアドレス
パスワードが聞かれるかと思いますので、初期は以下のパスワードとなります。
raspberry

これで、MacからSSHを利用して、Raspberry Pi3へ接続ができます。

注意

固定のIPアドレスにしていないと接続が切れやすいです。

Raspberry Pi3でBluetoothの一覧を取得する

bluezを取得する

以下のコマンドを実行する。
wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.45.tar.xz

ファイルの解凍

以下のコマンドを実行する。
xz -dv bluez-5.45.tar.xz
tar -xf bluez-5.45.tar
cd bluez-5.45

Bluetoothを取得する

以下のコマンドを実行する。
hcitool lescan

または

bluetoothctl -a
[bluetooth] scan on
[bluetooth] discoverable on

これで、Bluetoothの情報が取得できました。

1
3
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
1
3