SlideShare a Scribd company logo
1 of 3
Download to read offline
Before starting….
sudo apt-get update && sudo apt-get upgrade –y
sudo apt-get install python-rpi.gpio
sudo apt-get install libcurl4-openssl-dev

PIR (sensor)模組測試
mkdir PIR
cd PIR
wget –O – http://goo.gl/9C5n3 | tar -xvf sudo python pir_1.py
/**
*此處可依個人需求變更 pin
*另可設定 sensor setting 時間,預設為 3 秒
*/
PIR 偵測後傳送警告信件
sudo python PIR_sendmail.py
/**
*須設定個人信件地址
*預設 smtp 為 google 所提供,若使用不同信箱務必記得更改
*/
Webiopi
wget http://webiopi.googlecode.com/files/WebIOPi-0.6.0.tar.gz
tar xvzf WebIOPi-0.6.0.tar.gz
cd WebIOPi-0.6.0
sudo ./setup.sh
/**
* auto start webiopi at boot
*/
sudo update-rc.d webiopi defaults
/**
*使用方法
*http://IP:8000
*預設帳密為 webiopi, raspberry
*/
Raspberry Pi + PIR + webcam
wget http://www.raspberrypi-spy.co.uk/archive/python/pir_1.py
修改 Raspberry Pi Spy 所提供的 pir_1.py 如下,並記得存檔。
..
import time (新增下列兩行)

import os
import datetime
...
Previous_State=1 (新增下列五行)

dt = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
dt_filename = dt+".jpg"
fs_command = "fswebcam --background -d /dev/video0 "+dt_filename
print " ",fs_command
os.system(fs_command)
/**
*須設定 PIR pin number,預設為 PIN18
*以及使用 lsusb 確認 webcam 已讀取
*/
sudo python pir_1.py
Pipi pi

More Related Content

Viewers also liked

iCap Investment
iCap InvestmentiCap Investment
iCap Investmentbakaizh
 
The power of own cloud (sd)
The power of own cloud (sd)The power of own cloud (sd)
The power of own cloud (sd)arimayawulantara
 
Village theme marriage gurgaon
Village theme marriage gurgaon Village theme marriage gurgaon
Village theme marriage gurgaon Anant Bisht
 
Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月Eihiro Saishu
 
HermesDDS Service tw-v2.1
HermesDDS Service tw-v2.1HermesDDS Service tw-v2.1
HermesDDS Service tw-v2.1HermesDDS
 
Entrevista a clos gómez prandelli mundial de fifa 2014
Entrevista a clos gómez prandelli mundial de fifa 2014Entrevista a clos gómez prandelli mundial de fifa 2014
Entrevista a clos gómez prandelli mundial de fifa 2014Dr. Manuel Concepción
 
How to make cup ramen!!
How to make cup ramen!!How to make cup ramen!!
How to make cup ramen!!수종 이
 
4 apuntes empujes_de_suelos
4 apuntes empujes_de_suelos4 apuntes empujes_de_suelos
4 apuntes empujes_de_suelosalexluis70
 
China ultra high voltage equipment industry market forecast and investment st...
China ultra high voltage equipment industry market forecast and investment st...China ultra high voltage equipment industry market forecast and investment st...
China ultra high voltage equipment industry market forecast and investment st...Qianzhan Intelligence
 
China quality inspection industry development prospects and investment foreca...
China quality inspection industry development prospects and investment foreca...China quality inspection industry development prospects and investment foreca...
China quality inspection industry development prospects and investment foreca...Qianzhan Intelligence
 
BruBotics - Brussels Human Robotics Research Center
BruBotics - Brussels Human Robotics Research Center BruBotics - Brussels Human Robotics Research Center
BruBotics - Brussels Human Robotics Research Center Lennert Vierendeels
 
Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...
Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...
Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...E-Commerce Brasil
 

Viewers also liked (18)

iCap Investment
iCap InvestmentiCap Investment
iCap Investment
 
The power of own cloud (sd)
The power of own cloud (sd)The power of own cloud (sd)
The power of own cloud (sd)
 
Village theme marriage gurgaon
Village theme marriage gurgaon Village theme marriage gurgaon
Village theme marriage gurgaon
 
Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月
 
Justiceconcer
JusticeconcerJusticeconcer
Justiceconcer
 
X ref auto cad 2007-r2
X ref auto cad 2007-r2X ref auto cad 2007-r2
X ref auto cad 2007-r2
 
Thinking Concept
Thinking ConceptThinking Concept
Thinking Concept
 
Computer Forensic
Computer ForensicComputer Forensic
Computer Forensic
 
Resume Siripong E42
Resume Siripong E42Resume Siripong E42
Resume Siripong E42
 
Serving the Difference
Serving the DifferenceServing the Difference
Serving the Difference
 
HermesDDS Service tw-v2.1
HermesDDS Service tw-v2.1HermesDDS Service tw-v2.1
HermesDDS Service tw-v2.1
 
Entrevista a clos gómez prandelli mundial de fifa 2014
Entrevista a clos gómez prandelli mundial de fifa 2014Entrevista a clos gómez prandelli mundial de fifa 2014
Entrevista a clos gómez prandelli mundial de fifa 2014
 
How to make cup ramen!!
How to make cup ramen!!How to make cup ramen!!
How to make cup ramen!!
 
4 apuntes empujes_de_suelos
4 apuntes empujes_de_suelos4 apuntes empujes_de_suelos
4 apuntes empujes_de_suelos
 
China ultra high voltage equipment industry market forecast and investment st...
China ultra high voltage equipment industry market forecast and investment st...China ultra high voltage equipment industry market forecast and investment st...
China ultra high voltage equipment industry market forecast and investment st...
 
