電腦由過去只作為軍事工具,普及化成民用電子產品
由過去「一座」來形容的體積,變成「一部」的大小,甚至現代的電話已經具備一般電腦的功能,只有手掌般的大小
但大家有沒有想像到,電腦可以比電話還要小 ?
Raspberry Pi 就是這問題的答案,不過這不是唯一的答案
廢話不說太多,詳細資料請瀏覽 Raspberry Pi 的官方網站 http://www.raspberrypi.org/ 及 Raspberry Pi @ Wiki
往後的是在下的使用報告

Raspberry Pi Model B 設計圖

Raspberry Pi 盒底的 Raspberry Pi logo

Raspberry Pi 盒底的 Raspberry Pi 字樣


Raspberry Pi 開盒
盒中的 SHSD 卡不是附送品,只是盒中有一個安放一張 SD 的卡槽位置
盒蓋亦有提供可以安置 Raspberry Pi 機板的槽位,但槽位並沒有扣位

一塊 Raspberry Pi 機板正面

Raspberry Pi 機板上的 Raspberry Pi logo

1個 RJ45 插孔,2個 USB Type A 插孔

1個 RCA 視訊插孔,1個 3.5mm 聲音插孔

1個 Micro USB Type B 插孔

1個 HDMI Type A Full Size 插孔

Raspberry Pi 機板背面

1個 SD 卡插槽
Raspberry Pi 支持最多 32GB SD 卡

SD 卡上方有一個安全接觸設計,避免未將 SD 完全插入而開機發生問題

一個使用 Micro USB Type B 替手提裝置充電的變壓器
(不替指定牌子宣傳)

Raspberry Pi 能使用上限最大為 32GB 的 SD 卡
(不替指定牌子宣傳)

配置所有線路

ACT 綠色,SD 接駁狀態,閃動時為正進行 I/O
PWR 紅色,電源,不會閃動
FDX 綠色,網絡以 dulpux 狀態運作
LNK 綠色,網絡狀態,閃動時為正進行資料傳輸
100 橙色,網絡支持 100 Mbps 傳輸速度,網絡支持 10 Mbps 或以下時不亮光
前往 Raspberry Pi 的官方網站下載頁 http://www.raspberrypi.org/downloads
下載由官方提供的作業系統影像檔
Windows 可以利 http://sourceforge.net/projects/win32diskimager 寫影像檔寫入至 SD 卡
而 Linux, Solaris, Mac 等可以利用 dd 指令將影像檔寫入至 SD 卡
指令為
dd if=somewhere-the-image.img of=/dev/sdb bs=4M注意 /dev/sdb 不一定是閣下的 SD 位置,使用 dd 前先使用 df -h 或 fdisk -l 確認 SD 卡位置
另外 Mac 會使用 /dev/disk2 或 /dev/rdisk2 等位置
不論使用哪一種作業系統,執行前必先確定 SD 卡的位罝無誤,否則寫入錯誤會覆寫整個 drive
完成後會顯示類似以下資料
115+1 records in 115+1 records out 1939865600 bytes (1.9 GB) copied, 69.4531 s, 27.9 MB/s到 http://www.raspberrypi.org/downloads 下載由官方提供的適合於 ARM 上運行的 Linux 發行版
官方提供
Raspbian "wheezy", Soft-float Debian "wheezy", Arch Linux ARM, Pidora, RISC OS
在下使用 Raspbian "wheezy"

這是初始起動,完成基本載入程序後的畫面

選擇「1 Expand Filesystem」會詢問將整個系統延伸至整張 SD 卡
若選擇否,系統只有大約 4GB 空間,需要自行修改 Partition Size



選擇「2 Change User Password」會詢問設定預設使用者密碼
預設使用者名稱為 pi
預設使用者預設密碼為 raspberry

選擇「3 Enable Boot to Desktop」會詢問起動 Raspberry Pi 時自動起動至桌面環境

選擇「4 Internationalisation Options」會詢問設定使用者語言等資料




在下建議設定語言時,最少要安裝 en-US.UTF-8
其餘語言視乎閣下所使用的語言而安裝


設定時區,若不設定,會以英國為預設時區





