LoginSignup
0
1

More than 5 years have passed since last update.

①Raspberry Pi3の環境構築 for MAC

Last updated at Posted at 2018-07-11

準備するもの(周辺機器)

  1. MacBook Pro
  2. Raspberry Pi 3
  3. 16GB以上のSDカード
  4. SDカードリーダー
  5. USBケーブル 1本
  6. LANケーブル 1本
  7. USB Ethernetアダプタ

RASPBIANのダウンロード

最新版のRASPBIANをダウンロードする。
公式
https://www.raspberrypi.org/

今回はwgetでzipファイルとしてダウンロードします。

% wget https://downloads.raspberrypi.org/raspbian/images/raspbian-2018-06-29/2018-06-27-raspbian-stretch.zip

tarでzipファイルを展開

% tar zxvf 2018-06-27-raspbian-stretch.zip

SDカードにイメージを書き込む

Micro SDカードリーダーにSDカードを差し込んでMacに接続

1.SDカードをFAT32でフォーマットします。

% diskutil eraseDisk FAT32 RPI /dev/disk1
Started erase on disk1
Unmounting disk
Creating the partition map
...
Finished erase on disk1

2.SDカードのアンマウント

% diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful

3.SDカードにイメージを書き込む

% sudo dd bs=1024m if=2018-06-27-raspbian-stretch.img  of=/dev/disk1
3+1 records in
3+1 records out
3276800000 bytes transferred in 165.742978 secs (19770370 bytes/sec)

ラズパイ起動

RaspberryPiにSDカードを挿入し、USBケーブルでMACに接続する。
ブート成功=黄緑のLEDが点灯します。
ブート失敗orSDカードに書き込み失敗=赤のLEDのみつきます。

MacとRaspberryPiをブリッジ接続する

  1. MacにUSB Ethernetアダプタを接続し、システム環境設定 -> 共有を開きます。そして、WifiからUSB Ethernetへ共有するよう設定し、インターネット共有のチェックをONにします。
    DHCPのIPアドレスが169.254から始まる値になります。

  2. Macに接続されたUSB EthernetとRaspberry PiをLANケーブルで接続します。

sshでRaspberryPiにログインする

ユーザー名はpi、パスワードはraspberry

% ssh pi@192.168.2.2

RaspberryPi初期設定

% pi@raspberrypi ~ $ sudo raspi-config

RASPBIANのインストール完了!!

macからGUIベースでラズパイを操作する

% sudo apt-get update
% sudo apt-get upgrade
% sudo apt-get install tightvncserver
% tightvncserver

New 'X' desktop is raspberrypi:1

Starting applications specified in /home/pi/.vnc/xstartup
Log file is /home/pi/.vnc/raspberrypi:1.log

macのFinderのメニューから「移動」->「サーバへ接続」で vnc://192.168.2.2:5901 に接続する。

Raspberry Pi3で湿度と温度を取得する
に続く

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