Top Banner
Raspberry Pi 電電電電電 14/11/18 @ 電電電電電電 1
47

141118 Raspberry Pi 電鈴工作坊@松山文創園區

Apr 21, 2017

Download

Devices & Hardware

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Raspberry Pi 電鈴工作坊14/11/18 @ 松山文創園區

1

Page 2: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

提供優質服務Total Solution Provider

Page 3: 141118 Raspberry Pi 電鈴工作坊@松山文創園區
Page 4: 141118 Raspberry Pi 電鈴工作坊@松山文創園區
Page 5: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

哪裡看得到我們?各式研習

使用者聚會共創空間

機器人競賽

Page 6: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

6

以 Python為主要程式語言的電腦主機板

PiRaspberry

Page 7: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Rpi 和 Arduino 有什麼不一樣• 完整的電腦, PC 可以作的事情都做得到,不過比較慢。• 可在 Rpi 上編寫各種程式

• 微控制器 only

• 只能接受電腦端寫好的程式,且一次只能存放一個程式

7

Page 8: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

MagPi 免費雜誌( 有 iOS 版 )

8

Page 11: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

硬體配置 – Model B

11

Page 12: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

12

Page 13: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

分成 model A / Bmodel A 沒有實體網路孔

13

Page 14: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

硬體規格• SoC Broadcom BCM2835

(CPU, GPU, DSP, and SDRAM)

• CPU: 700 MHz ARM1176JZF-S core (ARM11 family)

• GPU: Broadcom VideoCore IV, OpenGL ES 2.0, 1080p30 h.264/MPEG-4 AVC high-profile decoder

• Memory (SDRAM): 512 Megabytes

• Video outputs: Composite RCA, HDMI

• Audio outputs: 3.5 mm jack, HDMI

• Onboard storage: SD, MMC, SDIO card slot

• 10/100 Ethernet RJ45 onboard network

• Storage via SD/ MMC/ SDIO card slot

14

Page 15: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

作業系統• Raspberry Pi 使用 Linux 核心的作業系統• 例如 Raspbian 就是一套修改自 Debian且針對 Raspberry Pi 硬體做最佳化的系統,也是官方所推薦的作業系統• 第三代樂高機器人 EV3 的韌體也是 Linux

15

Page 16: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

其他可安裝於 Rpi 的作業系統• Android 4.0(Ice

Cream Sandwich)• Arch Linux ARM• Debian Squeeze• Firefox OS• Gentoo Linux• Google Chrome OS• Raspberry Pi

Fedora Remix

• Raspbian• Slackware ARM• QtonPi• Slackware ARM• WebOS• RISC OS• FreeBSD• NetBSD…

16

Page 17: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Rpi 擴充板有哪些1. Slice of Pi2. Pi Plate3. Gertboard

(powerful)4. BrickPi

• 延伸並保護 Rpi 的GPIO

• 更多腳位• 有小型的原型製作區• 搭配 Arduino / LEGO 周邊

17

Page 18: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Slice of Pi / Ciseco

18

Page 19: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Pi Plate / Adafruit

19

Page 20: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Gertboard / Fen Logic

20

Page 21: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

獨立排線連接

21

Page 22: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Brick Pi 結合樂高機器人套件/ Dexter Industries

22

Page 23: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Session 1: Raspberry Pi Setup

Video: Raspberry Pi Starts up….

http://youtu.be/e7x-yjZwY_E

23

Page 24: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

系統安裝

24

Page 25: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

所需周邊配備

25

Page 26: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

在 SD 記憶卡上安裝映像檔• Windows 所需軟體– Win32DiskImager( 燒錄映像檔的軟體 )– 2013-02-09-wheezy-raspbian.zip( 作業系統映像檔 )

• 下載點– http://www.raspberrypi.org/downloads

26

Page 27: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

燒錄程序

27

1. 選取映像檔

2. 寫入 SD

Page 28: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

開機• 電源插上去就開機,沒有另外的硬體開關,所以只要拔掉電源來關機。• 預設帳號密碼: pi / raspberry

28

Page 29: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

開機完成• pi :現在的帳戶名稱• raspberrypi :電腦名稱• 現在您是是在個人帳戶的家目錄 home

29

Page 30: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

測試音效http://www.raspberrypi-spy.co.uk/2012/06/raspberry-pi-speakers-analog-sound-test/• 音效輸出預設為自動模式,你可以底下指令指定之。

$ sudo amixer cset numid=3 n

n 可以是 0 、 1 、 2 。0 :自動1 :耳機插座2 : HDMI

• Test1:– rpi 裡有些範例程式,請以底下指令編譯:

$ cd /opt/vc/src/hello_pi/$ ./rebuild.sh$ cd hello_audio

然後,就能執行並發出 " 嗚嗚 " 聲。./hello_audio.bin

30

Page 31: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

取得網路檔案• Test2:

$ sudo wget http://www.freespecialeffects.co.uk/soundfx/sirens/police_s.wav ( 檔案位址 )

$ sudo aplay police_s.wav

31

Page 32: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Session 2: Linux 基本指令集• 玩 Linux 不一定需要 GUI ,使用

terminal 就可以了。• 熱門的 Linux 版本有 Ubuntu 、 SUSE與 CentOS 或 ezgo 等。• 要入門的話請參考鳥哥的Linux私房菜,大

家都是從這裡長大的。

32

Page 33: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

root• root 就是這台電腦上的最高權限者,也就是管理員• 意義為根目錄,所以也就是 /

33

Page 34: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

常用指令• ls :列出現在資料夾內容• cd directory :跳移到指定資料夾• pwd :列出絕對路徑• startx :啟動桌面環境• nano 文件檔:編輯文件 • man 指令名稱:取得說明• sudo shutdown –h now :關機• sudo reboot :重開機

34

Page 35: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

安裝軟體 apt-get• sudo apt-get install “name”• 安裝– $ sudo apt-get install xpdf

• 移除– $ sudo apt-get purge xpdf

• sudo super user do ,因為安裝 /移除軟體需要 root 權限。大部分的操作其實都不需要 root 。35

Page 36: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

Update / Upgrade• To update the repository database on

your Rpi$ sudo apt-get update

• To update all current packages with the latest version ,需要時間較長$ sudo apt-get upgrade

• 清除畫面$ clear

36

Page 37: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

找不到軟體怎麼辦? apt-file• 先安裝– $ sudo apt-get install apt-file

• 搜尋– $ apt-file search evince

37

Page 38: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

桌面與遠端連線

38

Page 40: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

如何知道 Pi 的 ip(floating ip)• pi@raspberrypi ~ $ ifconfig

40

Page 41: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

登入 LXTerminal 和 x11• 登入 LXTerminal(pi 的文字介面 )─〉使用

putty 軟體的 ssh• 登入 X11(pi 的視窗介面 ) ─〉使用

Windows 的遠端 連線

41

Page 42: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

遠端登入 Pi 的文字介面• 若您想利用 SSH 來登入 Pi ,首先您必須使用 raspi-config , 將 Pi 上的 SSH

server 選項設定為開啟。pi@raspberrypi ~ $ sudo raspi-config

之後,重開機pi@raspberrypi ~ $ sudo reboot

42

Page 43: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

在 windows 使用 Putty 軟體

43

Page 44: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

在 putty介面,以 SSH 連線來登入 Pi

44

Page 46: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

傳遞檔案 winscp• 下載點 :• http://winscp.net/eng/download.php

46

Page 47: 141118 Raspberry Pi 電鈴工作坊@松山文創園區

利用 WiFi Config 來設定 WiFi 組態