Skip to content

Shmile on the Raspberry Pi

Vincent edited this page Jun 21, 2017 · 11 revisions

Shmile on the Raspberry Pi

This wiki has been made to assist people who would like to install Shmile on a Raspberry Pi, using an iPad or any other tablet as the web-console. Please let me know of any further changes that could be made to increase the ease of installation and use or any other issues that you come across and fix!

What do I need?

To build your Raspberry Pi / Shmile photobooth there are a few things you will need to begin with:

  • Raspberry Pi (This could be anything from a Model B upwards, I have tested with a Model B+ but would assume that use with a RPi 2 would lead to a better running photobooth)
  • WiFi adapter (While you can run this photobooth using a wired network, the idea here is too have a simple setup, just the camera, RPi and a tablet/iPad)
  • Digital SLR (The software used in Shmile is intended to work with a Digital SLR, however any camera that allows PC tethered shooting should work, perhaps even the RPi camera)
  • Tablet/iPad (This will be used to display the web-console for patrons to use to take their picture)
  • NOOBS SD/MicroSD Card (I would recommend at least a 32gb card as this allows for larger image sizes from your Digital SLR as well as the photo booth being run for an entire evening without the concern of running out of storage space.

Installing Shmile on the Raspberry Pi

This tutorial assumes that you have some basic knowledge of using a Raspberry Pi, however I will endeavour to make instructions clear for anyone who is brand-new to using one.

Install Raspbian Linux via the Noobs SD card

(If your not sure what Noobs is follow this link: http://www.raspberrypi.org/help/noobs-setup/ )

To begin with you will need to boot your RPi for the first time connected to a HDMI display, as well as keyboard and mouse. On your first boot of your RPi you will need to select Raspbian as the operating system and click install.

Following the install of Raspbian your RPi will boot and one of the first steps is to select Expand File System, followed by setting your location, date, and time. You can also enable the RPi camera if you are planning on attaching and using this rather than a Digital SLR.

Update your Raspberry Pi

The next step is to update your RPi with the latest updates. In order to do this you will need to use the following commands:

Type in after the pi@raspberrypi ~ $ prompt (this shows that you are logged in as Pi)

sudo apt-get update

then

sudo apt-get upgrade

These two steps may take some time, but we need to be sure we are fully updated.

Now give your RPi a reboot before continuing

sudo reboot

Software Packages and Dependencies

Next we will install some of the software packages that help us install Shmile and its dependencies.

First Nodejs

wget http://node-arm.herokuapp.com/node_latest_armhf.deb 

sudo dpkg -i node_latest_armhf.deb

Now check that it is the latest version of Node and NPM

node -v

npm -v

Now that Node and NPM are installed we can install some of the dependencies for Shmile

sudo apt-get install imagemagick

sudo apt-get install gphoto2

sudo npm install -g gulp

sudo npm install -g coffee-script

sudo npm install -g bower

Next we will run npm update

npm update

And gphoto2 update (using a script written by Gonzalo - https://github.com/gonzalo/)

curl -L https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh | sudo sh

This will take a while, so wait until its complete and you will see the current version (2.5.7) at the end.

Checking out Shmile to a folder

Now that we have installed all the dependencies we can check-out the Shmile repository to a folder. All we need to do is follow the code below, it will create a folder called shmile-master.

git clone https://github.com/porkbuns/shmile

Time to get it up and running

A couple of things prior to starting the app for the first time:

You will need to know the ip address of your RPi on the network it is attached too. Use this command to find out:

 ifconfig

This is assuming you have your RPi connected to the same network as the device you wish to use to display the web-console (such as a WiFi hotspot created by a Tablet/iPad).

Now to start Shmile

Move to the folder we just created, and follow the commands stated below

cd /path/to/shmile

npm install

bower install

coffee app.coffee

Now Shmile is running, using your tablet/iPad open a web browser and type the following: http://ip address of RPi:3000

This is the web console for Shmile, press Start to begin shooting, and of course make sure your camera is plugged in to your RPi and that its on!

The photos generated by Shmile will save to public/photos/generated, this directory can be changed so that the images save to an attached USB memory stick for example. This may be a good move to ensure the photo booth continues to run smoothly.

Issue that causes program to only take 1 or 2 Photos

I found when I initially got the Raspberry Pi running that it had issues only taking 1 photo at a time. After much frustration I found that the new version of imagemagik had a new argument, instead of -size it needed -resize. In line 61 of the code for image_compositor.coffee -size needed to be changed to -resize, once this was complete it worked without any issues. Furthermore I also found that the SLR connected needed to be setup to take photos in only JPEG, not RAW, this also causes some issues.

An edited version of image_compositor.coffee can be downloaded from: https://github.com/techyteach-s/shmile-Raspberry-Pi-fix

simply download, and substitute it for the file in the 'lib' folder of shmile.

Further additions

Gallery Display

From a web browser on a separate computer connected to the same network, this could be a Raspberry Pi or laptop etc, you can connect to a Gallery of the images taken. Simply browse to http://ip address of pi:3000/gallery and the slideshow will begin.

Following this basic setup which requires you to start Shmile via command line using something such as SSH you could also create a script to start Shmile on boot. I have not detailed this yet as I am still to perfect a basic script but it will make for a stand alone setup which you simply plug in, wait a little, and press start!

I have also made changes so that the Raspberry Pi boots, connects to the same wifi network, with a static ip address (personal hotspot on a tablet, iPad in my case), it was also necessary to tell the pi not to use a login for the standard user account. While I have not detailed these changes here, as they took a lot of mucking around, it is possible to accomplish so that one simply turns the camera on, the personal hotspot, then the raspberry pi, and then after around 1 min, starts Shmile in the browser on the tablet. A complete all in one solution, all mounted on a tripod.