本部落格已搬遷, 3秒後跳轉...

第一次吃樹莓派 | Laplace's Lab

第一次吃樹莓派

樹莓派3B+初始化安裝。


Operation System

參考了IT技術家所整理的作業系統清單,我決定直接安裝官方發行的Raspbian OS。

由於Raspberry Pi是以SD Card來當硬碟(官方說明),網路上大多建議儲存容量至少8G、寫入速度class 10,加上系統更新考量,於是我準備了一張儲存容量16G、寫入速度class 10的SD Card來當系統儲存空間,以及一支隨身碟來當資料儲存空間。不過官方有特別強調,較高的寫入速度並非記憶卡性能的唯一標準,因為寫入速度通常是藉由犧牲讀取速度和尋軌效能而提升的。

The card class determines the sustained write speed for the card; a class 4 card will be able to write at 4MB/s, whereas a class 10 should be able to attain 10 MB/s. However, it should be noted that this does not mean a class 10 card will outperform a class 4 card for general usage, because often this write speed is achieved at the cost of read speed and increased seek times.

Raspbian鏡像檔目前有3種版本:

  • Raspbian Stretch with desktop and recommended software
  • Raspbian Stretch with desktop
  • Raspbian Stretch Lite

Raspberry Pi安裝作業系統有許多方式,直接刷進去SD Card應該是最簡單的方式,官方推薦Etcher燒錄工具。

Connect to Wi-Fi Networks

將作業系統刷進SD Card後,讓電腦重新讀取記憶卡,在根目錄下建立wpa_supplicant.conf,寫入網路連線參數,可寫入多筆。

1
2
3
4
5
6
7
8
9
country=TW
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
priority=9
ssid="{SSID}"
psk="{Password}"
key_mgmt=WPA-PSK
}

P.S. 優先度Priority數字越大,優先度越高。

Remote


SSH連線預設為關閉狀態,如同無線網路設定,在根目錄下建立名稱為’ssh’的檔案即可強制啟用SSH連線。

我忘了在網路連線設定country參數,所以連線時系統有提醒可以進config設定。

在Raspberry Pi安裝VNC Remote Server

1
2
$ sudo apt-get install tightvncserver -y
$ vncserver # run server

首次遠端桌面連線時,系統會要求設置連線密碼。

1
2
3
4
5
6
7
8
9
10
11
12
13
pi@raspberrypi:~ $ vncserver
You will require a password to access your desktops.

Password:
Warning: password truncated to the length of 8.
Verify:
Would you like to enter a view-only password (y/n)? n

New 'X' desktop is raspberrypi:1

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

在Google Chrome安裝VNC Viewer擴充程式

*VNC Viewer for Google Chrome

連線Address需指定VNC Server Port,連接阜編碼規則為5900+Display編號。
e.g. 192.168.0.2:5901

Shutdown

1
$ sudo shutdown -h now
0%