Skip to content

attheCO/photo-booth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

photo-booth

Raspberry Pi Photo booth (PiCamera v2)

running photo booth

(after setup and prep for auto launch, see sections below)

  1. $booth
  2. open new terminal window (Ctrl + Shift + N)
  3. $opb

setup on rPi

  1. begin setup on raspberry pi
  2. add Apache and PHP $sudo apt-get install apache2 php7.0 php7.0-opcache
  3. setup PHP to have default directory be ./www in this repo (see insturctions below: "Setup Default PHP Directory")
  4. **** I'm sure something will go here too ****
  5. $cd virtualenv && virtualenv -p python3 env --no-site-packages to prep all dependencies in project
  6. start virtual environment $cd ../ && source virtualenv/env/bin/activate (see: http://sourabhbajaj.com/mac-setup/Python/virtualenv.html)
  7. If setting up rPi, be ready to get some coffee. This next step takes a bit to install. (~15mins)
  8. go fetch all python dependencies $pip install -r virtualenv/requirements.txt
  9. setup picamera $sudo apt-get install python3-setuptools && easy_install3 --user picamera (see: https://media.readthedocs.org/pdf/picamera/release-0.8/picamera.pdf)

setup for running/editing/testing

See below about how to automate this

  1. $cd wip/photo-booth/ && source virtualenv/envpi2/bin/activate
  2. $cd www/ && php -S localhost:8000
  3. open chrome with url: localhost:8000

setup default PHP directory


source: https://stackoverflow.com/a/23175981/3979495

  1. edit apache2.conf file $sudo nano /etc/apache2/apache2.conf
  2. edit <Directory /var/www/html> to be <Directory /home/pi/wip/photo-booth/www>
  3. edit 000-default.conf file $sudo nano /etc/apache2/sites-avilable/000-default.conf
  4. edit /var/www/html to be /home/pi/wip/photo-booth/www
  5. restart apache $sudo service apache2 restart
  6. open chrome and go to url: localhost

prepare the auto launch script on rPi

source: http://blog.startingelectronics.com/auto-start-a-desktop-application-on-the-rapberry-pi/

  1. create bash alias: apb
  2. $echo "alias apb='. /home/pi/wip/photo-booth/virtualenv/envpi2/bin/activate'" >> ~/.bashrc
  3. create bash alias: opb
  4. $echo "alias opb='chromium-browser --kiosk http://localhost'" >> ~/.bashrc
  5. $echo "alias booth='apb && opb'" >> ~/.bashrc
  6. Okay, now let's make it where terminal opens on boot and booth get called #magic
  7. make directory for startup $mkdir -p .config/lxsession/LXDE-pi
  8. edit startup $echo"@lxterminal" >> .config/lxsession/LXDE-pi/autostart
  9. add booth alias to start on terminal load
  10. $echo "booth" >> ~/.bashrc
  11. now try a reboot

setup on mac for editing files on rPi

  • find pi if needed: $sudo nmap -sP 10.10.1.1/24
  • $ssh pi@10.10.1.199
  • $sshfs pi@10.10.1.199:~/wip/photo-booth/ pi

helpful tips with setup

  • connect mac to pi file system for editing (see: https://www.raspberrypi.org/documentation/remote-access/ssh/sshfs.md)
  • stop virtual environment $deactivate
  • freeze new dependencies while virtual environment is active (see setup #3) in virtualenv/env/ folder $pip freeze --local > ../requirements.txt
  • camera interface settings will Disable if camera ribbon isn't plugged into port (Enable again and restart with camera plugged in)

virtualenv - virtual enviroment introduction

To-Dos

About

Raspberry Pi Photo booth (PiCamera v2)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors