究竟 Raspberry Pi 4B 與舊版有甚麼分別
硬件設備
詳細資料當然到 Raspberry Pi 的官方網站 查看資料便最準確
在下偏重多角度拍攝 Raspberry Pi 4B 的外觀

Raspberry Pi 4B 4GB RAM 正面

Made in the UK 圖示

Raspberry Pi 圖示

Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz 晶片

4GB LPDDR4-3200 SDRAM 晶片

2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE 晶片

Gigabit Ethernet 晶片

USB驅動 晶片

電源管理 晶片


Raspberry Pi 4B 側面

USB Type-C 插口,使用 5V 3A 電壓及電壓
可以接駁更多 GPIO配件 及 USB裝置
即使沒有外部電源供應,亦最少可以為 一個3.5寸硬碟裝置獨立供電及傳輸資料

2個 Micro HDMI 插口
接近電源的 Micro HDMI 是 第一插口

3.5mm雙聲道及視訊 插口

總共 4個 USB Type-A 插口
接近網絡插口 2個 是 USB 3.0 插口
另外 2個 是 USB 2.0 插口

支援 1Gb 網絡插口

40支 GPIO 引腳

用途 | 引腳 | 用途 | |
---|---|---|---|
3.3V | 1 | 2 | 5V |
GPIO 2 (SDA) | 3 | 4 | 5V |
GPIO 3 (SCL) | 5 | 6 | GND |
GPIO 4 (GPCLK0) | 7 | 8 | GPIO 14 (TXD) |
GND | 9 | 10 | GPIO 15 (RXD) |
GPIO 17 | 11 | 12 | GPIO 18 |
GPIO 27 | 13 | 14 | GND |
GPIO 22 | 15 | 16 | GPIO 23 |
3.3V | 17 | 18 | GPIO 24 |
GPIO 10 (MOSI) | 19 | 20 | GND |
GPIO 9 (MISO) | 21 | 22 | GPIO 25 |
GPIO 11 (SCLK) | 23 | 24 | GPIO 8 (CE0) |
GND | 25 | 26 | GPIO 7 (CE1) |
ID SD | 27 | 28 | ID SC |
GPIO 5 | 29 | 30 | GND |
GPIO 6 | 31 | 32 | GPIO 12 |
GPIO 13 | 33 | 34 | GND |
GPIO 19 | 35 | 36 | GPIO 16 |
GPIO 26 | 37 | 38 | GPIO 20 |
GND | 39 | 40 | GPIO 21 |
引腳 | 用途 |
---|---|
1 | 3.3V |
2 | 5V |
3 | GPIO 2 (SDA) |
4 | 5V |
5 | GPIO 3 (SCL) |
6 | GND |
7 | GPIO 4(GPCLK0) |
8 | GPIO 14 (TXD) |
9 | GND |
10 | GPIO 15 (RXD) |
11 | GPIO 17 |
12 | GPIO 18 |
13 | GPIO 27 |
14 | GND |
15 | GPIO 22 |
16 | GPIO 23 |
17 | 3.3V |
18 | GPIO 24 |
19 | GPIO 10 (MOSI) |
20 | GND |
21 | GPIO 9 (MISO) |
22 | GPIO 25 |
23 | GPIO 11 (SCLK) |
24 | GPIO 8 (CE0) |
25 | GND |
26 | GPIO 7 (CE1) |
27 | ID SD |
28 | ID SC |
29 | GPIO 5 |
30 | GND |
31 | GPIO 6 |
32 | GPIO 12 |
33 | GPIO 13 |
34 | GND |
35 | GPIO 19 |
36 | GPIO 16 |
37 | GPIO 26 |
38 | GPIO 20 |
39 | GND |
40 | GPIO 21 |

Power over Ethernet (PoE) 引腳
讓 Raspberry Pi 4B 能通過 網絡線 提供電力啟動,方便在沒有鋪設電纜的位置以 網絡線 接駁即可啟動
(網絡線 能自行鋪設及比較安全)
但電力不能啟動太多額外配件或裝置

Raspberry Pi 4B 4GB RAM 底部

Micro SD Card 卡槽
卡糟不再使用按下彈出設計

支援最高 2TB Micro SD Card
額外配件
雖然 Raspberry Pi 4B 的硬件效能提升,但熱能亦增加有不少公司或創作者為 Raspberry Pi 設計及製作散熱配件

Raspberry Pi 4B 透明保護殼

Raspberry Pi 4B 透明保護殼的設計及生產公司 Vilros

原本風扇的線路與 Raspberry Pi 4B 的引腳距離太近,接駁後有機會令線路外露到保護殼外

因此在下重新配置風扇線路的方向,再將線路收合在風扇與保護殼之間,避免與其他物件拉扯而碰跌損壞

將風扇 接地引腳 接駁到 引腳6
電源引腳 接駁到 引腳1 為 慢速,引腳2 為 快速


連通電源後,風扇便會轉動,快速會比較噪吵
(即使 Raspberry Pi 已經關機,但只要仍然接駁電源,風扇還會轉動)

配件中還有散熱片


貼附在發熱零件上,增加表面面積幫助散熱

安裝所有配件的外觀


另一款保護殼配件,由鋁合金製作,比較堅硬


能安裝2扇風扇散熱

附送一支六角匙、8粒小螺絲、4粒大螺絲

將風扇安裝到保護殼

散熱貼

貼附在發熱零件上,由於保護殼本身就是一塊散發零件,可以借助保護殼散熱




安裝後的外觀

散熱貼會緊貼在保護殼底部幫助傳熱

由於風扇的電源線使用 2排插口不能分開,因此直接使用 引腳4 及 引腳6 作為 電源引腳 及 接地引腳


使用 3D Printer 印刷的底座


可以讓 Raspberry Pi 4B 穩定地直立放置
讓底部都有空間讓空氣流動,幫助散熱



兩種保護殼
由於鋁金屬保護殼同時使用兩個風扇,即使接駁 5V 速度不算太快,平均每個風扇只有 2.5V
而膠保護殼只有一個風扇,接駁 3.3V 已經很快,5V 會更快,但會比較嘈吵
軟件系統
設置好硬件後便到軟件先將 作業系統 寫入至 Micro SD Card
Raspberry Pi 官方網站提供不同版本、能夠在 Rasberry Pi 運作的 作業系統
可以到 https://www.raspberrypi.org/downloads 因應需要下載不同 作業系統,不同 作業系統 各有專長
- 由 Rapsberry Pi 官方提供的 Raspbian 是由 Debian 修改而來,分別有
如果是初學建議使用 圖像使用者界面版本,包含大量建議指令及軟件- Raspbian 桌面版,包含大量建議指令及軟件
- Raspbian 桌面版
- Raspbian 輕量版 (沒有桌面)
- 由 Ubuntu 官方提供
- Ubuntu Mate 桌面版 ,以 Mate 作為 桌面環境 的 Ubuntu
- Ubuntu 核心版 ,沒有桌面
- Ubuntu 伺服器版 ,沒有桌面,預裝及設置不同伺服器工具,亦為伺服器用途而改良
- 將 Raspberry Pi 當作 多媒體播放中心 的
都是預裝大量(網絡)多媒體播放工具,及整合遙控器模組,接駁熒幕後,播放媒體時更像使用電視機 - 不想使用基於 Debian 修改的 Linux發行版,可以使用基於 Fedora 的 Pidora (現在已改名為 Fedora Remix)
- 由 Mozilla 提供的 Mozilla WebThings 可以將 Raspberry Pi 當作網絡核心控制工具,遙距控制各種智能產品
- 教學用途的 PiNet
- 不想使用 Linux 可以選擇
- RISC OS Open
著重於硬件操作 - RaspBSD
修改自 FreeBSD 的一種 Unix 作業系統 - Windows IOT
Microsoft 專為物聯網平台而設計給 Raspberry Pi 的 Windows 版本,與平常的 Windows 不同
Windows IOT 必須依附在具備 Visual Studio 的 Windows 10 才能運作
- RISC OS Open
- 復古一點還可以使用 IchigoJam
一種執行 BASIC 的作業系統,好像使用 Commodore 64 - 除了 Raspberry Pi 推介使用的 作業系統
還有由大量 Raspberry Pi 支持者、貢獻者修改而成的 RetroPie 及 Lakka 將 Raspberry Pi 整合成 遊戲中心
預裝大量 復古遊戲機模擬器 及 Steam遊戲平台
(不包含模擬器的遊戲,需要使用者自行搜找及下載)
還有很多不同支援 Raspberry Pi 作業系統,大部分都是 使用 Linux發行版 為核心再修改,功能上其實都可以在寫入 Linux發行版 後再安裝
例如 Raspbian 可以安裝 VLC, Kodi 等多媒體播放軟件,再編寫控制 GPIO 程式接收遙控器訊號
不過對應功能的 Linux發行版 都預裝相對用途的軟件,並已經設定妥當,達至開機即使用
由於作業系統數量太多,在下不一一詳細提供,可以到 https://elinux.org/RPi_Distributions 尋找各種 Rasbperry Pi 作業系統
可能還有很多作業系統隱藏在網絡上,等待閣下發掘,甚至由在下發佈
在下選擇(泛用性)官方建議的 Raspbian 作為例子

