SlideShare a Scribd company logo
1 of 28
RaspberryPi + IoT
Small presentation and GPIO Lab
About me…
@jeffprestes
Developer Advocate
Java, PHP, JavaScript Developer
Agenda
 What is not IoT
 What is IoT
 Polymath required skills
 Differences between Arduino and Single Board Computers
 Small history of RaspberryPi
 RaspberryPi Components and slots
 Raspbian – a Debian/Linux to RasberryPi
 Configure WiFi network (static / dhcp / resolv.conf)
 Upgrade the Raspbian
 Install WiringPi
 Install WebIOPi
 Install Java for Embedded devices
This is not IoT… (IMHO)
This is so cool but this is Eletronic!!
And this is not new…
(who has gray hair can say… P)
What is IoT?
Internet
Million of Web
Services
(PayPal, Twitter,
Google, Netflix,
Facebook)
Things
Billions of sensors,
motors, displays,
appliances, toys,
cars, stores, robots
+
And to work with IoT you’re going
to need more skills
You’re going to need to a Polimath
A polymath (Greek: πολυμαθής, polymathēs,
"having learned much")[1] is a person whose
expertise spans a significant number of different
subject areas; such a person is known to draw
on complex bodies of knowledge to solve
specific problems. The term was first used in the
seventeenth century; the related term,
polyhistor, is an ancient term with similar
meaning.
(Source: Wikipedia - http://en.wikipedia.org/wiki/Polymath)
Italian Polymath. What was da Vinci? Scientist?
Engineer? Mathematic? Painter? Sculptor? Musician?
Botanic? Anatomist?
Source: Wikipedia - http://en.wikipedia.org/wiki/Leonardo_da_Vinci
Server Side
Eletronic
(sometimes mechanic
and sculptor on wood or iron)
Client/Desktop
Mobile
(Beacons e Weareables)
Operation Systems
Arduino is a microcontroller board
Single Board Computer, SBC, as Raspberry Pi, is a complete computer
built on single circuit board with microprocessor, memory, input/output (I/O)
and other features required of a funcional computer
History
 Designed in UK, University of
Cambridge, 2006, to be a chip alternative
to computers to students. Also a way to
students rediscover how cool is to work
with Robotic.
It has been projected to educational
purposes but can used in Commercial
ones too.
 Team that have concepted it: Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft
 Raspberry Pi Foundation was created and first alpha boards were tested, 2011
 Sells begins April, 2012
 Model B+ is released in November, 2012
 More than 5 Million already have been sold
Raspbian is an unofficial port of Debian Wheezy armhf with compilation settings
adjusted to produce optimized "hard float" code that will run on the Raspberry Pi.
Note: Raspbian is not affiliated with the Raspberry Pi Foundation. Raspbian was created by a small,
dedicated team of developers that are fans of the Raspberry Pi hardware, the educational goals of the
Raspberry Pi Foundation and, of course, the Debian Project.
Best OS to Raspberry Pi nowadays. If you use Ubuntu, you’re going to feeling in
home. All basic Unix commands works on it and almost all basic server-side too:
Apache, Nginx, PHP, Java, Python, MySQL
Default user: pi / Default password: raspberry
And never forget: sudo apt-get install and be happy :D
To install it in your MicroSD card (Recommend 8Gb or more)
http://www.raspberrypi.org/documentation/installation/installing-images
Configure your wifi credentials:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
(file content below)
network={
ssid="iPhone"
psk="43070720"
}
network={
ssid=”<<your-wifi-name-here>>"
psk=”<<your-wifi-password>>"
}
network={
ssid="BoxNet"
psk="hackkitty"
}
Configure your wifi network using static IP:
sudo nano /etc/network/interfaces
(file content below)
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.218
netmask 255.255.255.0
gateway 192.168.0.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
Configure your wifi network using DHCP (most used):
sudo nano /etc/network/interfaces
(file content below)
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot
//Use Reboot to restart Raspbian safetly
sudo halt
//Use halt to turn off Raspbian safetly
Wiring Pi
It is GPIO Interface library for the Raspberry Pi. It’s written in C for the
BCM2835 used in the Raspberry Pi.
WiringPi includes a command-line utility gpio which can be used to
program and setup the GPIO pins.
Wiring Pi
sudo apt-get install git-core
git clone git://git.drogon.net/wiringPi
cd wiringPi
git pull origin
./build
Installation
gpio -v
gpio readall
Test
WebIOPi
Written in Python, with facilities to load and execute custom script, using a
comprehensive structure with setup and loop functions. Also come with Web
interface to GPIO
Get back to your user home directory
(in this case you’re using pi user, remember?)
cd ~/
WebIOPi
wget http://downloads.sourceforge.net/project/webiopi/WebIOPi-
0.7.1.tar.gz
tar xvzf WebIOPi-0.7.1.tar.gz
cd WebIOPi-0.7.1
sudo ./setup.sh
Installation
sudo /etc/init.d/webiopi start
Access via browser: http://<your-raspberrypi-ip>:8000/
Default user: webiopi / Default pwd: raspberry
Test
Our Lab: Turn on/off bulb
Our Lab: Turn on/off bulb
sudo gpio mode 1 output
sudo gpio write 1 1
sudo gpio write 1 0
Access the http://<raspberrypi-ip>:8000/
User: webiopi
Password: raspberry
Thanks.
Jeff Prestes
@jeffprestes
Slideshare.com/jeffprestes
Github.com/jeffprestes
@paypaldev
developer.paypal.com
developers.braintreepayments.com

More Related Content

What's hot

What's hot (20)

Rasp berry Pi
Rasp berry PiRasp berry Pi
Rasp berry Pi
 
Raspberry-PI introduction
Raspberry-PI introductionRaspberry-PI introduction
Raspberry-PI introduction
 
Raspberrypi best ppt
Raspberrypi best ppt Raspberrypi best ppt
Raspberrypi best ppt
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
A seminar report on Raspberry Pi
A seminar report on Raspberry PiA seminar report on Raspberry Pi
A seminar report on Raspberry Pi
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Rasberry pi
 Rasberry pi Rasberry pi
Rasberry pi
 
Raspberry pi technology
Raspberry pi technologyRaspberry pi technology
Raspberry pi technology
 
Presentation on Raspberry pi
Presentation on Raspberry piPresentation on Raspberry pi
Presentation on Raspberry pi
 
Simple Presentation On Raspberry pi
Simple Presentation On Raspberry piSimple Presentation On Raspberry pi
Simple Presentation On Raspberry pi
 
Raspberry Pi
 Raspberry Pi  Raspberry Pi
Raspberry Pi
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Raspberry Pi Introduction
Raspberry Pi IntroductionRaspberry Pi Introduction
Raspberry Pi Introduction
 
Raspberry Pi Session - 22_11_2014
Raspberry Pi Session - 22_11_2014Raspberry Pi Session - 22_11_2014
Raspberry Pi Session - 22_11_2014
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Presentation on Raspberry Pi by Sazzad H. IIUC
Presentation on Raspberry Pi by Sazzad H. IIUCPresentation on Raspberry Pi by Sazzad H. IIUC
Presentation on Raspberry Pi by Sazzad H. IIUC
 
Raspberry Pi in Education (English)
Raspberry Pi in Education (English)Raspberry Pi in Education (English)
Raspberry Pi in Education (English)
 
Getting Started with Raspberry Pi
Getting Started with Raspberry PiGetting Started with Raspberry Pi
Getting Started with Raspberry Pi
 
Raspberry pi intro workshop
Raspberry pi intro workshopRaspberry pi intro workshop
Raspberry pi intro workshop
 
Raspberry-Pi
Raspberry-PiRaspberry-Pi
Raspberry-Pi
 

Viewers also liked

IoT - IT 423 ppt
IoT - IT 423 pptIoT - IT 423 ppt
IoT - IT 423 ppt
Mhae Lyn
 
BPF-Delivering-the-Goods-Dec-15-web
BPF-Delivering-the-Goods-Dec-15-webBPF-Delivering-the-Goods-Dec-15-web
BPF-Delivering-the-Goods-Dec-15-web
David Smith
 
Secure Programming With Static Analysis
Secure Programming With Static AnalysisSecure Programming With Static Analysis
Secure Programming With Static Analysis
ConSanFrancisco123
 
Dinerware Software Guide
Dinerware Software GuideDinerware Software Guide
Dinerware Software Guide
bethhaldane
 

Viewers also liked (18)

Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending MachineJava Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
 
IoT - IT 423 ppt
IoT - IT 423 pptIoT - IT 423 ppt
IoT - IT 423 ppt
 
Birthday Scraps I Orkutjunks
Birthday Scraps I OrkutjunksBirthday Scraps I Orkutjunks
Birthday Scraps I Orkutjunks
 
Happy birthday images
Happy birthday imagesHappy birthday images
Happy birthday images
 
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick NeshRaspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
 
SENSIO Technologies Corporate Presentation May 2011
SENSIO Technologies Corporate Presentation  May 2011SENSIO Technologies Corporate Presentation  May 2011
SENSIO Technologies Corporate Presentation May 2011
 
Programming languages shape computational thinking
Programming languages shape computational thinkingProgramming languages shape computational thinking
Programming languages shape computational thinking
 
GaneData Company Presentation
GaneData Company Presentation GaneData Company Presentation
GaneData Company Presentation
 
BPF-Delivering-the-Goods-Dec-15-web
BPF-Delivering-the-Goods-Dec-15-webBPF-Delivering-the-Goods-Dec-15-web
BPF-Delivering-the-Goods-Dec-15-web
 
Social and Cloud Marketing Impact on Businesses
Social and Cloud Marketing Impact on BusinessesSocial and Cloud Marketing Impact on Businesses
Social and Cloud Marketing Impact on Businesses
 
Consumer Goods Companies’ IT Investments
Consumer Goods Companies’ IT InvestmentsConsumer Goods Companies’ IT Investments
Consumer Goods Companies’ IT Investments
 
Secure Programming With Static Analysis
Secure Programming With Static AnalysisSecure Programming With Static Analysis
Secure Programming With Static Analysis
 
Facebook Messenger and Go
Facebook Messenger and GoFacebook Messenger and Go
Facebook Messenger and Go
 
Dinerware Software Guide
Dinerware Software GuideDinerware Software Guide
Dinerware Software Guide
 
Programme Paris Retail Week 2016
Programme Paris Retail Week 2016Programme Paris Retail Week 2016
Programme Paris Retail Week 2016
 
XDS - Cross-Enterprise Document Sharing
XDS - Cross-Enterprise Document SharingXDS - Cross-Enterprise Document Sharing
XDS - Cross-Enterprise Document Sharing
 
Plant monitoring 101
Plant monitoring 101Plant monitoring 101
Plant monitoring 101
 
Will SCADA Systems Survive? The Future of Distributed Management Systems
Will SCADA Systems Survive? The Future of Distributed Management SystemsWill SCADA Systems Survive? The Future of Distributed Management Systems
Will SCADA Systems Survive? The Future of Distributed Management Systems
 

Similar to RaspberryPi + IoT - Lab to switch on and off a light bulb

Internet of things aktu lab file
Internet of things  aktu lab fileInternet of things  aktu lab file
Internet of things aktu lab file
Nitesh Dubey
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMoore
Benjamin Moore
 

Similar to RaspberryPi + IoT - Lab to switch on and off a light bulb (20)

Building your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry PiBuilding your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry Pi
 
How to make your Money Machine with Internet of Things
How to make your Money Machine with Internet of ThingsHow to make your Money Machine with Internet of Things
How to make your Money Machine with Internet of Things
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your LibraryRaspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
 
Raspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software SetupRaspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software Setup
 
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
 
Coffee & Pi - Fall into Pi
Coffee & Pi - Fall into PiCoffee & Pi - Fall into Pi
Coffee & Pi - Fall into Pi
 
Raspberry pi intro.
Raspberry pi intro.Raspberry pi intro.
Raspberry pi intro.
 
A futuristic approach for towerless mobile networks wheezy pi
A futuristic approach for towerless mobile networks wheezy piA futuristic approach for towerless mobile networks wheezy pi
A futuristic approach for towerless mobile networks wheezy pi
 
Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Iot lab manual new
Iot lab manual newIot lab manual new
Iot lab manual new
 
Raaaaassspberry pi
Raaaaassspberry piRaaaaassspberry pi
Raaaaassspberry pi
 
Raspberry Pi introduction
Raspberry Pi introductionRaspberry Pi introduction
Raspberry Pi introduction
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 
Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101
 
Internet of things aktu lab file
Internet of things  aktu lab fileInternet of things  aktu lab file
Internet of things aktu lab file
 
Artificial Intelligence Neural Processing Unit Hikey970
Artificial Intelligence Neural Processing Unit Hikey970Artificial Intelligence Neural Processing Unit Hikey970
Artificial Intelligence Neural Processing Unit Hikey970
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMoore
 

More from Jeff Prestes

More from Jeff Prestes (20)

Começando com Quorum - versão 2.6
Começando com Quorum - versão 2.6Começando com Quorum - versão 2.6
Começando com Quorum - versão 2.6
 
Solidity 0.6.x
Solidity 0.6.xSolidity 0.6.x
Solidity 0.6.x
 
Desmistificando blockchain
Desmistificando blockchainDesmistificando blockchain
Desmistificando blockchain
 
Aumento da eficácia jurídica com Smart Contracts
Aumento da eficácia jurídica com Smart ContractsAumento da eficácia jurídica com Smart Contracts
Aumento da eficácia jurídica com Smart Contracts
 
Go (golang) - Porque ele deve ser a linguagem da sua próxima API
Go (golang) - Porque ele deve ser a linguagem da sua próxima APIGo (golang) - Porque ele deve ser a linguagem da sua próxima API
Go (golang) - Porque ele deve ser a linguagem da sua próxima API
 
Chatbots and Internet of Things
Chatbots and Internet of ThingsChatbots and Internet of Things
Chatbots and Internet of Things
 
Physical web
Physical webPhysical web
Physical web
 
Beacons, Raspberry Pi & Node.js
Beacons, Raspberry Pi & Node.jsBeacons, Raspberry Pi & Node.js
Beacons, Raspberry Pi & Node.js
 
Eddystone Beacons - Physical Web - Giving a URL to All Objects
Eddystone Beacons - Physical Web - Giving a URL to All ObjectsEddystone Beacons - Physical Web - Giving a URL to All Objects
Eddystone Beacons - Physical Web - Giving a URL to All Objects
 
Making Payments in Android Easy
Making Payments in Android EasyMaking Payments in Android Easy
Making Payments in Android Easy
 
Kraken.js - Giving Extra Arms to your Node.js App
Kraken.js - Giving Extra Arms to your Node.js AppKraken.js - Giving Extra Arms to your Node.js App
Kraken.js - Giving Extra Arms to your Node.js App
 
Mobile Payments Workshop
Mobile Payments WorkshopMobile Payments Workshop
Mobile Payments Workshop
 
Interact your wearable and an iot device
Interact your wearable and an iot deviceInteract your wearable and an iot device
Interact your wearable and an iot device
 
Fazendo maquinas para ganhar dinheiro com Internet das Coisas
Fazendo maquinas para ganhar dinheiro com Internet das CoisasFazendo maquinas para ganhar dinheiro com Internet das Coisas
Fazendo maquinas para ganhar dinheiro com Internet das Coisas
 
Test A/B
Test A/BTest A/B
Test A/B
 
Let your stuff talk!
Let your stuff talk!Let your stuff talk!
Let your stuff talk!
 
Express checkout PayPal
Express checkout PayPalExpress checkout PayPal
Express checkout PayPal
 
Quercus - Running PHP over Java
Quercus - Running PHP over Java Quercus - Running PHP over Java
Quercus - Running PHP over Java
 
Open ID Connect
Open ID Connect Open ID Connect
Open ID Connect
 
Beacon - Revolutionizing Mobile Apps In-Context
Beacon - Revolutionizing Mobile Apps In-ContextBeacon - Revolutionizing Mobile Apps In-Context
Beacon - Revolutionizing Mobile Apps In-Context
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

RaspberryPi + IoT - Lab to switch on and off a light bulb

  • 1. RaspberryPi + IoT Small presentation and GPIO Lab
  • 3. Agenda  What is not IoT  What is IoT  Polymath required skills  Differences between Arduino and Single Board Computers  Small history of RaspberryPi  RaspberryPi Components and slots  Raspbian – a Debian/Linux to RasberryPi  Configure WiFi network (static / dhcp / resolv.conf)  Upgrade the Raspbian  Install WiringPi  Install WebIOPi  Install Java for Embedded devices
  • 4. This is not IoT… (IMHO) This is so cool but this is Eletronic!!
  • 5. And this is not new… (who has gray hair can say… P)
  • 6. What is IoT? Internet Million of Web Services (PayPal, Twitter, Google, Netflix, Facebook) Things Billions of sensors, motors, displays, appliances, toys, cars, stores, robots +
  • 7. And to work with IoT you’re going to need more skills You’re going to need to a Polimath A polymath (Greek: πολυμαθής, polymathēs, "having learned much")[1] is a person whose expertise spans a significant number of different subject areas; such a person is known to draw on complex bodies of knowledge to solve specific problems. The term was first used in the seventeenth century; the related term, polyhistor, is an ancient term with similar meaning. (Source: Wikipedia - http://en.wikipedia.org/wiki/Polymath)
  • 8. Italian Polymath. What was da Vinci? Scientist? Engineer? Mathematic? Painter? Sculptor? Musician? Botanic? Anatomist? Source: Wikipedia - http://en.wikipedia.org/wiki/Leonardo_da_Vinci
  • 9. Server Side Eletronic (sometimes mechanic and sculptor on wood or iron) Client/Desktop Mobile (Beacons e Weareables) Operation Systems
  • 10.
  • 11. Arduino is a microcontroller board Single Board Computer, SBC, as Raspberry Pi, is a complete computer built on single circuit board with microprocessor, memory, input/output (I/O) and other features required of a funcional computer
  • 12. History  Designed in UK, University of Cambridge, 2006, to be a chip alternative to computers to students. Also a way to students rediscover how cool is to work with Robotic. It has been projected to educational purposes but can used in Commercial ones too.  Team that have concepted it: Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft  Raspberry Pi Foundation was created and first alpha boards were tested, 2011  Sells begins April, 2012  Model B+ is released in November, 2012  More than 5 Million already have been sold
  • 13.
  • 14. Raspbian is an unofficial port of Debian Wheezy armhf with compilation settings adjusted to produce optimized "hard float" code that will run on the Raspberry Pi. Note: Raspbian is not affiliated with the Raspberry Pi Foundation. Raspbian was created by a small, dedicated team of developers that are fans of the Raspberry Pi hardware, the educational goals of the Raspberry Pi Foundation and, of course, the Debian Project. Best OS to Raspberry Pi nowadays. If you use Ubuntu, you’re going to feeling in home. All basic Unix commands works on it and almost all basic server-side too: Apache, Nginx, PHP, Java, Python, MySQL Default user: pi / Default password: raspberry And never forget: sudo apt-get install and be happy :D To install it in your MicroSD card (Recommend 8Gb or more) http://www.raspberrypi.org/documentation/installation/installing-images
  • 15. Configure your wifi credentials: sudo nano /etc/wpa_supplicant/wpa_supplicant.conf (file content below) network={ ssid="iPhone" psk="43070720" } network={ ssid=”<<your-wifi-name-here>>" psk=”<<your-wifi-password>>" } network={ ssid="BoxNet" psk="hackkitty" }
  • 16. Configure your wifi network using static IP: sudo nano /etc/network/interfaces (file content below) auto lo iface lo inet loopback iface eth0 inet dhcp auto wlan0 allow-hotplug wlan0 iface wlan0 inet static address 192.168.0.218 netmask 255.255.255.0 gateway 192.168.0.1 wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet static
  • 17. Configure your wifi network using DHCP (most used): sudo nano /etc/network/interfaces (file content below) auto lo iface lo inet loopback iface eth0 inet dhcp auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
  • 18. sudo apt-get update sudo apt-get dist-upgrade sudo reboot //Use Reboot to restart Raspbian safetly sudo halt //Use halt to turn off Raspbian safetly
  • 19. Wiring Pi It is GPIO Interface library for the Raspberry Pi. It’s written in C for the BCM2835 used in the Raspberry Pi. WiringPi includes a command-line utility gpio which can be used to program and setup the GPIO pins.
  • 20. Wiring Pi sudo apt-get install git-core git clone git://git.drogon.net/wiringPi cd wiringPi git pull origin ./build Installation gpio -v gpio readall Test
  • 21. WebIOPi Written in Python, with facilities to load and execute custom script, using a comprehensive structure with setup and loop functions. Also come with Web interface to GPIO
  • 22. Get back to your user home directory (in this case you’re using pi user, remember?) cd ~/
  • 23. WebIOPi wget http://downloads.sourceforge.net/project/webiopi/WebIOPi- 0.7.1.tar.gz tar xvzf WebIOPi-0.7.1.tar.gz cd WebIOPi-0.7.1 sudo ./setup.sh Installation sudo /etc/init.d/webiopi start Access via browser: http://<your-raspberrypi-ip>:8000/ Default user: webiopi / Default pwd: raspberry Test
  • 24. Our Lab: Turn on/off bulb
  • 25. Our Lab: Turn on/off bulb sudo gpio mode 1 output sudo gpio write 1 1 sudo gpio write 1 0 Access the http://<raspberrypi-ip>:8000/ User: webiopi Password: raspberry
  • 26.
  • 27.