SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
Raspberry Pi
Creative Technologists
Sheffield
July 2015
Self-directed workshop
● Use the Terminal (command line interface)
● Install software (apt and pip)
● Use the web browser (that's where the good stuff is)
● Use GitHub (download projects, upload your own)
● Use APIs (Application Programming Interfaces)
● Ask questions!
● Take notes!
● Expand your understanding!
● Ask for help!
Connect the camera
Boot the Pi and log in
Test the camera
● raspistill -k
● If it doesn't work, is your camera connected correctly?
● Is your camera enabled?
– sudo raspi-config
– Enable camera
● Press Ctrl + C to exit the preview
Browse my project on GitHub
● Open the web browser
● Go to https://github.com/bennuttall/bett-bot
● Read the instructions
● Do the instructions:
– Install pip
– Install flask
– Download the repo
– Install twython
Run the app
● Enter the bett-bott folder
– cd bett-bott
● Run the app
– python app.py
● Open 127.0.0.1:5000 in the web browser
● Click Capture to take a photo
● See the photo in the gallery
● Click the photo
● Take more photos
●
Find your IP address (e.g. 192.168.1.8)
– hostname -I
● Browse to http://192.168.1.8:5000 on your phone/tablet/laptop
Connect to Twitter
● Log in to www.twitter.com in the web browser (or sign up)
● Go to apps.twitter.com
– Create new app
– Set permissions to read and write
– Generate access tokens
(see Tweeting Babbage resource on raspberrypi.org for
detailed instructions)
– raspberrypi.org/learning/tweeting-babbage/worksheet/
Add your API keys
● Open auth.py with Python/IDLE
● Add your keys
– consumer_key
– consumer_secret
– access_token
– access_token_secret
● Run the app again
– Open Terminal
– cd bett-bot-master
– python app.py
● Now you can tweet the pictures
Look at the code
● Open app.py with Python/IDLE
● What's it doing?
– Imports
– Try/except
– Connect to Twitter
– Define routes
● /
● /capture/
● /view/
● /tweet/
– Routes refer to HTML templates
– Run Flask app
Hack it
● Change the appearance
● Add a feature
● Think about more to do later – ideas?
● Is a web app suitable?
● What's possible? What's not?
● Think about hardware installation
● Think about touch screens

Weitere ähnliche Inhalte

Ähnlich wie Picamera, Flask and the Twitter API Raspberry Pi workshop

Build and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 MinsBuild and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 MinsJeff Hull
 
Using the pip package manager for Odoo
Using the pip package manager for OdooUsing the pip package manager for Odoo
Using the pip package manager for OdooOdoo
 
Using the "pip" package manager for Odoo/OpenERP - Opendays 2014
Using the "pip" package manager for Odoo/OpenERP - Opendays 2014Using the "pip" package manager for Odoo/OpenERP - Opendays 2014
Using the "pip" package manager for Odoo/OpenERP - Opendays 2014Daniel Reis
 
Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & NotebookAreski Belaid
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubScott Graham
 
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUGWelcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUGdwvisser
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingAlessandro Molina
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoinWilliam Chong
 
ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2Jürgen Gutsch
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commandsSayed Ahmed
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in DjangoLakshman Prasad
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsWise Engineering
 
Rejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform GainRejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform GainŁukasz Piątkowski
 
First python project
First python projectFirst python project
First python projectNeetu Jain
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!Umar Yusuf
 

Ähnlich wie Picamera, Flask and the Twitter API Raspberry Pi workshop (20)

Build and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 MinsBuild and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 Mins
 
Using the pip package manager for Odoo
Using the pip package manager for OdooUsing the pip package manager for Odoo
Using the pip package manager for Odoo
 
Using the "pip" package manager for Odoo/OpenERP - Opendays 2014
Using the "pip" package manager for Odoo/OpenERP - Opendays 2014Using the "pip" package manager for Odoo/OpenERP - Opendays 2014
Using the "pip" package manager for Odoo/OpenERP - Opendays 2014
 
Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & Notebook
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHub
 
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUGWelcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears Training
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoin
 
ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Introduction to python scrapping
Introduction to python scrappingIntroduction to python scrapping
Introduction to python scrapping
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commands
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Python on pi
Python on piPython on pi
Python on pi
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane tools
 
Software Instructions
Software InstructionsSoftware Instructions
Software Instructions
 
Rejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform GainRejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform Gain
 
CI/CD with Github Actions
CI/CD with Github ActionsCI/CD with Github Actions
CI/CD with Github Actions
 
First python project
First python projectFirst python project
First python project
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 

Mehr von bennuttall

Raspberry Pi Foundation - Intro for Creative Technologists
Raspberry Pi Foundation - Intro for Creative TechnologistsRaspberry Pi Foundation - Intro for Creative Technologists
Raspberry Pi Foundation - Intro for Creative Technologistsbennuttall
 
Build your product around the best supported mini computer in the world - Ras...
Build your product around the best supported mini computer in the world - Ras...Build your product around the best supported mini computer in the world - Ras...
Build your product around the best supported mini computer in the world - Ras...bennuttall
 
Picademy - Python picamera workshop
Picademy - Python picamera workshopPicademy - Python picamera workshop
Picademy - Python picamera workshopbennuttall
 
Raspberry Pi - background of Raspberry Pi Foundation for Creative Technologists
Raspberry Pi - background of Raspberry Pi Foundation for Creative TechnologistsRaspberry Pi - background of Raspberry Pi Foundation for Creative Technologists
Raspberry Pi - background of Raspberry Pi Foundation for Creative Technologistsbennuttall
 
Hands on Raspberry Pi - Creative Technologists
Hands on Raspberry Pi - Creative TechnologistsHands on Raspberry Pi - Creative Technologists
Hands on Raspberry Pi - Creative Technologistsbennuttall
 
Ben Nuttall - Creative Technologists Pecha Kucha
Ben Nuttall - Creative Technologists Pecha KuchaBen Nuttall - Creative Technologists Pecha Kucha
Ben Nuttall - Creative Technologists Pecha Kuchabennuttall
 
Raspberry Pi for startups - Estonia
Raspberry Pi for startups - EstoniaRaspberry Pi for startups - Estonia
Raspberry Pi for startups - Estoniabennuttall
 
Raspberry Pi - Estonia
Raspberry Pi - EstoniaRaspberry Pi - Estonia
Raspberry Pi - Estoniabennuttall
 
How Raspberry Pi (an educational charity) funds itself without ratlling a tin...
How Raspberry Pi (an educational charity) funds itself without ratlling a tin...How Raspberry Pi (an educational charity) funds itself without ratlling a tin...
How Raspberry Pi (an educational charity) funds itself without ratlling a tin...bennuttall
 
Creative technologists
Creative technologistsCreative technologists
Creative technologistsbennuttall
 
Picademy 5 Picamera Intro Workshop
Picademy 5 Picamera Intro WorkshopPicademy 5 Picamera Intro Workshop
Picademy 5 Picamera Intro Workshopbennuttall
 
Raspberry Pi in education - Barcamp Manchester
Raspberry Pi in education - Barcamp ManchesterRaspberry Pi in education - Barcamp Manchester
Raspberry Pi in education - Barcamp Manchesterbennuttall
 
Raspberry Pi in science education - IMA NW
Raspberry Pi in science education - IMA NWRaspberry Pi in science education - IMA NW
Raspberry Pi in science education - IMA NWbennuttall
 
Pioneering the future of computing education - PyCon Ireland
Pioneering the future of computing education - PyCon IrelandPioneering the future of computing education - PyCon Ireland
Pioneering the future of computing education - PyCon Irelandbennuttall
 
PyPi (not that one) [Python on Pi] - PyConUK 2014
PyPi (not that one) [Python on Pi] - PyConUK 2014PyPi (not that one) [Python on Pi] - PyConUK 2014
PyPi (not that one) [Python on Pi] - PyConUK 2014bennuttall
 
Raspberry Pi - Denver Hackspaces
Raspberry Pi - Denver HackspacesRaspberry Pi - Denver Hackspaces
Raspberry Pi - Denver Hackspacesbennuttall
 
St Louis St. John Vianney High School - Raspberry Pi
St Louis St. John Vianney High School - Raspberry PiSt Louis St. John Vianney High School - Raspberry Pi
St Louis St. John Vianney High School - Raspberry Pibennuttall
 
Arch Reactor - Raspberry Pi
Arch Reactor - Raspberry PiArch Reactor - Raspberry Pi
Arch Reactor - Raspberry Pibennuttall
 
LVL1 - Raspberry Pi
LVL1 - Raspberry PiLVL1 - Raspberry Pi
LVL1 - Raspberry Pibennuttall
 
Fayette Academy - Raspberry Pi
Fayette Academy - Raspberry PiFayette Academy - Raspberry Pi
Fayette Academy - Raspberry Pibennuttall
 

Mehr von bennuttall (20)

Raspberry Pi Foundation - Intro for Creative Technologists
Raspberry Pi Foundation - Intro for Creative TechnologistsRaspberry Pi Foundation - Intro for Creative Technologists
Raspberry Pi Foundation - Intro for Creative Technologists
 
Build your product around the best supported mini computer in the world - Ras...
Build your product around the best supported mini computer in the world - Ras...Build your product around the best supported mini computer in the world - Ras...
Build your product around the best supported mini computer in the world - Ras...
 
Picademy - Python picamera workshop
Picademy - Python picamera workshopPicademy - Python picamera workshop
Picademy - Python picamera workshop
 
Raspberry Pi - background of Raspberry Pi Foundation for Creative Technologists
Raspberry Pi - background of Raspberry Pi Foundation for Creative TechnologistsRaspberry Pi - background of Raspberry Pi Foundation for Creative Technologists
Raspberry Pi - background of Raspberry Pi Foundation for Creative Technologists
 
Hands on Raspberry Pi - Creative Technologists
Hands on Raspberry Pi - Creative TechnologistsHands on Raspberry Pi - Creative Technologists
Hands on Raspberry Pi - Creative Technologists
 
Ben Nuttall - Creative Technologists Pecha Kucha
Ben Nuttall - Creative Technologists Pecha KuchaBen Nuttall - Creative Technologists Pecha Kucha
Ben Nuttall - Creative Technologists Pecha Kucha
 
Raspberry Pi for startups - Estonia
Raspberry Pi for startups - EstoniaRaspberry Pi for startups - Estonia
Raspberry Pi for startups - Estonia
 
Raspberry Pi - Estonia
Raspberry Pi - EstoniaRaspberry Pi - Estonia
Raspberry Pi - Estonia
 
How Raspberry Pi (an educational charity) funds itself without ratlling a tin...
How Raspberry Pi (an educational charity) funds itself without ratlling a tin...How Raspberry Pi (an educational charity) funds itself without ratlling a tin...
How Raspberry Pi (an educational charity) funds itself without ratlling a tin...
 
Creative technologists
Creative technologistsCreative technologists
Creative technologists
 
Picademy 5 Picamera Intro Workshop
Picademy 5 Picamera Intro WorkshopPicademy 5 Picamera Intro Workshop
Picademy 5 Picamera Intro Workshop
 
Raspberry Pi in education - Barcamp Manchester
Raspberry Pi in education - Barcamp ManchesterRaspberry Pi in education - Barcamp Manchester
Raspberry Pi in education - Barcamp Manchester
 
Raspberry Pi in science education - IMA NW
Raspberry Pi in science education - IMA NWRaspberry Pi in science education - IMA NW
Raspberry Pi in science education - IMA NW
 
Pioneering the future of computing education - PyCon Ireland
Pioneering the future of computing education - PyCon IrelandPioneering the future of computing education - PyCon Ireland
Pioneering the future of computing education - PyCon Ireland
 
PyPi (not that one) [Python on Pi] - PyConUK 2014
PyPi (not that one) [Python on Pi] - PyConUK 2014PyPi (not that one) [Python on Pi] - PyConUK 2014
PyPi (not that one) [Python on Pi] - PyConUK 2014
 
Raspberry Pi - Denver Hackspaces
Raspberry Pi - Denver HackspacesRaspberry Pi - Denver Hackspaces
Raspberry Pi - Denver Hackspaces
 
St Louis St. John Vianney High School - Raspberry Pi
St Louis St. John Vianney High School - Raspberry PiSt Louis St. John Vianney High School - Raspberry Pi
St Louis St. John Vianney High School - Raspberry Pi
 
Arch Reactor - Raspberry Pi
Arch Reactor - Raspberry PiArch Reactor - Raspberry Pi
Arch Reactor - Raspberry Pi
 
LVL1 - Raspberry Pi
LVL1 - Raspberry PiLVL1 - Raspberry Pi
LVL1 - Raspberry Pi
 
Fayette Academy - Raspberry Pi
Fayette Academy - Raspberry PiFayette Academy - Raspberry Pi
Fayette Academy - Raspberry Pi
 

Kürzlich hochgeladen

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Kürzlich hochgeladen (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

Picamera, Flask and the Twitter API Raspberry Pi workshop

  • 2. Self-directed workshop ● Use the Terminal (command line interface) ● Install software (apt and pip) ● Use the web browser (that's where the good stuff is) ● Use GitHub (download projects, upload your own) ● Use APIs (Application Programming Interfaces) ● Ask questions! ● Take notes! ● Expand your understanding! ● Ask for help!
  • 4. Boot the Pi and log in
  • 5. Test the camera ● raspistill -k ● If it doesn't work, is your camera connected correctly? ● Is your camera enabled? – sudo raspi-config – Enable camera ● Press Ctrl + C to exit the preview
  • 6. Browse my project on GitHub ● Open the web browser ● Go to https://github.com/bennuttall/bett-bot ● Read the instructions ● Do the instructions: – Install pip – Install flask – Download the repo – Install twython
  • 7. Run the app ● Enter the bett-bott folder – cd bett-bott ● Run the app – python app.py ● Open 127.0.0.1:5000 in the web browser ● Click Capture to take a photo ● See the photo in the gallery ● Click the photo ● Take more photos ● Find your IP address (e.g. 192.168.1.8) – hostname -I ● Browse to http://192.168.1.8:5000 on your phone/tablet/laptop
  • 8. Connect to Twitter ● Log in to www.twitter.com in the web browser (or sign up) ● Go to apps.twitter.com – Create new app – Set permissions to read and write – Generate access tokens (see Tweeting Babbage resource on raspberrypi.org for detailed instructions) – raspberrypi.org/learning/tweeting-babbage/worksheet/
  • 9. Add your API keys ● Open auth.py with Python/IDLE ● Add your keys – consumer_key – consumer_secret – access_token – access_token_secret ● Run the app again – Open Terminal – cd bett-bot-master – python app.py ● Now you can tweet the pictures
  • 10. Look at the code ● Open app.py with Python/IDLE ● What's it doing? – Imports – Try/except – Connect to Twitter – Define routes ● / ● /capture/ ● /view/ ● /tweet/ – Routes refer to HTML templates – Run Flask app
  • 11. Hack it ● Change the appearance ● Add a feature ● Think about more to do later – ideas? ● Is a web app suitable? ● What's possible? What's not? ● Think about hardware installation ● Think about touch screens