設定 Keyboard Layout,一般操作上大都使用 Generic 105-key (Inti) PC + English USA Keyboard Layout
若不設定,會以 Generic 105-key (Inti) PC + English UK
若沒有特別的組合鍵操作調動,可使用 The default for the keyboard layout
Compose Key 是指為輸入字母時加上重音識別符,例如法文等,如不需要可選擇 No Compose Key
最後設定 Ctrl + Alt + Backspace 終止 X Server 的操作,預設為否
若完成設定錯誤,可以在正式運作時,以 root 修改 /etc/default/keyboard 的文件
將 XKBMODEL 及 XKBLAYOUT 分別設定成 pc105 及 us ,然後重新啟動電腦即可
因為 UK 與 US 是略有分別 (在下一開始選錯成 UK ,原來輸入「@」會變成其他符號,導致不能發送電子郵件及登入部分網站)

主要選項設定後,其餘選項若不特別設定都可以略過
完成設定後會詢問需要重新啟動系統


重新啟動系統後,若果沒有選擇自動起動至桌面環境,需要在文字介面中登入
登入系統後輸入 startx 便可以載入至圖像介面

於系統中所擷取的圖像
用後感:
Raspberry Pi Model B - 港幣300元 (Model A 為 港幣250元,但只有一個 USB Type A 插孔)
USB Type A Keyboard - 港幣90元 (其實可以用 Mini Keyboard 更適合亦更便值)
USB Type A Mouse - 港幣30元
建議使用藍芽 Keyboard 連 Mouse,可以節省一個 USB Type A 插孔
價錢大約 港幣130元,而 All in one Keyboard 大約 港幣150元
Micro USB Type A 變壓器 - 69元 (視乎牌子)
32 GB SD 卡 - 港幣149元 (視乎牌子)
只需要大約 港幣650元 就可以購買到 Raspberry Pi 基本的零件
若沒有 HDMI 插孔的電視機,一條 RCA 線約 港幣20元 (熟識電線結構可自行製作;相信能瀏覽在下的文章都有電視機吧?)
雖然 Raspberry Pi 的規格不高,但對於流動裝置卻毫不遜色
接駁電源至完全起動大約只需20秒,如果不使用圖像介面更只需要10秒左右
測試時,Raspberry Pi 連續運行大約7小時,運行期間全為設定,安裝軟件等操作,同時亦有瀏覽網頁
室內氣溫大概有33攝氏度(香港天文台公布當日最高氣溫),CPU表面都只有微暖感覺,大概只有40攝氏度
變壓器同樣也只是微暖感覺,長期運作會出現問題的機會都不大
對於作為一般文書用途,網絡操作,編程,簡單多媒體操作已經綽綽有餘

Raspberry Pi 所提供的 RCA 視訊插孔可以讓沒有 HDMI 的普通電視機亦能播放影像
不過解像度只有 656 x 416 ,而使用 HDMI 可以支援最高 1920 x 1080
Adobe 提供的 Flash Player 都沒有開放下載的 ARM 版本 (除了 PlayStore 下載版本)
代替方案是使用 Gnash 代替 Flash Player
輸入
sudo apt-get install gnash安裝
但 Gnash 始終不是 Flash Player 並不能完美播放閉源的 flash media 帶有 Flash 的網頁可能會比較慢
由於網路大部分所提供的通常都是 ix86 或 86_64 軟件包,都不能安裝,安裝特定軟件便需要以 tarball 方式安裝
Raspberry Pi 提供其中一種 Linux 是 Debian 的衍生版之一,因此能夠使用 apt-get 指令來下載、安裝、更新、刪除軟件
指令操作可能對於大部分使用者都敬而遠之,因此使用者可以先利用
sudo apt-get install synaptic安裝 synaptic軟件包管理器,讓安裝軟件時更加方便及簡單


透過 synaptic 在 search 中輸出文字,便可以搜尋符合文字的相關軟件包
搜尋甚至可以指定搜尋軟件包名稱
(軟件只提供連結,詳細資料請閣下自行到各軟件的網站查看,本文並不會一一詳細介紹)
大部分能於 Linux 執行的常用軟件,如

磁碟管理軟件 - Gnome Partition Editor (GParted)
輸入
sudo apt-get install gparted安裝
非常強大的磁碟管理軟件,操作上完全不會理會分割格式,便能進行格式化甚至執行分割表,能改變分割容量及複製分割