China quality inspection industry development prospects and investment foreca...
China quality inspection industry development prospects and investment foreca...China quality inspection industry development prospects and investment foreca...
China quality inspection industry development prospects and investment foreca...
 
BruBotics - Brussels Human Robotics Research Center
BruBotics - Brussels Human Robotics Research Center BruBotics - Brussels Human Robotics Research Center
BruBotics - Brussels Human Robotics Research Center
 
Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...
Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...
Palestra – o e commerce no contexto da crise potencialidades do mercado virtu...
 

Similar to Pipi pi

如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)Yanwei Liu
 
Android系统移植技术详解
Android系统移植技术详解Android系统移植技术详解
Android系统移植技术详解zzc89522
 
快快樂樂學 Scrapy
快快樂樂學 Scrapy快快樂樂學 Scrapy
快快樂樂學 Scrapyrecast203
 
使用Supervisor守护python进程
使用Supervisor守护python进程使用Supervisor守护python进程
使用Supervisor守护python进程果 果
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on praticeKenny (netman)
 
Python meetup 1
Python meetup 1Python meetup 1
Python meetup 1Vic Yang
 
X64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 newX64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 newYiwei Ma
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Yiwei Ma
 
Hadoop+spark實作
Hadoop+spark實作Hadoop+spark實作
Hadoop+spark實作FEG
 
Apache安装配置mod security
Apache安装配置mod securityApache安装配置mod security
Apache安装配置mod securityHuang Toby
 
康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)Yiwei Ma
 
Ruby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuRuby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuMarsZ Chen
 
Windows 環境下建構python 跑VMware API
Windows 環境下建構python 跑VMware API Windows 環境下建構python 跑VMware API
Windows 環境下建構python 跑VMware API 裝機安 Angelo
 
5, system admin
5, system admin5, system admin
5, system adminted-xu
 
U boot 程式碼打掃計畫
U boot 程式碼打掃計畫U boot 程式碼打掃計畫
U boot 程式碼打掃計畫Macpaul Lin
 
Puppet安装总结
Puppet安装总结Puppet安装总结
Puppet安装总结Yiwei Ma
 

Similar to Pipi pi (20)

如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
 
Android系统移植技术详解
Android系统移植技术详解Android系统移植技术详解
Android系统移植技术详解
 
快快樂樂學 Scrapy
快快樂樂學 Scrapy快快樂樂學 Scrapy
快快樂樂學 Scrapy
 
使用Supervisor守护python进程
使用Supervisor守护python进程使用Supervisor守护python进程
使用Supervisor守护python进程
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
 
Python meetup 1
Python meetup 1Python meetup 1
Python meetup 1
 
Linuxguide4f2e
Linuxguide4f2eLinuxguide4f2e
Linuxguide4f2e
 
LinuxGuide4F2E
LinuxGuide4F2ELinuxGuide4F2E
LinuxGuide4F2E
 
X64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 newX64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 new
 
How to setup mastodon in chinese
How to setup mastodon in chineseHow to setup mastodon in chinese
How to setup mastodon in chinese
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
 
Hadoop+spark實作
Hadoop+spark實作Hadoop+spark實作
Hadoop+spark實作
 
Apache安装配置mod security
Apache安装配置mod securityApache安装配置mod security
Apache安装配置mod security
 
康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)
 
Ruby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuRuby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for Ubuntu
 
Windows 環境下建構python 跑VMware API
Windows 環境下建構python 跑VMware API Windows 環境下建構python 跑VMware API
Windows 環境下建構python 跑VMware API
 
Git
GitGit
Git
 
5, system admin
5, system admin5, system admin
5, system admin
 
U boot 程式碼打掃計畫
U boot 程式碼打掃計畫U boot 程式碼打掃計畫
U boot 程式碼打掃計畫
 
Puppet安装总结
Puppet安装总结Puppet安装总结
Puppet安装总结
 

Pipi pi

  • 1. Before starting…. sudo apt-get update && sudo apt-get upgrade –y sudo apt-get install python-rpi.gpio sudo apt-get install libcurl4-openssl-dev PIR (sensor)模組測試 mkdir PIR cd PIR wget –O – http://goo.gl/9C5n3 | tar -xvf sudo python pir_1.py /** *此處可依個人需求變更 pin *另可設定 sensor setting 時間,預設為 3 秒 */ PIR 偵測後傳送警告信件 sudo python PIR_sendmail.py /** *須設定個人信件地址 *預設 smtp 為 google 所提供,若使用不同信箱務必記得更改 */ Webiopi wget http://webiopi.googlecode.com/files/WebIOPi-0.6.0.tar.gz tar xvzf WebIOPi-0.6.0.tar.gz cd WebIOPi-0.6.0 sudo ./setup.sh /** * auto start webiopi at boot */ sudo update-rc.d webiopi defaults /** *使用方法
  • 2. *http://IP:8000 *預設帳密為 webiopi, raspberry */ Raspberry Pi + PIR + webcam wget http://www.raspberrypi-spy.co.uk/archive/python/pir_1.py 修改 Raspberry Pi Spy 所提供的 pir_1.py 如下,並記得存檔。 .. import time (新增下列兩行) import os import datetime ... Previous_State=1 (新增下列五行) dt = datetime.datetime.now().strftime("%Y%m%d-%H%M%S") dt_filename = dt+".jpg" fs_command = "fswebcam --background -d /dev/video0 "+dt_filename print " ",fs_command os.system(fs_command) /** *須設定 PIR pin number,預設為 PIN18 *以及使用 lsusb 確認 webcam 已讀取 */ sudo python pir_1.py