SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Python auf dem Raspberry Pi
Thomas Koch @tomy_koch
OpenChaos, Köln, 30. Mai 2013
@
Agenda
 Specs:
 Was ist der Raspberry Pi ?
 Anwendungen:
 Was kann der Raspberry Pi ?
 GPIO mit Python
 Programmierung & Beispiele
 Weitere Infos
 Links, Literatur
05/2013Thomas Koch
Einführung: Der Raspberry Pi
Grundlagen
 SOC Minicomputer: "System on a chip"
 512 MB Hauptspeicher und 700 MHZ ARM CPU
 Ethernet-Schnittstelle und zwei USB-Anschlüsse (Modell B)
 "BYOP"-Prinzip: "bring your own peripherals“
 Lieferung ohne Maus, Tastatur, Netzstecker etc.
 Nackte Platine (ohne Gehäuse), ohne SD-Card und OS
 Einschränkungen
 keine Uhr (ntp nutzen - optional nachrüstbar)
 kein BIOS (d.h. Raspi kann NUR von SD-Card booten)
 Gründe für den Raspberry Pi
 Klein, günstig (ca. 40 €), erweiterbar, offen, grün (3,5 Watt)
05/2013Thomas Koch
Hardware: Der Raspberry Pi
05/2013Thomas Koch
 Das Board
 GPIO (General Purpose Input/Output – mit I²C Bus)
 CSI (Camera Serial Interface)
 HDMI-Out
 OS
 Raspbian (Debian)
 Arch Linux
 RISC OS
Monitor am Rapsi anschliessen
05/2013Thomas Koch
 Per HDMI
 TFT-Monitor, Fernseher etc.
 Per Video-Out
 z.B: mini-KFZ-TFT 3.5‘‘ (für ca. 20 € bei e-bay)
 Lässt sich auch auf 5V-Betrieb (USB) „umbasteln“:
http://kampis-elektroecke.de/?page_id=2631
Anwendungsmöglichkeiten
 Network Device / Thin-Server
 Print- und Webserver, VPN-Server, DHCP-Server etc.
 Cloud für eigenes (Heim-)Netzwerk
 Raspberry Pi als Mediacenter
 XBMC basierende Distributionen wie OpenELEC,
Raspbmc
 Oder auch als AirPlay Empfänger
 Remote Control
 Steuereinheit für eigene Roboter oder Luftfahrzeuge
 Home Automation, Alarmanlage, Videoüberwachung…
 Kiosk-Systeme
 eingebauter Web-Browser "midori" bietet Vollbildmodus
$ midori -e Fullscreen -a <URL>
http://lifehacker.com/5978871/ten-more-awesome-projects-for-your-raspberry-pi
Anwendungsbeispiel: für Einsteiger
05/2013Thomas Koch
 Email Alert via LED
 Einfache Anwendung der GPIO Pins: LED an
 GPIO idealerweise via breakout kit ausführen
 Verdrahtung auf sog. bread board
http://learn.adafruit.com/raspberry-pi-e-mail-notifier-using-leds
Anwendungsbeispiel: für Fortgeschrittene
05/2013Thomas Koch
 Raspberry Pi Timelapse Controller
 Steuerung einer Digital-Kamera
 Mit Zeitraffer-Blenden- &
Belichtungssteuerung (!)
 Basiert u.a. auf auf libgphoto2
http://www.gphoto.org
 Anzeige über (günstiges)
LCD-Displays
(HDD44780 kompatible Typen)
 Steuerung über einfache Schalter
http://blog.davidsingleton.org/raspberry-pi-timelapse-controller/
Anwendungsbeispiel: für Profis
05/2013Thomas Koch
 Raspberry Pi Cluster
 32 Raspberry Pi
 je auf 1 GHz übertaktet
 Kosten ca. 1.440 US-Dollar
 http://t3n.de/news/raspberry-pi-cluster-467237/
Mini Tutorial
05/2013Thomas Koch
 Erste Schritte
 Raspian auf SD-Karte „installieren“ und einstecken
 Einstecken (kein An/Aus-Schalter!)
 Login: user: pi / pwd: raspberry
 Konfiguration:
 $ raspi-config
 ‘enable ssh’
 ‘change_pass ‘  change system password (for the user 'pi')
