Introduction: Yet Another Raspberry Pi Photo Booth
Recently, my company (cubitux) had the opportunity to participate to a contest to present a photo booth solution to a client. Because I'm an open-source fan, I picked Raspberry Pi technology and started creating something around it.
------------------
Everything runs with a customized Raspbian - Desktop Edition (Special Linux flavor for Raspberry Pi)
An already made SD card image is available on the following GitHub repository: https://github.com/phenelle/RPi_Photoboth/tree/mas...
------------------
However, this guide will show all the steps that we did to customize our Raspbian and make it very close to an embedded system...
Step 1: Required Hardware Component
Hardware
- Raspberry Pi 2 / 3 (https://www.adafruit.com/product/3055)
- An empty SD card - 8GB (https://www.adafruit.com/product/2767)
- Pi Camera module v2 - 8 mega pixel (https://www.adafruit.com/product/3099)
- 7" inch official Raspberry Pi LCD touch screen (https://www.adafruit.com/product/2718)
- Stand for Raspberry Pi 7" Touchscreen Display (https://www.adafruit.com/product/3187)
Additional tool
- A screw driver to fix the LCD screen on the stand
A keyboard (I prefer that over a touch screen virtual keyboard, however, both options are available...)
Total hardware requirements cost around: $182 USD
Note: I suggest getting hardware from the Adafruit Industries because they highly support open source technologies, and also provide nice and fast support
------------------
At this point, you should have a working Raspberry Pi with Raspbian Desktop and a working Camera module enabled.
You can test the Camera module by following this manual: https://www.raspberrypi.org/learning/getting-start...
Step 2: Splash Screen Customization
Everyone who runs Raspberry Pi knows that, when the device boot, the raspberry images shows up with bunch of ugly text lines (boot message).
----------------
Because the photo booth was design to be use by the public, we changed the default "start screen" to hide those information and we replaced them with a nice image. (Long story short, the text messages still output somewhere, but we display an image above it)
----------------
As root, go to "raspi-config":
- Enable "Console Autologin"
- Disable "Splash Screen" (we use different method than plymouthd)
----------------
Based on the following guide (http://www.raspberry-projects.com/pi/pi-operating-...)
- Create a 800 x 480 splash screen images. (We placed our image in /etc/splash.jpg)
- Edit /boot/cmdline.txt and change the line "console=tty1" to "console=null"
- Edit /boot/cmdline.txt and add "logo.nologo quiet" at the end of the command line
- Edit /boot/config.txt and add "disable_splash=1" at the end of the file
- Create a startup script (/etc/init.d/splash)
- Call "sudo insserv /etc/init.d/splash"
----------------
Dont worry, the console is still there. If you press "enter" or move to different terminal (for ex, ALT + F3), you will see the shell and be able to run X.
----------------
At this point, the device should boot and show the splash screen instead of the default (raspberry image + init text message)
Step 3: Install 3rd Party Applications
To make this work, we will install a little custom website that will be used as graphical interface (GUI) for the user. (Web is an awesome lightweight technology that can be easily created and customized...)
Therefor, we need will need apache webserver, PHP and "uv4l" (UV4L is used to stream the webcam live to the user and take pictures)
The following commands should install all them nicely:
curl http://www.linux-projects.org/listing/uv4l_repo/l... | sudo apt-key add -
sudo sh -c 'echo "deb http://www.linux-projects.org/listing/uv4l_repo/r... jessie main" >> /etc/apt/sources.list.d/uv4l.list '
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install php5 libapache2-mod-php5 uv4l uv4l-raspicam uv4l-raspicam-extras uv4l-webrtc wkhtmltopdf
(more documentation to install UV4L available here: https://www.linux-projects.org/uv4l/installation/ )
You might need to give permission to the apache user to use "video / webcam" hardware
In order to do that, add the user "www-data" to the group "video". The following command should do the trick...
- sudo usermod -G video www-data
Now, start apache and make sure it persist on reboot:
- sudo /etc/init.d/apache2 start
- sudo /etc/init.d/uv4l_raspicam start
To test that apache is installed and working, open the following URL from within your RPi: http://127.0.0.1/
To test that uv4l is installed, open the following URL from within your RPi: http://127.0.0.1:8080
(as shown on the screenshot)
Now, make this persistant when device reboot:
- sudo update-rc.d apache2 enable
- sudo update-rc.d uv4l_raspicam enable
Reboot your device, and test that both apache and uv4l are started...
Step 4: Deploy Photobooth Website Application
Open a shell and type the following command:
# Install various tools for splash screen
sudo apt-get install xscreensaver feh
# Remove default homepage
sudo mv /var/www/html/index.html /var/www/html/index.html.orig
# Clone repository
git clone https://github.com/phenelle/RPi_Photoboth.git
# Move all site's content to the /var/www/html folder
sudo mv RPi_Photoboth/source/www/* /var/www/html/
# Allow apache to create files in the "snaps" folder
mkdir /var/www/html/img/snaps
sudo chown www-data:www-data /var/www/html/img/snaps
--------------------
The default website installed on the Pi should now show the RPi Booth web application
--------------------
You can now configure various settings of the "config.php" (such as SMTP, Virtual Keyboard, etc...)
--------------------
Now if you reboot, everything should work nicely!
I hope you enjoy this tutorial
Step 5: Create Custom Auto-login Procedure at Startup
Now that we have all in place, we need to customize the RPi, so it will automatically run X and open that website for us.
To do that, I enabled "shell auto-login" on the RPi. And I create 2 specials files: .xinitrc and .bashrc,,,
BashRC
This file is parsed everytime a shells open.
XinitRC
This file is parsed everytime X runs
The idea here is to run X with special options... (not the defaut Gnome interface)
Have a look at the Github repo to see what are the options to make:
30 Comments
Question 4 years ago
Is there a way for the photos to be saved on the SD card and then taken off at a later time, instead of emailed? I might use this project for a photo booth for me and my fiance's wedding, but we don't know if there is an internet/WiFi source for the purpose of the website things your project talks of. This is a brilliant project, because we want to save money on a photo booth, and I already have the materials needed for this! Also, this program is already an image for the SD card? Can we change the languages provided. we have people of many languages coming who understand english, but most importantly, we have 2 indonesian guests that don't know english. Is there a was to edit the Cubitux logo on the picture frame, to show our wedding emblem and hashtag instead? Can we remove the photo frame all together, so guests can just have the pictures and nothing else fancy?
Answer 3 years ago
Everything is customizable 🙂
4 years ago
Hi,
I have just come across this after being asked to build a photo booth , is the disc image still available , I get no response when clicking on the link.
The project is just what I am after with the web interface.
Reply 4 years ago
i like pizza
Reply 3 years ago
Me too 😉
Reply 3 years ago
Normally, it should still be there
Need 16GB SD card
Question 3 years ago
Hi.
Would it be possible to use a GPIO connected button to take the pictures? And maybe have a pre-filled email address?
Thanks a lot
Answer 3 years ago
Sure
It should be possible
The booth UI is actually, a website (Php)
I used a couple of redirect to call "capture.php" which execute bunch of command to capture the camera's picture
If you don't want to redevelop everything. You can create a websocked that listen for some event. Event would be the gpio being pressed. This event to trigger the click (and/or redirect)
Question 4 years ago
I love this project and want to play around with making it.
Is it configurable to put in my own Logo and change the interface?
Answer 4 years ago
is a gret idea , i do bad fot me have a little problems, i use 5 inch display and cat fix this error, i dont know php
5 years ago
That is really cool. You could probably make one of these much cheaper than renting a photo booth for a special event.
Reply 5 years ago
Absolutly
Reply 5 years ago
i am having problem with the email attached image.please help
Reply 5 years ago
What is the problem ?
Reply 5 years ago
i fix it already. it works great.
Reply 5 years ago
How did you fix it?
Reply 5 years ago
Hi, how did you manage to fix it senting images in the email?
Reply 5 years ago
I have received the email without my photo.
Reply 5 years ago
Did you manage to get the photo in your email?
I am having the same issue, everything seems ok except there is a broken image tag in the email
Reply 5 years ago
Hi,
Sorry for the delay to reply
Perhaps wkhtmltoimage is not installed ? (or not working as expected?) It could be a permission issue as well..
The generated image attached to the email comes from "card.php"
The code to send email and attach the generated image is in "sendmail_form.php"
If you could provide more trace / debug information.. It would help