正式啟動 Raspberry Pi 4B 時會有歡迎使用訊息
按 Next

由於 Raspberry Pi 是英國產品
預設地區、言語、時區分別為英國、英式英語、倫敦

設定地區、言語、時區,可以選用以英語、美式鍵盤為預設設定
按 Next

等待設定完成

Rasbperry Pi 4B 會建議將變更預設帳戶 pi 的密碼
由於 Raspberry Pi 預設帳戶 pi 的密碼必定為 raspberry 是公開資料,不變更會很大的安全問題,建議必須變更
按 Next

如果顯示畫面有黑邊,可以確認此設定,當重新啟動 Raspberry Pi 4B 後便不會再有黑邊
(圖片不會發現會有黑邊)
按 Next


Raspberry Pi 4B 會自動搜尋附近能夠使用的 Wi-Fi 訊號
如果沒有需要連接可以按 Skip ,需要連接按 Next

需要密碼連接 Wi-Fi
按 Next

等待連接完成

詢問是否需要更新 Raspberry Pi 4B 的資料
同樣,如果沒有需要連接可以按 Skip ,需要連接按 Next

等待更新完成

初始化設定完成後會詢問是否需要重新開機,在下建議稍後才重新開機
開啟 Terminal 輸入
sudo raspi-config
設定選單

- Change User Password Change password for the current user
修改使用者密碼 - Network Options Configure network settings
網絡選項設定 - Boot Options Configure options for start-up
起動選項設定 - Localisation Options Set up language and regional settings to match your location
地區選項設定 - Interfacing Options Configure connections to peripherals
介面選項設定 - Overclock Configure overclocking for your Pi
超頻選項設定 (Raspberry Pi 4B 不支援超頻) - Advanced Options Configure advanced settings
進階選項設定 - Update Update this tool to the latest version
更新 Raspberry Pi - About raspi-config Information about this configuration tool
關於 raspi-config 的資訊
修改使用者密碼



其實效果與 sudo passwd 相同
網絡選項設定

- Hostname Set the visible name for this Pi on a network
設定主機名稱 - Wi-fi Enter SSID and passphrase
設定 Wi-Fi - Network interface names Enable/Disable predictable network interface names
設定網絡界面名稱
設定主機名稱


方便不用記著 IP 地址存取 Raspberry Pi
設定 Wi-Fi

輸入需要連接的 Wi-Fi SSID

輸入對應 SSID 的 密碼
設定網絡界面名稱


變更 Linux 網絡界面名稱
網絡界面名稱 | 舊名稱 | 新名稱 |
---|---|---|
Loop | lo | lo |
Ethernet | eth* | en* |
Wireless | wlan* | wl* |
如果閣下主要使用 圖像使用者界面 及 沒有慣用名稱,其實沒有分別
起動選項設定

- Desktop / CLI Choose whether to boot into a desktop environment or the command line
起動環境 - Wait for Network at Boot Choose whether to wait for network connection during boot
網絡起動
是否等待網絡起動,不建議啟動 - Splash Screen Choose graphical splash screen or text boot
起動畫面
顯示有圖案的起動畫面,啟動或關閉不太影響
起動環境

