SlideShare a Scribd company logo
1 of 16
The recipe
Hardware Stack

• Raspberry Pi Model B (512 MB Ram)
• Raspberry Pi Camera Module (2 MP) or
any compatible USB Cam *
• Ethernet Cable
• Wifi dongle: Edimax EW-7811Un 150Mbps Wireless
• SD Card ( 4 GB ++)
The recipe
Software Stack

•
•
•
•
•
•

Raspbian OS
Node.js (v 0.10.2 +)
Python (V 2.7)
Shell Scripts
Twitter Stream API
Google Drive API
Downloading weapons
Node.js on Raspberry Pi: https://github.com/DonaldDerek/rPi-cheat-sheet
WARNING
coding mask on!
Connecting to your raspberry pi
ssh-ing

#Avahi Deamon should be installed
ssh pi@raspberrypi.local
#Static IP
shh pi@192.168.5.10

Usefull Links:
http://elinux.org/RPi_Advanced_Setup
* Testing USB Cam
Resurrecting ancient technologies

#Test USB Camera
Lsusb

#Take images from RaspberryPi USB Camera
fswebcam -d /dev/video0 -r 640x480 test.jpeg
Testing Rpi 2mp cam
Tiny yet amazing camera!

raspistill –o test.jpg -w 640 -h 480
WARNING
coding mask on!
App architecture
Where all your scripts belong

• node_modules/
• ntwitter/
• Request/
• bin/
• atom/
• gdata/
• gdrive.py
• images/
• App.js
• Config.js
• Controller.js
• Package.json
• tw-upload.js
Twitter stream api
The communication layer is built upon Twitter’s infrastructure
var twit = new twitter(config);

