Setting up Pibooth in 2024

I have an upcoming need for a photo booth next year 😏 so I started looking into some options to DIY rather than rent one or buy a pre-made version.

The option I’m trying out right now is Pibooth, “A photobooth application out-of-the-box in pure Python.”

I’m going to set this up with an extra Raspberry Pi 400 I have that’s not doing anything, and see what we can do. Feel free to follow along!

Since Pibooth only works on Raspbian Buster right now, I had to download an older version at https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2021-05-28/

I set up a few defaults I like to have for my Pis:

# Updates, new software, and cleanup
sudo apt update && sudo apt upgrade
sudo apt install mc screen ack zsh locate git htop cockpit -y
sudo apt autoremove

# Add dotfile customizations. Sorry, it's currently private :D
git clone git@github.com:emrikol/dotfiles.git
cp -r ~/dotfiles/. ~/
sudo usermod --shell /bin/zsh derrick
zsh

# Set up root access so I can SCP in from Transmit if I need to.
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sudo passwd root

# Customize Raspberry Pi settings.
sudo raspi-configCode language: Bash (bash)

After installing cockpit I believe, I had an issue where the MAC address of my Wifi kept changing randomly on each reboot. I had to follow these instructions and add this to my /etc/NetworkManager/NetworkManager.conf:

[device]
wifi.scan-rand-mac-address=no

Disable Swap to save on SD Card wear:

sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
sudo apt purge dphys-swapfile -y
sudo sysctl -w vm.swappiness=0Code language: Bash (bash)

Install Log2RAM for the same reason:

echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ bookworm main" | sudo tee /etc/apt/sources.list.d/azlux.list
sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg  https://azlux.fr/repo.gpg
sudo apt update
sudo apt install log2ram
sudo sed -i 's/SIZE=40M/SIZE=64M/' /etc/log2ram.conf
sudo sed -i 's/#SystemMaxUse=/SystemMaxUse=32M/' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald
Code language: Bash (bash)

From here, we should have my default “base” Raspberry Pi setup. And now, we can work on figuring out how to install Pibooth. According to the install docs, we need to run a few commands:

$ sudo apt install "libsdl2-*"
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libsdl2-mixer-dev' for glob 'libsdl2-*'
Note, selecting 'libsdl2-image-dev' for glob 'libsdl2-*'
Note, selecting 'libsdl2-gfx-dev' for glob 'libsdl2-*'
Note, selecting 'libsdl2-gfx-doc' for glob 'libsdl2-*'
Note, selecting 'libsdl2-mixer-2.0-0' for glob 'libsdl2-*'
Note, selecting 'libsdl2-dbg:armhf' for glob 'libsdl2-*'
Note, selecting 'libsdl2-dev' for glob 'libsdl2-*'
Note, selecting 'libsdl2-doc' for glob 'libsdl2-*'
Note, selecting 'libsdl2-ttf-dev' for glob 'libsdl2-*'
Note, selecting 'libsdl2-net-2.0-0' for glob 'libsdl2-*'
Note, selecting 'libsdl2-net-dev' for glob 'libsdl2-*'
Note, selecting 'libsdl2-image-2.0-0' for glob 'libsdl2-*'
Note, selecting 'libsdl2-2.0-0-dbgsym:armhf' for glob 'libsdl2-*'
Note, selecting 'libsdl2-2.0-0' for glob 'libsdl2-*'
Note, selecting 'libsdl2-gfx-1.0-0' for glob 'libsdl2-*'
Note, selecting 'libsdl2-ttf-2.0-0' for glob 'libsdl2-*'
libsdl2-2.0-0 is already the newest version (2.0.9+dfsg1-1+deb10u1).
libsdl2-2.0-0 set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsdl2-2.0-0-dbgsym:armhf : Depends: libsdl2-2.0-0:armhf (= 2.0.9+dfsg1-1+rpt1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.Code language: JavaScript (javascript)

Meh. Okay. Let’s just install all of them but the trouble package. Hopefully that won’t come back to bite us.

sudo apt install libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-gfx-doc libsdl2-mixer-2.0-0 libsdl2-dev libsdl2-doc libsdl2-ttf-dev libsdl2-net-2.0-0 libsdl2-net-dev libsdl2-image-2.0-0 libsdl2-2.0-0 libsdl2-gfx-1.0-0 libsdl2-ttf-2.0-0 -yCode language: Bash (bash)

We did not install libsdl2-dbg and libsdl2-2.0-0-dbgsym

I’m thinking about adding printer support, so I’ll go ahead and install CUPS: sudo apt-get install cups libcups2-dev

And we might as well install OpenCV sudo apt-get install python3-opencv

Installing gphoto2:

cd ~
git clone https://github.com/gonzalo/gphoto2-updater.git
cd gphoto2-updater
sudo ./gphoto2-updater.shCode language: Bash (bash)

Now for pibooth: pip3 install "pibooth[dslr,printer]"

Aww yeah! Success!

Now all I need to do is customize it. Maybe we’ll have another post at a later time.

Other Posts Not Worth Reading

Hey, You!

Like this kind of garbage? Subscribe for more! I post like once a month or so, unless I found something interesting to write about.


Comments

Leave a Reply