http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration/overview
 Nützliche Debian Pakete
 für GPIO: "WiringPi"
https://projects.drogon.net/raspberry-pi/wiringpi/
 $ sudo apt-get install git-core
 $ git clone git://git.drogon.net/wiringPi
GPIO Basics
05/2013Thomas Koch
 GPIO per WiringPI steuern
 Ports per WiringPI
ansteuern
 command-line utility gpio
 can be used to program and
setup the GPIO pins
 pi@raspi ~ $ gpio readall
+----------+------+--------+------+-------+
| wiringPi | GPIO | Name | Mode | Value |
+----------+------+--------+------+-------+
| 0 | 17 | GPIO 0 | IN | Low |
| 1 | 18 | GPIO 1 | IN | Low |
| 2 | 27 | GPIO 2 | OUT | Low |
| 3 | 22 | GPIO 3 | IN | Low |
| 4 | 23 | GPIO 4 | IN | Low |
| 5 | 24 | GPIO 5 | IN | Low |
| 6 | 25 | GPIO 6 | IN | Low |
| 7 | 4 | GPIO 7 | IN | Low |
| 8 | 2 | SDA | ALT0 | High |
| 9 | 3 | SCL | ALT0 | High |
| 10 | 8 | CE0 | IN | Low |
| 11 | 7 | CE1 | IN | Low |
| 12 | 10 | MOSI | IN | Low |
| 13 | 9 | MISO | IN | Low |
| 14 | 11 | SCLK | IN | Low |
| 15 | 14 | TxD | ALT0 | High |
| 16 | 15 | RxD | ALT0 | High |
| 17 | 28 | GPIO 8 | IN | Low |
| 18 | 29 | GPIO 9 | IN | Low |
| 19 | 30 | GPIO10 | IN | Low |
| 20 | 31 | GPIO11 | IN | Low |
+----------+------+--------+------+-------+
$ gpio mode 0 out
$ gpio write 0 1
$ gpio write 0 0
Code-Beispiele
Now: Python!
05/2013Thomas Koch
Python auf dem Raspberry PI
05/2013Thomas Koch
 Python included
 Raspi kommt mit Python 2.7 und 3.2
 Zusatzpakete per apt-get oder ‚pip install‘ ziehen
 $sudo apt-get update
 $sudo apt-get install python-dev
 $sudo apt-get install python-rpi.gpio
 GPIO mit Python
 simple GPIO Python Wrapper: RPi.GPIO
 A module to control Raspberry Pi GPIO channels
 includes a C extension
 any script using RPi.GPIO must run with root privileges!
 https://pypi.python.org/pypi/RPi.GPIO
Beispiel: RPi.GPIO
05/2013Thomas Koch
 LED einschalten
https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/
import RPi.GPIO as GPIO
# header pin numbering BCM GPIO 00..nn
GPIO.setmode(GPIO.BCM)
# Set up the GPIO channels:
# one input and one output
GPIO.setup(17, GPIO.IN)
GPIO.setup(18, GPIO.OUT)
input_value = GPIO.input(17)
print „pin#17 is“, input_value
GPIO.output(18, GPIO.HIGH)
Weiterführende Links & Literatur
 Websites
 Raspberry Foundation
 http://www.raspberrypi.org
 Adafruit (Tutorials, hardware kits, etc.)
 http://learn.adafruit.com
 Embedded Linux Wiki http://elinux.org
 Online-Magazin: http://www.themagpi.com
 Literatur
 Raspberry Pi - Einstieg • Optimierung • Projekte
Maik Schmitd, dpunkt verlag, http://www.dpunkt.de/raspi
 Getting Started with Raspberry Pi
http://blog.makezine.com/2012/12/25/ten-raspberry-pi-tips
Verlag: o'reilly/makers
05/2013Thomas Koch

Weitere ähnliche Inhalte

Andere mochten auch