光碟製作與錄製軟件 - Brasero, Devede
輸入
sudo apt-get install brasero devede安裝
兩者都可以以虛擬光碟格式,如 ISO, bin+cue 檔輸出,以映像檔代替實體光碟
而 Devede 還可以製作 DVD 影音光碟的片頭清單




網頁瀏覽器軟件 - 預裝有 Midori 及 Debian 的 NetSurf,亦可以另外安裝 Iceweasel (Firefox for Debian), Chromium browser
分別輸入
sudo apt-get install iceweasel
sudo apt-get install chromium-browser或
輸入
sudo apt-get install iceweasel chromium-browser同時安裝
Iceweasel 兼容 Firefox 的 add-on
Chromium 兼容 Chrome 的 extension

電郵用戶端軟件 - Icedove (Thumberbird for Debian)
輸入
sudo apt-get install icedove安裝
與 Thunderbird 兼容,能代替 Outlook 的電郵用戶端軟件,新版本能夠加入 Exchange Server 的郵件


FTP用戶端軟件 - GNU FTP (TUI操作), FileZilla
輸入
sudo apt-get install ftp filezilla安裝
GNU FTP 是一種 TUI 執行的 FTP用戶端軟件,適合不使用 GUI 下進行 FTP 操作
強大,方便,操作簡單的 FTP用戶端軟件,支援直接拉放進行上載及下載,如有權限可進行伺服器的權限修改

BT用戶端軟件 - Transmission
輸入
sudo apt-get install transmission-gtk安裝
Linux 最常見的 BT用戶端軟件,介面、操作簡單


多國語言輸入法 - SCIM
輸入
sudo apt-get install scim-tables-zh安裝
SCIM 包含多種語系,例如安裝日語系 (scim-tables-jp)、法語系 (scim-tables-fr)
支援 Ctrl + Space 切換語系輸入法

即時通訊軟件 - Pidgin
輸入
sudo apt-get install scim-tables-zh安裝
Pidgin 集合多種即時通訊軟件如 MSN, ICQ, AIM 等,同時管理來個帳戶,甚至同時進行上線操作
由於 Skype 沒有提供 ARM 版本 (除了 AppStore 及 PlayStore 下載版本)
然而 Skype 提供 SkypeKit 讓使用者自行製作 Skype 但沒有開放原始碼

辦公室軟件 - LibreOffice
輸入
sudo apt-get install libreoffice-base libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-math libreoffice-writer安裝
簡單地輸入
sudo apt-get install libreoffice安裝亦可,不過有機會缺少安裝其中一個元件,視乎發行版對 LibreOffice 安裝的集合性而定,發行版通常不會安裝 libreoffice-base


編程軟件 - SciTE, Vim (TUI操作)
輸入
sudo apt-get install scite vim安裝
兩者都是 Linux 常見編程軟件,尤其 Vim 是 TUI 操作,可以附加不同的外掛元件輔助操作,進行開發不比 IDE 慢
而且 Vim 輕量,適合在硬件求要較低的 Raspberry Pi 上運行SciTE 是一個具有圖像介面的編程軟件,具備 語法突顯(Syntax highlighting)、語法摺疊(Folding)

版本控制軟件 - Git (TUI操作)
輸入
sudo apt-get install git安裝
由 Linux 開發者 Linus Torvalds 親自編程製作,以 C 編寫
原本 Git 是用作 Linux Kernel 的開發維護,現在是一種廣範使用的軟體開發版本控制軟件,純文字文件能進行差異比較
網絡上如 GitHub 都提供免費的 Git

相簿軟件 - ShotWell
輸入
sudo apt-get install shotwell安裝
是一種圖像及影片檔整合軟件,經設定後可自動滙入如相機、手提電話、網絡相簿等圖像及影片檔
支援 Flickr 及 Picasa ,可以進行同步處理,如上載、下載、更新名稱、描述等操作

多媒體處理軟件 - FFmpeg (TUI操作)
輸入
sudo apt-get install ffmpeg libavcodec-extra-53 libavdevice-extra-53 libavfilter-extra-2 libavformat-extra-53 libavutil-extra-51安裝
發行版有時不會使用最新的函式庫,需要指定函式庫軟件包版本
接近所有免費影片處理軟件背後都會使用 FFmpeg (或 Libav) 函式庫

影片處理軟件 - OpenShot, Pitivi
輸入
sudo apt-get install openshot pitivi安裝
OpenShot, Pitivi 都是 Linux 上非常實用的非線性影片處理軟件
能匯入大部分常用多媒體格式,視訊能進行片段漸入漸出、多重影片同步播放等電影特效

聲音處理軟件 - Audacity
輸入
sudo apt-get install audacity安裝
即使是大型錄音室都會使用 Audacity 其功能已經能夠應付不少聲音特效


圖像處理軟件 - GIMP, Inkscape
輸入
sudo apt-get install gimp inkscape安裝
發行版通常亦會提供 GIMP 的 plugins 會以 gimp-pluginname 的命名方式,安裝 GIMP 時可以一拼安裝
如
sudo apt-get install gimp-resynthesizerGIMP 修改圖像,Inkscape 繪製向量圖
GIMP 及 Inkscape 都能夠開啟 PDF 格式啟甚至編輯,但 Inkscape 的強大功能,能精細至 PDF 中每件元件亦能夠控制

多媒體播放軟件 - VLC
輸入
sudo apt-get install vlc安裝
支援 Real Time Streaming Protocol (RTSP) 能夠播放如即時攝錄鏡頭的影像
同時自身亦能夠運行 Real Time Messaging Protocol (RTMP) 能將如使用者桌面或視像鏡頭的影像傳送
VLC 亦是一種多媒體格式轉換軟件,是一種多功能多媒體操作軟件
桌面擷取軟件 - Scrot (TUI操作)
輸入
sudo apt-get install scrot安裝
輸入
scrot -d nn 為擷取延緩秒數,會在 n 秒後擷取桌面畫面








網頁伺服器 - Apache HTTP Server + MySQL Server + PHP
輸入
sudo apt-get install apache2 mysql-server php5 phpmyadmin安裝
傳統的 LAMP 使用 Linux 為作業系統,Apache HTTP Server,MySQL 為資料庫,PHP 為動態網頁語言,能以低成本架設網頁
資料庫管理還可以使用 phpMyAdmin 作為網頁操作界面
不過由於 Nginx (發音為 Engine X) 面世,穩定性及速度都比 Apache HTTP Server 更強,不少新架設的網站都轉用 Nginx

FTP伺服器 - vsftpd
輸入
sudo apt-get install vsftpd安裝
vsftpd 是一套安全、穩定、低使用量的 FTP 伺服器,vsftpd 只有一個配置文件 vsftpd.conf 及一個 daemon 檔案
配置文件是使用 conf 格式,以 key=value 方式配置,每行第一個字元為 # 便是注釋
每次修改配置文後輸入
sudo service vsftpd restart便可以執行新配置,非常簡單及方便
以上所提及的軟件,本身都能夠在各 Linux 發行版中找到,部分還是跨平台軟件,能在 Windows 與 Mac 中執行
Raspberry Pi 可以附加 Wifi USB Adapter



在下以某 Wifi USB Adapter 802.11g 54Mbps 測試

執行 Raspberry Pi 提供的 WiFi Config
Adapter 會顯示連接到的 WiFi USB Adapter 顯示 wlan0 的裝置 (不同的 port ,名稱會不同)
按下 Scan ,掃瞄附近可使用的 WiFi 訊號

找到附近可使用的 WiFi 訊號後,點選需要連接的 WiFi Access Point
若果不能以點選方式連接,便可到 WiFi Config 主版面,按下選單的 Network > Add


若果以點選方式進入設定畫面,SSID 會自動填上,若自行設定便需要指定 SSID 名稱
選擇合適的認證 (Authentication) 方法,然後輸入 WiFi Access Point 的密碼,按 Add


連接上 WiFi Access Point 後 Network 會顯示正在連接的 SSID,Current State 亦會顯示連接狀態
在 Terminal 以 ifconfig 查看網絡狀態,並測試能否上網



只要足夠電力 (5V) 利用充電器亦能啟動 Raspberry Pi




透過 RCA 接駁至小型顯示器便可以變成一組小型電腦組件
沒有留言 :
張貼留言