- Console Text console, requiring user to login
使用 命名字元界面 ,需要選擇登入帳戶
(在下建議這種起動方式,比較安全,資源損耗亦較少) - Console Autologin Text console, automatically logged in as 'pi' user
使用 命名字元界面 ,自動登入 pi 帳戶 - Desktop Desktop GUI, requiring user to login
使用 圖像使用者界面 ,需要選擇登入帳戶 - Desktop Autologin Desktop GUI, automatically logged in as 'pi' user
使用 圖像使用者界面 ,自動登入 pi 帳戶
(預設起動方式,適合初用者)
地區選項設定

- Change Locale nguage and regional settings to match your location
變更語言設定 - Change Wi-fi Country Set the legal channels used in your country
變更 Wi-Fi 地區設定
(某些國家及地區使用 Wi-Fi 受法律限制) - Change Keyboard Layout Set the keyboard layout to match your keyboard
變更鍵盤設定 - Change Timezone Set up timezone to match your location
變更時區設定
變更語言設定


啟用需要使用的語言
在下需要使用中文及英文便足夠,因為只需要啟用 en-GB.UTF-8, en-HK.UTF-8, en-US.UTF-8, zh-HK.UTF-8, zh-TW.UTF-8
閣下有需要可以啟動其他語言

選擇啟用的其中一個項目作為預設語言
變更時區設定


選擇時區及地方
介面選項設定

- Camera Enable/Disable connection to the Raspberry Pi Camera
啟動或關閉 Raspberry Pi 鏡頭
有安裝 Raspberry Pi 鏡頭可以啟動使用 - SSH Enable/Disable remote command line access to your Pi using SSH
啟動或關閉 SSH 服務
建議啟動可以方便經 SSH 控制 Raspberry Pi - VNC Enable/Disable graphical remote access to your Pi using RealVNC
啟動或關閉 VNC 服務
建議啟動可以方便經 VNC 控制 Raspberry Pi
(預設 VNC 服務需要使用者進入 XWindow系統 才能有效,否則需要在 SSH 手動啟動 VNC伺服器) - SPI Enable/Disable automatic loading of SPI kernel module
啟動或關閉 SPI 核心模式
使用 GPIO 啟動或關閉 SPI 核心模式 - I2C Enable/Disable automatic loading of 12C kernel module
啟動或關閉 I2C 核心模式
使用 GPIO 啟動或關閉 I2C 核心模式 - Serial Enable/Disable shell and kernel messages on the serial connection
啟動或關閉 序列連接
使用 GPIO 啟動或關閉 序列連接 - 1-Wire Enable/Disable one-wire interface
啟動或關閉 1-Wire 界面
使用 GPIO 啟動或關閉 1-Wire 界面 - Remote GPIO Enable/Disable remote access to GPIO pins
啟動或關閉 遙距存取 GPIO
能直接遙距存取 GPIO ,如果使用 SSH 或 VNC 可以不使用


啟動 SSH


啟動 VNC
進階選項設定

- Expand Filesystem Ensures that all of the SD card storage is available to the os
將 檔案系統 延伸至整張 Micro SD 卡 - Overscan You may need to configure overscan if black bars are present on display
延伸顯示熒幕,避免出現黑邊 - Memory Split Change the amount of memory made available to the GPU
分配記憶體給 GPU - Audio Force audio out through HDMI or 3.5mm jack
強制使用 HDMI 或 3.5mm 插孔 輸出音效 - Resolution Set a specific screen resolution
設定 解像度 - Screen Blanking Enable/Disable screen blanking
啟用或關閉 畫面閃燦 - Pixel Doubling Enable/Disable 2x2 pixel mapping
將 每格像素以 2x2像素 再配對 - GL Driver Enable/Disable experimental desktop GL driver
啟用或關閉 GL 驅動
(能提供更佳 3D 效果,但暫時為實驗功能) - Compositor Enable/Disable xcompmgr composition manager
啟用或關閉 XCompMgr 視窗管理器,能以類似 Compiz 的桌面效果顯示 - Pi 4 Video Output Video output options for Pi 4
設定影像輸出,例如 4Kp60 HDMI 輸出、類比輸出等 - Overlay FS Enable/Disable read-only file system
啟用或關閉 Overylay FS
(是一種唯讀的虛偽檔案系統,避免系統意外關機導致資料遺失)
關於 raspi-config 的資訊