evaluación final maria fernanda larios rodriguez de a tecnologia
evaluación final maria fernanda larios rodriguez  de a tecnologiaevaluación final maria fernanda larios rodriguez  de a tecnologia
evaluación final maria fernanda larios rodriguez de a tecnologiaMaria Fernanda Larios Rodriguez
 
Zp rau sey
Zp rau seyZp rau sey
Zp rau seyneuwerk
 
Kunden- und Mitarbeiterpräsente
Kunden- und MitarbeiterpräsenteKunden- und Mitarbeiterpräsente
Kunden- und MitarbeiterpräsenteGwundernase.ch
 
Produktmanager - Eine praxisnaher Workshop durch Experten des Deutschen Inst...
Produktmanager -  Eine praxisnaher Workshop durch Experten des Deutschen Inst...Produktmanager -  Eine praxisnaher Workshop durch Experten des Deutschen Inst...
Produktmanager - Eine praxisnaher Workshop durch Experten des Deutschen Inst...DIM Marketing
 
Beneficios que ofrece Crezcamos Juntos
Beneficios que ofrece Crezcamos JuntosBeneficios que ofrece Crezcamos Juntos
Beneficios que ofrece Crezcamos JuntosCrezcamosMx
 
Raspberry Pi für Einsteiger
Raspberry Pi für EinsteigerRaspberry Pi für Einsteiger
Raspberry Pi für EinsteigerJoachim Hummel
 
Zp an wie
Zp an wieZp an wie
Zp an wieneuwerk
 
Django and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assDjango and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assTobias Lindaaker
 
Seminar Presentation on raspberry pi
Seminar Presentation on raspberry piSeminar Presentation on raspberry pi
Seminar Presentation on raspberry piGeorgekutty Francis
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi PresentationGeekizer
 
Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pipraveen_23
 
Projekte erfolgreich managen mit SCRUM
Projekte erfolgreich managen mit SCRUMProjekte erfolgreich managen mit SCRUM
Projekte erfolgreich managen mit SCRUMMeike Kranz
 
Raspberry pi : an introduction
Raspberry pi : an introductionRaspberry pi : an introduction
Raspberry pi : an introductionLTG Oxford
 
Heizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire BusHeizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire BusPeter Eulberg
 

Andere mochten auch (15)

evaluación final maria fernanda larios rodriguez de a tecnologia
evaluación final maria fernanda larios rodriguez  de a tecnologiaevaluación final maria fernanda larios rodriguez  de a tecnologia
evaluación final maria fernanda larios rodriguez de a tecnologia
 
Zp rau sey
Zp rau seyZp rau sey
Zp rau sey
 
Kunden- und Mitarbeiterpräsente
Kunden- und MitarbeiterpräsenteKunden- und Mitarbeiterpräsente
Kunden- und Mitarbeiterpräsente
 
Produktmanager - Eine praxisnaher Workshop durch Experten des Deutschen Inst...
Produktmanager -  Eine praxisnaher Workshop durch Experten des Deutschen Inst...Produktmanager -  Eine praxisnaher Workshop durch Experten des Deutschen Inst...
Produktmanager - Eine praxisnaher Workshop durch Experten des Deutschen Inst...
 
Beneficios que ofrece Crezcamos Juntos
Beneficios que ofrece Crezcamos JuntosBeneficios que ofrece Crezcamos Juntos
Beneficios que ofrece Crezcamos Juntos
 
Raspberry Pi für Einsteiger
Raspberry Pi für EinsteigerRaspberry Pi für Einsteiger
Raspberry Pi für Einsteiger
 
Lead Nurturing
Lead NurturingLead Nurturing
Lead Nurturing
 
Zp an wie
Zp an wieZp an wie
Zp an wie
 
Django and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assDjango and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks ass
 
Seminar Presentation on raspberry pi
Seminar Presentation on raspberry piSeminar Presentation on raspberry pi
Seminar Presentation on raspberry pi
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi Presentation
 
Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pi
 
Projekte erfolgreich managen mit SCRUM
Projekte erfolgreich managen mit SCRUMProjekte erfolgreich managen mit SCRUM
Projekte erfolgreich managen mit SCRUM
 
