DIY photo booth

Hardware

  • later :)

Preparation

  1. Download and install Raspbian Jessie lite.
  2. Plug in your Raspberry Pi, provide a HDMI screen, network and a keyboard, and let it boot.
  3. Prepare the system environment:
    • Log in with user & password: pi / raspberry. Become super user:
      sudo -i
    • Update the installed packages (including raspy-config) by typing
      apt-get update && apt-get upgrade
    • Edit file /boot/config.txt, and add the following lines:
      framebuffer_depth=32
      framebuffer_ignore_alpha=1
    • Install some more needed packages by typing
      apt-get install python-picamera python-pygame python-pip \
      python-imaging xorg cups cups-bsd git
      Optional: install more standard tools:
      apt-get install htop iotop vnstat vim-nox
    • Change hostname to photobooth:
      echo photobooth > /etc/hostname
    • Add a new local user adduser photobooth, make up a safe password.
    • Grant camera access for the newly created user:
      usermod -a -G video photobooth
    • Install the printer (I can't tell you how right now, because this is a mess)
    • Start
      raspi-config
      Choose Expand Filesystem, then select Enable camera and hit Enter. Go to Finish and choose to reboot.
  4. Install application and dependencies from github repository
    • log in as photobooth
    • Check out software into local folder:
      git clone https://github.com/maduck/photobooth.git
  5. Set up automatic login and program start
    • create file /etc/systemd/system/getty@tty1.service.d/autologin.conf, with the following content:
      [Service]
      ExecStart=
      ExecStart=-/sbin/agetty --autologin "photobooth" %I
    • Create file /home/photobooth/.bash_profile, with the following content:
      startx
    • Change the file owner to our photobooth user:
      chown photobooth.photobooth /home/photobooth/.bash_profile
    • Create a script for executing the photobooth app, named /home/photobooth/start_app.sh, with the following content:
      sleep 5
      # disable screensaver
      xset s off
      # disable energy saving
      xset -dpms
      # start photobooth app
      python photobooth/app.py
    • Change the ownership of this script, and make it executable:
      chown photobooth.photobooth /home/photobooth/start_app.sh
      chmod u+x /home/photobooth/start_app.sh
    • Create the Xorg autostart file /home/photobooth/.xinitrc, containing just the line
      ~/start_app.sh
  6. That's it! Enjoy your cool system!