顯示關於 raspi-config 的資訊

當變更 raspi-config 中的某些項目,完成後會詢問是否需要重新開始
(部分項目需要重新開始才生效,例如:變更主機名稱)
遙距控制

重新開機後可以通過 SSH 連接到 Raspberry Pi


使用 VNC檢視器 登入 Rasberry Pi 的 VNC伺服器
最簡單是使用 Chrome 的擴充程式 VNC® Viewer for Google Chrome™
能夠跨平台使用,但必須使用 Google Chrome 瀏覽器 才能正常執行,基於 Google Chrome 瀏覽器 都不能正常執行
而 Google Chrome 瀏覽器 只有 64位元版本,若果是 32位元系統 請使用其他 VNC檢視器

開啟 VNC® Viewer for Google Chrome™
在 Address 輸入 Raspberry Pi 的 IP 或 主楆名稱(要加上 .local 表示內聯網絡)
Picture Quality 為 連接後的畫質,如果 網絡慢或不穩定 可以變更為 低質素

確認連接 VNC伺服器

輸入登入的 帳戶 及 密碼

由於在下沒有使用 XWindow系統,因此不能顯示 桌面

終止連接

網 SSH 連接到 Raspberry Pi 輸入
vncserver -RfbPort=5901以另一個桌面啟動 VNC伺服器 ,連接埠 使用 5901 避免與預設 VNC伺服器 衝突

在 Address 的內容加上 ::5901 (2個冒號)

確認連接 VNC伺服器

通過 VNC 連接到 Raspberry Pi ,但解像度只以 1024x768 顯示桌面
不過只是變更一些設定仍然足夠
基本上與在下的 Raspberry Pi 試用報告 相似,閣下可以自行安裝需要使用的軟件
使用時在下完全感受 Raspberry Pi 4B 4GB RAM 的效能提升
在下使用 FFmpeg 建立 60秒的 testsrc
s=`date "+%s"`; \ ffmpeg -y -f lavfi -i testsrc="duration=60:size=1920x1080:rate=30" "testsrc.mp4"; \ e=`date "+%s"`; \ echo $(($e-$s))


在下使用 Intel Core i7 處理器 與 Raspberry Pi 4B 的 CPU 比較,大約相差 12倍速度
(不過 Linux Mint 19.2 是使用 FFmpeg 3.4.6 , Raspbian 是使用 FFmpeg 4.1.4.1 效能上可能有少少分別)
相隔6年,Raspberry Pi 的軟件庫亦有更新,某些軟件設定上可能與過去有微少分別,但整體操作上都是相同,而且更方便
內置 Wi-Fi 同 藍牙 晶片,可以免除網絡線,接駁藍牙滑鼠及鍵盤等,減少更多線路接駁
感想
幾年前在下試用 Raspberry Pi B+ 基本上網、文書處理、玩一些舊遊戲還可以,有點耐性,還是可以使用不過與當時比較又有點不公平,當時 YouTube 仍未完全支援 HTML5 ,串流影片主要仍要使用 Flash
但 Adobe 沒有發佈支援 ARM 架構的 Flash播放器,而是需要使用第三方提供的 Flash播放器
之後 Raspberry Pi 2B+ 發佈, HTML5 已經面世,而且亦預裝較輕量的 Chromium ,不過雖然有 1GB RAM 但仍然有少少吃力
由於 Raspberry Pi 3 與 Raspberry Pi 2 沒有太大變化,因此在下並沒有購買
而 Raspberry Pi 4B 推出 4GB RAM 版本,對基本電腦操作,比文書電腦更順暢
而且在下正在學習 Arduino ,控制與 GPIO 相似,同樣有很多函式庫可以使用
沒有留言 :
張貼留言