How to create a Raspberry Pi-driven Kiosk display#

Objective : Create a kiosk display for the lobby or classroom that consists of a monitor and a second Raspberry Pi computer that defaults to running Swarm in kiosk mode to display the helicorder for the Raspberry Shake. The Raspberry Pi will be configured to run Swarm on start-up so that the kiosk will be self-healing after a power outage or inadvertent power-down.

Note

the solution described here requires a second Raspberry Pi computer running the Swarm program in kiosk mode. Since the display programs have been removed from the Rasperry Pi that powers the Raspberry Shake, it is not possible to run Swarm and the display directly on the Raspberry Shake.

First, on the Raspberry Pi that will host the Swarm in kiosk mode, install ntp. This will ensure that the Raspberry Pi always has the correct time:

$ sudo apt-get install ntp ntpdate

Edit /etc/ntp.conf. Change from:

pool 0.debian.pool.ntp.org iburst
pool 1.debian.pool.ntp.org iburst
pool 2.debian.pool.ntp.org iburst
pool 3.debian.pool.ntp.org iburst

To:

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

you can add a local ntp server to this list if you know of one.

Second, download Swarm and edit the Swarm.config file to set:

kiosk=yourshake;R1234 SHZ AM 00

where:

yourshake = the name you gave to your RaspberryShake data source when you set it up in Swarm

R1234 SHZ AM 00 = your RaspberryShake station name as displayed in the directory tree or helicorder in Swarm

Also, in the Swarm.config file set:

saveConfig=false

so that is does not save any other window setting and uses kiosk mode as set every time. Save the file.

Try starting Swarm with the new config file to make sure everything works and it goes right into kiosk mode displaying your helicorder. Quit Swarm and restart it to make sure that it again starts in kiosk mode.

On the Raspberry Pi, create a text file/bash script in your user directory (e.g., “run_swarm.sh”) with these lines:

#!/bin/bash
cd <path_to_swarm_directory_here>/swarm-2.8.0
sh swarm.sh

This will set the correct directory and run the script included with the Swarm installation, the preferred start-up for Unix as stated in the Swarm manual.

You may need to make the permissions on this script executable by anyone:

$ chmod +x run_swarm.sh

On the Raspberry Pi, edit this file:

/home/pi/.config/lxsession/LXDE-pi/autostart

by adding the line BEFORE the line that starts with “@xscreensaver…”

@/home/pi/run_swarm.sh

Save the file.

Now, when you restart the Raspberry Pi, the bash script should run after the LXDE desktop GUI loads, Swarm should start and immediately go into kiosk mode displaying your helicorder. It should do this on graceful shut-downs/restarts and ungraceful power failures, etc.

$ sudo reboot; exit