// Check Credentials
twit.verifyCredentials(function (err, data) {
if(err) console.log(err);
})
.stream('user', {track:watch}, function(stream) {
console.log("Twitter stream is ready and waiting for inc
tweets...")
stream.on('data', function (data) {
//Check if tweet is not empty
if (data.text !== undefined) {
//Action Code here
}

});
//Catch errors
stream.on('error', function (err, code) {
console.log("err: "+err+" "+code)
});
Child process
Control anything you can do in the terminal

child = exec("raspistill -o "+ image_path +" -w 640 -h 480",
function (err, stdout, stderr) {
//trigger another event
})
WARNING
coding mask on!
Google drive api
Light-weight python script
//Authenticate with Gdrive API
try:
docsclient.ClientLogin(username, password, docsclient.source);
except (gdata.client.BadAuthentication, gdata.client.Error), e:
sys.exit('Unknown Error: ' + str(e))
except:
sys.exit('Login Error, perhaps incorrect username/password')
print 'success!'

Resources: http://planzero.org/blog/2012/04/13/uploading_any_file_to_google_docs_with_python
WARNING
coding mask on!
May The Source be With you
https://github.com/DonaldDerek/GoogleBeam

DonaldDerek

DerekHaddad

rhamzeh

r_hamzeh

More Related Content

What's hot

What's hot (20)

Brewing ALE with Pi
Brewing ALE with PiBrewing ALE with Pi
Brewing ALE with Pi
 
What & How to Customize Android?
What & How to Customize Android?What & How to Customize Android?
What & How to Customize Android?
 
Raspberry Pi Using Python
Raspberry Pi Using PythonRaspberry Pi Using Python
Raspberry Pi Using Python
 
Raspberry Pi 3 + UART/Bluetooth issues
Raspberry Pi 3 + UART/Bluetooth issuesRaspberry Pi 3 + UART/Bluetooth issues
Raspberry Pi 3 + UART/Bluetooth issues
 
Raspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 updateRaspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 update
 
SPDK benchmark memo
SPDK benchmark memoSPDK benchmark memo
SPDK benchmark memo
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
 
Taking the BeagleBone Cookbook recipes beyond BeagleBone Black
Taking the BeagleBone Cookbook recipes beyond BeagleBone BlackTaking the BeagleBone Cookbook recipes beyond BeagleBone Black
Taking the BeagleBone Cookbook recipes beyond BeagleBone Black
 
State of the Art Telephony with Ruby
State of the Art Telephony with RubyState of the Art Telephony with Ruby
State of the Art Telephony with Ruby
 
Pharo VM Performance
Pharo VM PerformancePharo VM Performance
Pharo VM Performance
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Update from-build-workgroup
Update from-build-workgroupUpdate from-build-workgroup
Update from-build-workgroup
 
DCSF 19 eBPF Superpowers
DCSF 19 eBPF SuperpowersDCSF 19 eBPF Superpowers
DCSF 19 eBPF Superpowers
 
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
PiFlash: Linux utility to flash SD cards for Raspberry Pi computersPiFlash: Linux utility to flash SD cards for Raspberry Pi computers
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
 
The 12 tasks of Asterisk
The 12 tasks of AsteriskThe 12 tasks of Asterisk
The 12 tasks of Asterisk
 
Network Automation with Ansible
Network Automation with AnsibleNetwork Automation with Ansible
Network Automation with Ansible
 
Beagle board
Beagle boardBeagle board
Beagle board
 
Riot Games Scalable Data Warehouse Lecture at UCSB / UCLA
Riot Games Scalable Data Warehouse Lecture at UCSB / UCLARiot Games Scalable Data Warehouse Lecture at UCSB / UCLA
Riot Games Scalable Data Warehouse Lecture at UCSB / UCLA
 
Олександр Лінивий — Multisite platform with continuous delivery process for m...
Олександр Лінивий — Multisite platform with continuous delivery process for m...Олександр Лінивий — Multisite platform with continuous delivery process for m...
Олександр Лінивий — Multisite platform with continuous delivery process for m...
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 

Similar to Build the internet of things with Raspberry Pi!

Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer
Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer
Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer
Docker, Inc.
 

Similar to Build the internet of things with Raspberry Pi! (20)

My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
 
Travel with your mock server
Travel with your mock serverTravel with your mock server
Travel with your mock server
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Wso2 con raspberry-pi-cluster
Wso2 con raspberry-pi-clusterWso2 con raspberry-pi-cluster
Wso2 con raspberry-pi-cluster
 
INTRODUCTION TO RASPI
INTRODUCTION TO RASPIINTRODUCTION TO RASPI
INTRODUCTION TO RASPI
 
Smart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PISmart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PI
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Up and running with Raspberry Pi
Up and running with Raspberry PiUp and running with Raspberry Pi
Up and running with Raspberry Pi
 
Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
Raspberry Pi Technology
Raspberry Pi TechnologyRaspberry Pi Technology
Raspberry Pi Technology
 
Low Cost HD Surveillance Camera using Raspberry PI
Low Cost HD Surveillance Camera using Raspberry PILow Cost HD Surveillance Camera using Raspberry PI
Low Cost HD Surveillance Camera using Raspberry PI
 
Capstone_Project.ppt
Capstone_Project.pptCapstone_Project.ppt
Capstone_Project.ppt
 
Raspberry Pi 3 Tutorial | Raspberry Pi 3 Projects | IoT Projects | IoT Tutori...
Raspberry Pi 3 Tutorial | Raspberry Pi 3 Projects | IoT Projects | IoT Tutori...Raspberry Pi 3 Tutorial | Raspberry Pi 3 Projects | IoT Projects | IoT Tutori...
Raspberry Pi 3 Tutorial | Raspberry Pi 3 Projects | IoT Projects | IoT Tutori...
 
Develop Smart Solutions with Raspberry Pi and EnableX Live Video API
Develop Smart Solutions with Raspberry Pi and EnableX Live Video APIDevelop Smart Solutions with Raspberry Pi and EnableX Live Video API
Develop Smart Solutions with Raspberry Pi and EnableX Live Video API
 
Raspberry Pi Session - 22_11_2014
Raspberry Pi Session - 22_11_2014Raspberry Pi Session - 22_11_2014
Raspberry Pi Session - 22_11_2014
 
Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer
Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer
Building a Docker Swarm cluster on ARM by Dieter Reuter and Stefan Scherer
 
Raspberry pi intro.
Raspberry pi intro.Raspberry pi intro.
Raspberry pi intro.
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Raspberry Pi Introduction
Raspberry Pi IntroductionRaspberry Pi Introduction
Raspberry Pi Introduction
 

More from Donald Derek Haddad (6)

Getting Started with Google Cloud Technology
Getting Started with Google Cloud TechnologyGetting Started with Google Cloud Technology
Getting Started with Google Cloud Technology
 
Js revolution donald_derek
Js revolution donald_derekJs revolution donald_derek
Js revolution donald_derek
 
Build your own RasPiTV with Node.js & Socket.io
Build your own RasPiTV with Node.js & Socket.ioBuild your own RasPiTV with Node.js & Socket.io
Build your own RasPiTV with Node.js & Socket.io
 
The Dark Side of the Pi
The Dark Side of the PiThe Dark Side of the Pi
The Dark Side of the Pi
 
Google IO Extended - Build Your Own Google TV
Google IO Extended - Build Your Own Google TVGoogle IO Extended - Build Your Own Google TV
Google IO Extended - Build Your Own Google TV
 
The Javascript Revolution
The Javascript RevolutionThe Javascript Revolution
The Javascript Revolution
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Build the internet of things with Raspberry Pi!

  • 1.
  • 2. The recipe Hardware Stack • Raspberry Pi Model B (512 MB Ram) • Raspberry Pi Camera Module (2 MP) or any compatible USB Cam * • Ethernet Cable • Wifi dongle: Edimax EW-7811Un 150Mbps Wireless • SD Card ( 4 GB ++)
  • 3. The recipe Software Stack • • • • • • Raspbian OS Node.js (v 0.10.2 +) Python (V 2.7) Shell Scripts Twitter Stream API Google Drive API
  • 4. Downloading weapons Node.js on Raspberry Pi: https://github.com/DonaldDerek/rPi-cheat-sheet
  • 6. Connecting to your raspberry pi ssh-ing #Avahi Deamon should be installed ssh pi@raspberrypi.local #Static IP shh pi@192.168.5.10 Usefull Links: http://elinux.org/RPi_Advanced_Setup
  • 7. * Testing USB Cam Resurrecting ancient technologies #Test USB Camera Lsusb #Take images from RaspberryPi USB Camera fswebcam -d /dev/video0 -r 640x480 test.jpeg
  • 8. Testing Rpi 2mp cam Tiny yet amazing camera! raspistill –o test.jpg -w 640 -h 480
  • 10. App architecture Where all your scripts belong • node_modules/ • ntwitter/ • Request/ • bin/ • atom/ • gdata/ • gdrive.py • images/ • App.js • Config.js • Controller.js • Package.json • tw-upload.js
  • 11. Twitter stream api The communication layer is built upon Twitter’s infrastructure var twit = new twitter(config); // Check Credentials twit.verifyCredentials(function (err, data) { if(err) console.log(err); }) .stream('user', {track:watch}, function(stream) { console.log("Twitter stream is ready and waiting for inc tweets...") stream.on('data', function (data) { //Check if tweet is not empty if (data.text !== undefined) { //Action Code here } }); //Catch errors stream.on('error', function (err, code) { console.log("err: "+err+" "+code) });
  • 12. Child process Control anything you can do in the terminal child = exec("raspistill -o "+ image_path +" -w 640 -h 480", function (err, stdout, stderr) { //trigger another event })
  • 14. Google drive api Light-weight python script //Authenticate with Gdrive API try: docsclient.ClientLogin(username, password, docsclient.source); except (gdata.client.BadAuthentication, gdata.client.Error), e: sys.exit('Unknown Error: ' + str(e)) except: sys.exit('Login Error, perhaps incorrect username/password') print 'success!' Resources: http://planzero.org/blog/2012/04/13/uploading_any_file_to_google_docs_with_python
  • 16. May The Source be With you https://github.com/DonaldDerek/GoogleBeam DonaldDerek DerekHaddad rhamzeh r_hamzeh