another terminal window on the Pi and run:
cd /home/pi/git/TouchSele/scripts
python ./listalbums.py
Copy (or write down) the ID number of the
album that you want to use.
In the /home/pi/git/TouchSelfie/scripts folder,
open up the openselfie.conf file. Here you will be
able to enter the album ID number: albumid =
XXXXXXXXXX (Figure
L
). You can also use the
configuration dialog from the main screen of the
photo booth GUI.
Fortunately, you only have to do this once!
After this it will remember the credentials and
periodically refresh them. The cached credentials
are stored in a file called credentials.dat, so if you
delete it, you’ll have to do the web dance again, as
long as your JSON file is still there.
TROUBLESHOOTING TIPS
If you get an error that says “cannot connect to
Google Account,” it’s probably because Google
periodically invalidates the credentials. To refresh
them, try the following:
» Double-check that you’re connected to the
internet
» Remove the file credentials.dat from the
scripts file folder
» Run: cd /home/pi/git/TouchSele/
scripts
» Run: python ./photobooth_gui.py
» Allow access to Google Photos
» Re-enter credentials in Terminal window
8. CUSTOMIZE MESSAGES AND LOGOS
While you’re still in openselfie.conf (or the GUI
configuration screen) you can also create a
customized message for your event. Just edit the
text shown in italics here:
emailsubject = Subject line of your
email
emailmsg = Message that accompanies
email
photo caption = Photo caption on
Google Photos account
logopng = logo.png
albumid = XXXXXXXXXX
To customize the logo that’s stamped on each
photo, just save a new PNG file (1366×235 pixels,
with transparency if you wish) in the folder /pi/
git/TouchSelfie/scripts. Then run the photo booth
again (photobooth_gui.py) and click the Customize
button. In the pop-up window, next to “Logo File”
click the Browse button. Select your file, and click
Open. You should see a preview of your new logo.
When you’re done, click Done (Figure
M
).
9. ENABLE FULLSCREEN AND
TOUCHSCREEN KEYBOARD
Reopen the photobooth_gui.py file and remove the
# symbol from the beginning of the line #root.
attributes(“-fullscreen”,True). Now the
photo booth interface can run fullscreen on the
Touch Display.
Once you connect your Pi 3 to the touchscreen,
you won’t want to be lugging around your
USB keyboard to type commands. To install a
touchscreen keyboard on your Pi, follow the step-
by-step instructions by ModMyPi at makezine.
com/go/matchbox-keyboard.
10. MAKE THE MOUNTING BRACKETS
(OPTIONAL)
We created simple brackets you can 3D print
for standing your photo booth on a tabletop or
mounting it on a standard tripod (Figure
N
,
following page). You can also laser-cut the
camera mount from ⁄" acrylic if you prefer that
look, but the 3D-printed version seems to hold
up longer. Download the files from github.com/
wyolum/TouchSelfie/tree/master/fabricate.
» Tabletop mount Print the files camera_mount.
stl and PiTouchScreenStand.stl. This requires
using two M2.5×14mm and two M2.5×16mm
screws.
» Tripod mount Jenny Ching at Make: created
an updated version of our tripod mount
that’s a great improvement. Print the files
PiTouchScreenMount.stl and PiCameraMount.stl.
and use 10mm and 6mm M2.5 screws instead.
11. ASSEMBLE YOUR PHOTO BOOTH
Fasten the Pi 3 and the Touch Display together
using the included screws and standoffs. Connect
the touchscreen’s ribbon cable to the Pi headers
marked “Display.” Use a red jumper wire to
connect the touchscreen’s 5V pin to the Pi’s GPIO
pin 2. Use a black wire to connect touchscreen
GND to Pi GPIO pin 6 (Figures
O
and
P
).
Thread the camera’s ribbon cable through the
slot in the camera mount. Plug it into the camera,
and affix the camera to the mount with the M2
screws (Figures
Q
and
R
) or double-stick tape.
Plug the camera cable into the Pi (Figure
S
).
Fasten the tripod stand to the touchscreen
with M2.5×6mm screws (Figure
T
) through the
2 bottom holes. Then fasten the camera mount
H
I
M
TIP: If you use tape, be sure to connect the
cable first; at the Make: Labs our tape some-
times interfered with detecting the camera.
makezine.com 59
makezine.com/52
J
K
L
M52_056-61_RaspPhoto_F1.indd 59 6/14/16 12:16 PM
Get Make: Volume 52 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.