Raspberry pi : an introduction
Raspberry pi : an introductionRaspberry pi : an introduction
Raspberry pi : an introduction
 
Heizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire BusHeizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire Bus
 

Ähnlich wie Raspberry Pi und Python

Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5Andreas Zilly
 
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...NETWAYS
 
DevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigenDevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigenFotiosKaramitsos
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT CoreJens Siebert
 
Django trifft Flutter
Django trifft FlutterDjango trifft Flutter
Django trifft Flutterroskakori
 
Bonn Agile Meetup: Air Quality Lab
Bonn Agile Meetup: Air Quality LabBonn Agile Meetup: Air Quality Lab
Bonn Agile Meetup: Air Quality LabPatrick Steinert
 
Systemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und ForemanSystemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und ForemanB1 Systems GmbH
 
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringOSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringNETWAYS
 
OSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-Monitorings
OSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-MonitoringsOSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-Monitorings
OSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-MonitoringsNETWAYS
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT CoreJens Siebert
 
OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...
OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...
OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...NETWAYS
 
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...NETWAYS
 
Tk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuTk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuWerner Fischer
 
Konfigurations Management mit Puppet (Webinar vom 17.10.2013)
Konfigurations Management mit Puppet (Webinar vom 17.10.2013)Konfigurations Management mit Puppet (Webinar vom 17.10.2013)
Konfigurations Management mit Puppet (Webinar vom 17.10.2013)NETWAYS
 
OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...
OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...
OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...NETWAYS
 
OSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol Ülükmen
OSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol ÜlükmenOSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol Ülükmen
OSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol ÜlükmenNETWAYS
 

Ähnlich wie Raspberry Pi und Python (19)

Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5
 
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
 
Feature satip4
Feature satip4Feature satip4
Feature satip4
 
DevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigenDevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigen
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
 
Django trifft Flutter
Django trifft FlutterDjango trifft Flutter
Django trifft Flutter
 
Dev + Ops = Go
Dev + Ops = GoDev + Ops = Go
Dev + Ops = Go
 
Bonn Agile Meetup: Air Quality Lab
Bonn Agile Meetup: Air Quality LabBonn Agile Meetup: Air Quality Lab
Bonn Agile Meetup: Air Quality Lab
 
Systemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und ForemanSystemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und Foreman
 
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringOSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
 
OSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-Monitorings
OSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-MonitoringsOSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-Monitorings
OSMC 2016 | Hello Redfish, goodbye IPMI - Die Zukunft des Hardware-Monitorings
 
G&L Tech News 02/17
G&L Tech News 02/17G&L Tech News 02/17
G&L Tech News 02/17
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
 
OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...
OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...
OSMC 2013 | 10 Jahre Monitoring mit Open Source Software bei der DB Systel by...
 
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
 
Tk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuTk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneu
 
Konfigurations Management mit Puppet (Webinar vom 17.10.2013)
Konfigurations Management mit Puppet (Webinar vom 17.10.2013)Konfigurations Management mit Puppet (Webinar vom 17.10.2013)
Konfigurations Management mit Puppet (Webinar vom 17.10.2013)
 
OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...
OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...
OSMC 2015: Nagios3 /Icinga 2 Anbindung an OPSI by Detlef Krummel und Erol Ülü...
 
OSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol Ülükmen
OSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol ÜlükmenOSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol Ülükmen
OSMC 2015 | Nagios 3/Icinga 2-Anbindung an OPSI by Detlef Krummel / Erol Ülükmen
 

Mehr von Thomas Koch

CI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeCI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeThomas Koch
 
Facettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrFacettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrThomas Koch
 
BSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtBSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtThomas Koch
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipseThomas Koch
 
Pandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzPandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzThomas Koch
 
EnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemEnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemThomas Koch
 
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Thomas Koch
 
Volltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrVolltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrThomas Koch
 
PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011Thomas Koch
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo ToolkitThomas Koch
 
Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Thomas Koch
 
Suche und PyLucene
Suche und PyLuceneSuche und PyLucene
Suche und PyLuceneThomas Koch
 

Mehr von Thomas Koch (12)

CI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeCI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python Code
 
Facettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrFacettensuche mit Lucene und Solr
Facettensuche mit Lucene und Solr
 
BSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtBSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemacht
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und Eclipse
 
Pandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzPandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen Einsatz
 
EnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemEnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes Forschungsinformationssystem
 
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
 
Volltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrVolltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und Solr
 
PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo Toolkit
 
Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008)
 
Suche und PyLucene
Suche und PyLuceneSuche und PyLucene
Suche und PyLucene
 

Raspberry Pi und Python

  • 1. Python auf dem Raspberry Pi Thomas Koch @tomy_koch OpenChaos, Köln, 30. Mai 2013 @
  • 2. Agenda  Specs:  Was ist der Raspberry Pi ?  Anwendungen:  Was kann der Raspberry Pi ?  GPIO mit Python  Programmierung & Beispiele  Weitere Infos  Links, Literatur 05/2013Thomas Koch
  • 3. Einführung: Der Raspberry Pi Grundlagen  SOC Minicomputer: "System on a chip"  512 MB Hauptspeicher und 700 MHZ ARM CPU  Ethernet-Schnittstelle und zwei USB-Anschlüsse (Modell B)  "BYOP"-Prinzip: "bring your own peripherals“  Lieferung ohne Maus, Tastatur, Netzstecker etc.  Nackte Platine (ohne Gehäuse), ohne SD-Card und OS  Einschränkungen  keine Uhr (ntp nutzen - optional nachrüstbar)  kein BIOS (d.h. Raspi kann NUR von SD-Card booten)  Gründe für den Raspberry Pi  Klein, günstig (ca. 40 €), erweiterbar, offen, grün (3,5 Watt) 05/2013Thomas Koch
  • 4. Hardware: Der Raspberry Pi 05/2013Thomas Koch  Das Board  GPIO (General Purpose Input/Output – mit I²C Bus)  CSI (Camera Serial Interface)  HDMI-Out  OS  Raspbian (Debian)  Arch Linux  RISC OS
  • 5. Monitor am Rapsi anschliessen 05/2013Thomas Koch  Per HDMI  TFT-Monitor, Fernseher etc.  Per Video-Out  z.B: mini-KFZ-TFT 3.5‘‘ (für ca. 20 € bei e-bay)  Lässt sich auch auf 5V-Betrieb (USB) „umbasteln“: http://kampis-elektroecke.de/?page_id=2631
  • 6. Anwendungsmöglichkeiten  Network Device / Thin-Server  Print- und Webserver, VPN-Server, DHCP-Server etc.  Cloud für eigenes (Heim-)Netzwerk  Raspberry Pi als Mediacenter  XBMC basierende Distributionen wie OpenELEC, Raspbmc  Oder auch als AirPlay Empfänger  Remote Control  Steuereinheit für eigene Roboter oder Luftfahrzeuge  Home Automation, Alarmanlage, Videoüberwachung…  Kiosk-Systeme  eingebauter Web-Browser "midori" bietet Vollbildmodus $ midori -e Fullscreen -a <URL> http://lifehacker.com/5978871/ten-more-awesome-projects-for-your-raspberry-pi
  • 7. Anwendungsbeispiel: für Einsteiger 05/2013Thomas Koch  Email Alert via LED  Einfache Anwendung der GPIO Pins: LED an  GPIO idealerweise via breakout kit ausführen  Verdrahtung auf sog. bread board http://learn.adafruit.com/raspberry-pi-e-mail-notifier-using-leds
  • 8. Anwendungsbeispiel: für Fortgeschrittene 05/2013Thomas Koch  Raspberry Pi Timelapse Controller  Steuerung einer Digital-Kamera  Mit Zeitraffer-Blenden- & Belichtungssteuerung (!)  Basiert u.a. auf auf libgphoto2 http://www.gphoto.org  Anzeige über (günstiges) LCD-Displays (HDD44780 kompatible Typen)  Steuerung über einfache Schalter http://blog.davidsingleton.org/raspberry-pi-timelapse-controller/
  • 9. Anwendungsbeispiel: für Profis 05/2013Thomas Koch  Raspberry Pi Cluster  32 Raspberry Pi  je auf 1 GHz übertaktet  Kosten ca. 1.440 US-Dollar  http://t3n.de/news/raspberry-pi-cluster-467237/
  • 10. Mini Tutorial 05/2013Thomas Koch  Erste Schritte  Raspian auf SD-Karte „installieren“ und einstecken  Einstecken (kein An/Aus-Schalter!)  Login: user: pi / pwd: raspberry  Konfiguration:  $ raspi-config  ‘enable ssh’  ‘change_pass ‘  change system password (for the user 'pi') http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration/overview  Nützliche Debian Pakete  für GPIO: "WiringPi" https://projects.drogon.net/raspberry-pi/wiringpi/  $ sudo apt-get install git-core  $ git clone git://git.drogon.net/wiringPi
  • 11. GPIO Basics 05/2013Thomas Koch  GPIO per WiringPI steuern  Ports per WiringPI ansteuern  command-line utility gpio  can be used to program and setup the GPIO pins  pi@raspi ~ $ gpio readall +----------+------+--------+------+-------+ | wiringPi | GPIO | Name | Mode | Value | +----------+------+--------+------+-------+ | 0 | 17 | GPIO 0 | IN | Low | | 1 | 18 | GPIO 1 | IN | Low | | 2 | 27 | GPIO 2 | OUT | Low | | 3 | 22 | GPIO 3 | IN | Low | | 4 | 23 | GPIO 4 | IN | Low | | 5 | 24 | GPIO 5 | IN | Low | | 6 | 25 | GPIO 6 | IN | Low | | 7 | 4 | GPIO 7 | IN | Low | | 8 | 2 | SDA | ALT0 | High | | 9 | 3 | SCL | ALT0 | High | | 10 | 8 | CE0 | IN | Low | | 11 | 7 | CE1 | IN | Low | | 12 | 10 | MOSI | IN | Low | | 13 | 9 | MISO | IN | Low | | 14 | 11 | SCLK | IN | Low | | 15 | 14 | TxD | ALT0 | High | | 16 | 15 | RxD | ALT0 | High | | 17 | 28 | GPIO 8 | IN | Low | | 18 | 29 | GPIO 9 | IN | Low | | 19 | 30 | GPIO10 | IN | Low | | 20 | 31 | GPIO11 | IN | Low | +----------+------+--------+------+-------+ $ gpio mode 0 out $ gpio write 0 1 $ gpio write 0 0
  • 13. Python auf dem Raspberry PI 05/2013Thomas Koch  Python included  Raspi kommt mit Python 2.7 und 3.2  Zusatzpakete per apt-get oder ‚pip install‘ ziehen  $sudo apt-get update  $sudo apt-get install python-dev  $sudo apt-get install python-rpi.gpio  GPIO mit Python  simple GPIO Python Wrapper: RPi.GPIO  A module to control Raspberry Pi GPIO channels  includes a C extension  any script using RPi.GPIO must run with root privileges!  https://pypi.python.org/pypi/RPi.GPIO
  • 14. Beispiel: RPi.GPIO 05/2013Thomas Koch  LED einschalten https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/ import RPi.GPIO as GPIO # header pin numbering BCM GPIO 00..nn GPIO.setmode(GPIO.BCM) # Set up the GPIO channels: # one input and one output GPIO.setup(17, GPIO.IN) GPIO.setup(18, GPIO.OUT) input_value = GPIO.input(17) print „pin#17 is“, input_value GPIO.output(18, GPIO.HIGH)
  • 15. Weiterführende Links & Literatur  Websites  Raspberry Foundation  http://www.raspberrypi.org  Adafruit (Tutorials, hardware kits, etc.)  http://learn.adafruit.com  Embedded Linux Wiki http://elinux.org  Online-Magazin: http://www.themagpi.com  Literatur  Raspberry Pi - Einstieg • Optimierung • Projekte Maik Schmitd, dpunkt verlag, http://www.dpunkt.de/raspi  Getting Started with Raspberry Pi http://blog.makezine.com/2012/12/25/ten-raspberry-pi-tips Verlag: o'reilly/makers 05/2013Thomas Koch