SlideShare une entreprise Scribd logo
1  sur  32
Raspberry Pi 3介紹
About Raspberry Pi
Raspberry Pi是一款基於Linux系統的只有一張信用卡大小
的單板機電腦
它由英國的Raspberry Pi Foundation 開發,目的是以低價
硬體及自由軟體刺激在學校的基本的電腦科學教育
2
Raspberry Pi 3
2016年2月29日發表
3
Pi 3 Hardware Spec.
SoC:BroadcomBCM2837(CPU,GPU DSP,SDRAM, USB)
CPU: Quad ARM Cortex A53 (ARMv8-A)@1.2GHz
GPU: Broadcom VideoCore IV@400MHz, OpenGL ES 2.0,
1080p 30 h.264/MPEG-4 AVC高畫質解碼器
RAM: 1 G SDRAM
內建 802.11n W-Fi + Bluetooth 4.0
Power: 5V 2.5A
Raspberry Pi 2/3 I/O Pin out
5
Raspberry Pi I/O 子板
https://goo.gl/M7A6i9 6
Raspberry Pi 基本操作
製作Pi 的 Image
• Step 1: 下載Pi image (RASPBIAN JESSIE)
• http://www.raspberrypi.org/downloads/
• Step 2: 在PC上 利用win32 Disk Imager工具將.img檔
寫入SD卡
SD Card內容
Pi’s Embedded Linux組成
Boot code
Linux Kernel
Root File system
Boot code
kernel
Root FileSystem
mmcblock0p1
/boot
mmcblock0p2
/
資料來源: https://goo.gl/VrjL9b
FAT32
EXT4
使用UART Console 登入Raspberry Pi Linux
紅色Raspberry Pi Shield上內建 USB-to-Serial (PL2303)晶片, 故可以用電腦透過
USB界面連接到Raspberry Pi
PL2303
USB Power (5V)
軟體安裝
Step1: 安裝 PL2303 Driver
Step2: 安裝 TeraTerm 終端機連線軟體
Step3: 終端機連線設定
Note:
Pi 3 須將/boot/config.txt 的檔案, 加入
core_freq=250
dtoverlay=pi3-miniuart-bt
enable_uart=1
打開 TeraTerm 軟體會看到連接埠的端口有
COMx(如下畫面)。 選擇連接埠端口 : COM3:
Prolific USB-to-Serial Comm Port 並按下 [確定]。
設定UART通訊參數 115200,8N1
終端機畫面
使用預設帳密登入
Username: pi
Password: raspberry
也可以使用putty
選擇 Serial
Speed: 11500
Serial Line: COM3
Linux 基本操作命令
ls -l <dir> # list 目錄內容
cd <dir> #改變工作目錄
pwd #顯示目前所在工作目錄位置
cp -a <src> <dst> #copy 檔案
mkdir <dir> # 產生目錄
rm -rf <dir> #刪除目錄(含子目錄)
cat <file> #顯示檔案內容
ln -s <src> <dst> #建立Softlink (捷徑)
unzip xxx.zip #解壓縮zip檔
tar zcvf xxx.tar.gz <dir> #製作tar.gz 壓縮包
tar zxvf xxx.tar.gz # 解tar.gz壓縮包
Linux 基本操作命令
ifconfig #檢視所有網路卡狀態
ping <ip> ; #確認是否可以連到某個ip ctrl+C 停止
passwd #變更登入密碼
passwd <user> #變更某User的登入密碼
whoami #顯示登入帳號
sudo <command> #以 root身份執行此命令
sudo apt-get install <package> # 線上安裝軟體套件
sudo reboot # Reset Pi
sudo shutdown -h now # 關機
ps -aux ; kill -9 <PID> #顯示系統上所有的執行程式
su #切換成root
ls -l / 顯示Linux 根目錄
如何傳檔案到Pi
用MobaXterm 簡單、好學、易用, 它具有終端機及SFTP
Client 的功能
• http://mobaxterm.mobatek.net/
Pi 的IP位址
SFTP
在PC上拖曳檔案
到這裡,即是傳送
Pi 需要SSH服務被啓動!
將MobaXterm 貼上的快速鍵改為習慣的 "Ctrl+V"
Pi組態工具: raspi-config
sudo raspi-config ; 設定完後reboot
開啓Pi的SSH功能
sudo raspi-config  進入[Interfacing
options] 將SSH 開啓
22
確認SSH服務啓動中
netstat -atn  啓動SSH後, TCP Port 22 應處於
Listen 狀態
允許root使用SSH 密碼登入
Normally ssh does not allow root access because this
is considered a security risk
作法:
sudo passwd root 設定root登入密碼
sudo nano /etc/ssh/sshd_config 
找到 “#PermitRootLogin without-password” , 改
成”PermitRootLogin yes”
設定Pi 3 Wi-Fi
# Site Survey (AP Scan)
sudo iwlist wlan0 scan
#連接AP
sudo raspi-config  進入[Network Options]Wi-Fi
修改Wi-Fi密碼或更多組Wi-Fi設定
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
離開 ctrl-X 存檔 Ctrl-O
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdev
update_config=1
network={
ssid="ittraining401"
psk="itstudent"
}
Wi-Fi 功能開關
# 停止Wi-Fi
sudo ifdown wlan0
# 啓用Wi-Fi
sudo ifup wlan0
You can verify if it has successfully connected using
ifconfig wlan0
Linux Wireless Tools
sudo iwconfig wlan0  確認連到的AP
Pi 校時
Synchronize and set computers’ date and time by
querying a Network Time Protocol (NTP) server
sudo apt-get install ntpdate
sudo ntpdate ntp.ubuntu.com
Pi 開機自動執行程式
在/etc/init.d 放上一個 Script, 並且可以執行你要執行的程式
/etc/init.d/myprogram start
/etc/init.d/myprogram stop
myprogram
sudo chmod +x myprogram
sudo cp pi-sensor/example/blink/gpio /bin/gpio
run at startup
加入: sudo update-rc.d myprogram defaults
移除: sudo update-rc.d –f myprogram remove
Useful Links
• https://www.raspberrypi.org
• BCM2835 Low-Level I/O Library
http://www.airspayce.com/mikem/bcm2835/
• BCM2835 DataSheet
• 用Raspberry Pi 學Linux 驅動程式開發
http://blog.ittraining.com.tw/2015/05/raspberry-pi-b-pi2-linux-gpio-button.html
• PIR感測電路應用設計
http://blog.ittraining.com.tw/2016/08/raspberry-pi-pir.html
• 用Raspberry Pi 學嵌入式系統開發
https://goo.gl/VrjL9b
• 用Raspberry Pi 學ARM Bootloader 程式開發
https://goo.gl/eNEuUk
• 艾鍗BLOG
http://blog.ittraining.com.tw/

Contenu connexe

Tendances

伺服馬達控制
伺服馬達控制伺服馬達控制
伺服馬達控制艾鍗科技
 
僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがないTakuya ASADA
 
Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統艾鍗科技
 
OSC2011 Tokyo/Spring 自宅SAN友の会(前半)
OSC2011 Tokyo/Spring 自宅SAN友の会(前半)OSC2011 Tokyo/Spring 自宅SAN友の会(前半)
OSC2011 Tokyo/Spring 自宅SAN友の会(前半)Satoshi Shimazaki
 
心電圖的研究和實作
心電圖的研究和實作心電圖的研究和實作
心電圖的研究和實作艾鍗科技
 
UEFIによるELFバイナリの起動
UEFIによるELFバイナリの起動UEFIによるELFバイナリの起動
UEFIによるELFバイナリの起動uchan_nos
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
一人でもNFC開発
一人でもNFC開発一人でもNFC開発
一人でもNFC開発Hirokuma Ueno
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
OpenWRT manual
OpenWRT manualOpenWRT manual
OpenWRT manualfosk
 
Linux : The Common Mailbox Framework
Linux : The Common Mailbox FrameworkLinux : The Common Mailbox Framework
Linux : The Common Mailbox FrameworkMr. Vengineer
 
BHyVeってなんや
BHyVeってなんやBHyVeってなんや
BHyVeってなんやTakuya ASADA
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例National Cheng Kung University
 
エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)
エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)
エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)Takeshi HASEGAWA
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Samsung Open Source Group
 

Tendances (20)

伺服馬達控制
伺服馬達控制伺服馬達控制
伺服馬達控制
 
僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない
 
Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統
 
OSC2011 Tokyo/Spring 自宅SAN友の会(前半)
OSC2011 Tokyo/Spring 自宅SAN友の会(前半)OSC2011 Tokyo/Spring 自宅SAN友の会(前半)
OSC2011 Tokyo/Spring 自宅SAN友の会(前半)
 
心電圖的研究和實作
心電圖的研究和實作心電圖的研究和實作
心電圖的研究和實作
 
UEFIによるELFバイナリの起動
UEFIによるELFバイナリの起動UEFIによるELFバイナリの起動
UEFIによるELFバイナリの起動
 
Rdma 1
Rdma 1Rdma 1
Rdma 1
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
Play with UEFI
Play with UEFIPlay with UEFI
Play with UEFI
 
Linux : PSCI
Linux : PSCILinux : PSCI
Linux : PSCI
 
Embedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile DevicesEmbedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile Devices
 
一人でもNFC開発
一人でもNFC開発一人でもNFC開発
一人でもNFC開発
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
OpenWRT manual
OpenWRT manualOpenWRT manual
OpenWRT manual
 
Linux : The Common Mailbox Framework
Linux : The Common Mailbox FrameworkLinux : The Common Mailbox Framework
Linux : The Common Mailbox Framework
 
BHyVeってなんや
BHyVeってなんやBHyVeってなんや
BHyVeってなんや
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
 
エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)
エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)
エンジニアなら知っておきたい「仮想マシン」のしくみ (BPStudy38)
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
 

Similaire à Raspberry pi 基本操作

Raspberry pi 基本操作
Raspberry pi 基本操作Raspberry pi 基本操作
Raspberry pi 基本操作艾鍗科技
 
Raspberry pi3 基本操作
Raspberry pi3 基本操作Raspberry pi3 基本操作
Raspberry pi3 基本操作學院 艾鍗
 
141118 Raspberry Pi 電鈴工作坊@松山文創園區
141118 Raspberry Pi 電鈴工作坊@松山文創園區141118 Raspberry Pi 電鈴工作坊@松山文創園區
141118 Raspberry Pi 電鈴工作坊@松山文創園區CAVEDU Education
 
讓 Asp.net 在 raspberry pi 上飛
讓 Asp.net 在 raspberry pi 上飛讓 Asp.net 在 raspberry pi 上飛
讓 Asp.net 在 raspberry pi 上飛dplayerd
 
[1]投影片 futurewad樹莓派研習會 141120
[1]投影片 futurewad樹莓派研習會 141120[1]投影片 futurewad樹莓派研習會 141120
[1]投影片 futurewad樹莓派研習會 141120CAVEDU Education
 
第11讲 管理Cisco互联网络
第11讲 管理Cisco互联网络第11讲 管理Cisco互联网络
第11讲 管理Cisco互联网络F.l. Yu
 
