We built this kiosk to register projects and users at our FabLab, providing a project gallery and records of human and machine hours. Users can upload media, register hours, leave updates and feedback, and give a final project evaluation. It also includes a photobooth tool that lets you take photos with the kiosk and associate them with projects or leave them in the photobooth gallery.
The kiosk hardware uses a Raspberry Pi 4 in a CNC machined PVC stand. We designed a version using the Raspberry Pi 7in touch display, but ended up using a standard 21in lcd monitor, with a shelf for mouse and keyboard. A Raspberry Pi Camera Module 3 is used for the photobooth.
The kiosk software is built with Node.js and uses a LokiJS database. Due to issues accessing the Raspberry Pi Camera from Chromium, we also had to use gstreamer with a v4l2loopback device for the photobooth, see #set-up-raspberry-pi-camera-for-use-in-chromium.
This repo also contains systemd unit files to manage autostarting the kiosk app and the v4l2loopback device. There is also a shell script that can be used to create automatic remote backups of the kiosk database and media files via FTP.
See the FabLab EDP Wiki pictures and more details on the hardware construction. CAD and CAM files are available in the hardware folder.
sudo apt update
sudo apt upgrade
sudo apt install git
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install nodejs
git clone https://github.com/fablabedp/fablabedp-kiosk.git
cd fablabedp-kiosk/kiosk_app/
npm install
In the kiosk_app folder, rename .env.sample to .env and edit variables as needed.
If you need to change the port number, this must also be updated in start_kiosk.sh.
I had problems getting the Raspberry Pi Camera to work as a capture device in Chromium browser, see these issues:
raspberrypi/linux#1498
https://bugs.chromium.org/p/chromium/issues/detail?id=249953
The solution I found was to use gstreamer and create a v4l2loopback device:
https://forums.raspberrypi.com/viewtopic.php?p=1939455
https://forums.raspberrypi.com/viewtopic.php?t=323401
https://raspberrypi.stackexchange.com/questions/42727/raspbian-v4l2loopback/143021
https://arcoresearchgroup.wordpress.com/2020/06/02/virtual-camera-for-opencv-using-v4l2loopback/
I first needed to install the Raspberry Pi Kernal Headers:
sudo apt-get install raspberrypi-kernel-headers
Then install gstreamer and v4l2loopback module, and create the loopback device:
sudo apt-get install v4l2loopback-dkms gstreamer1.0-tools
v4l2-ctl --list-devices
sudo rmmod v4l2loopback
sudo modprobe v4l2loopback devices=1 exclusive_caps=1,1 video_nr=5 card_label="VirtualCam"
sudo cp fablabedp-kiosk.service /etc/systemd/system/
sudo cp fablabedp-virtualcam.service /etc/systemd/system/
sudo systemctl enable fablabedp-kiosk.service
sudo systemctl enable fablabedp-virtualcam.service
Hide/show the taskbar:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
and comment/uncomment this line:
# @lxpanel --profile LXDE-pi
Edit desktop items:
nano /home/pi/.config/pcmanfm/LXDE-pi/desktop-items-0.conf
Reboot to enable changes.
The default kiosk interface is in Portuguese. All strings are stored in lang.json that can be translated as needed. An english translation already exists in lang.en.json
To add or remove items from the tools or materials lists, simply add lines to the material_list and tool_list nodes in the json file. Note that if you edit a tag name in this list (the key, not the string value), upon restarting the app all records for that tag will be lost. If you need to edit an existing tag name for some reason, this must be done manually in the database fist.
If you want to keep a remote backup of the kiosk, you can use the backup_kiosk.sh script.
-
Rename
backup_config.txt.sampletobackup_config.txtand update with values with FTP creditials for your backups. EnsureMEDIA_DIRis the same asMEDIA_PATHin the app.envfile. -
You can schedule the script with cron by editing
crontab -e, adding this line will run the backup script daily at 12h00, and save a log in the project directory:
0 12 * * * cd /home/pi/fablabedp-kiosk && ./backup_kiosk.sh >> backup.log 2>&1
open shutdown menu
crtl + alt + delete
open terminal
ctrl + alt + T
stop kiosk (will restart on reboot)
sudo systemctl stop fablabedp-kiosk.service
start kiosk
sudo systemctl start fablabedp-kiosk.service
disable kiosk (will not start on boot)
sudo systemctl disable fablabedp-kiosk.service
enable kiosk (will autostart on boot)
sudo systemctl enable fablabedp-kiosk.service