[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127CAVEDU Education
 
【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋
【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋
【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋MAKERPRO.cc
 
Linux期末 效能調教(kernel trnning)
Linux期末 效能調教(kernel trnning)Linux期末 效能調教(kernel trnning)
Linux期末 效能調教(kernel trnning)米米 林
 
利用Cent Os快速构建自己的发行版
利用Cent Os快速构建自己的发行版利用Cent Os快速构建自己的发行版
利用Cent Os快速构建自己的发行版xingsu1021
 
OpenRISC whsap
OpenRISC whsapOpenRISC whsap
OpenRISC whsap柏毅 李
 
Linux基础
Linux基础Linux基础
Linux基础zhuqling
 
Kick start无人值守批量安装linux
Kick start无人值守批量安装linuxKick start无人值守批量安装linux
Kick start无人值守批量安装linuxYiwei Ma
 
Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版redhat9
 
20030623 linuxbasic and-security
20030623 linuxbasic and-security20030623 linuxbasic and-security
20030623 linuxbasic and-security建融 黃
 
Puppet安装总结
Puppet安装总结Puppet安装总结
Puppet安装总结Yiwei Ma
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on praticeKenny (netman)
 

Similaire à Raspberry pi 基本操作 (20)

Raspberry pi 基本操作
Raspberry pi 基本操作Raspberry pi 基本操作
Raspberry pi 基本操作
 
Raspberry pi3 基本操作
Raspberry pi3 基本操作Raspberry pi3 基本操作
Raspberry pi3 基本操作
 
141118 Raspberry Pi 電鈴工作坊@松山文創園區
141118 Raspberry Pi 電鈴工作坊@松山文創園區141118 Raspberry Pi 電鈴工作坊@松山文創園區
141118 Raspberry Pi 電鈴工作坊@松山文創園區
 
讓 Asp.net 在 raspberry pi 上飛
讓 Asp.net 在 raspberry pi 上飛讓 Asp.net 在 raspberry pi 上飛
讓 Asp.net 在 raspberry pi 上飛
 
S4A
S4AS4A
S4A
 
[1]投影片 futurewad樹莓派研習會 141120
[1]投影片 futurewad樹莓派研習會 141120[1]投影片 futurewad樹莓派研習會 141120
[1]投影片 futurewad樹莓派研習會 141120
 
第11讲 管理Cisco互联网络
第11讲 管理Cisco互联网络第11讲 管理Cisco互联网络
第11讲 管理Cisco互联网络
 
[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127
 
【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋
【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋
【1006物聯網社群開講】Raspberry Pi + ROS = 實現無人自駕理念!_蕭盈璋
 
Linux期末 效能調教(kernel trnning)
Linux期末 效能調教(kernel trnning)Linux期末 效能調教(kernel trnning)
Linux期末 效能調教(kernel trnning)
 
Raspberry pi workshop
Raspberry pi workshopRaspberry pi workshop
Raspberry pi workshop
 
利用Cent Os快速构建自己的发行版
利用Cent Os快速构建自己的发行版利用Cent Os快速构建自己的发行版
利用Cent Os快速构建自己的发行版
 
OpenRISC whsap
OpenRISC whsapOpenRISC whsap
OpenRISC whsap
 
Linux基础
Linux基础Linux基础
Linux基础
 
Kick start无人值守批量安装linux
Kick start无人值守批量安装linuxKick start无人值守批量安装linux
Kick start无人值守批量安装linux
 
Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版
 
20030623 linuxbasic and-security
20030623 linuxbasic and-security20030623 linuxbasic and-security
20030623 linuxbasic and-security
 
Puppet安装总结
Puppet安装总结Puppet安装总结
Puppet安装总结
 
LinkIt 7697 IoT tutorial
LinkIt 7697 IoT tutorialLinkIt 7697 IoT tutorial
LinkIt 7697 IoT tutorial
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
 

Plus de 艾鍗科技

Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab艾鍗科技
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用艾鍗科技
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation艾鍗科技
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge艾鍗科技
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介艾鍗科技
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 艾鍗科技
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進艾鍗科技
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆艾鍗科技
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作艾鍗科技
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車艾鍗科技
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作 艾鍗科技
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車 艾鍗科技
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning艾鍗科技
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統艾鍗科技
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home艾鍗科技
 

Plus de 艾鍗科技 (20)

Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge
 
Openvino ncs2
Openvino ncs2Openvino ncs2
Openvino ncs2
 
Step motor
Step motorStep motor
Step motor
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron)
 
3. data features
3. data features3. data features
3. data features
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home
 
智能健身
智能健身智能健身
智能健身
 

Raspberry pi 基本操作