Raspberry Pi Kiosk - robeden/pco-kiosk GitHub Wiki
This document describes the setup for running a kiosk powered by a Raspberry Pi. It's a great little Linux-powered device which can be mounted to a monitor and hung on a wall.
I started with a Raspberry Pi 4 2MB, so these instructions will be tailored to that hardware.
- Install Ubuntu (22.04 at the time of this writing)
- Create the initial user as
pco-kiosk
- Rotate the display
- Config Firefox to auto-start in Kiosk mode, but creating
~/.config/autostart/firefox.desktop
[Desktop Entry] Type=Application Exec=firefox -kiosk -private-window http://localhost:8080 Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name[en_US]=Kiosk Browser Name=Kiosk Browser Comment[en_US]= Comment=
- Install Java:
apt install openjdk-17-jre-headless
- Put the release jar in
/home/pco-kiosk/pco-kiosk.jar
- Configure the kiosk service to start by adding
/etc/systemd/system/pcokiosk.service
:Replace[Unit] Description=PCO Kiosk [Service] Type=simple User=pco-kiosk Group=pco-kiosk ExecStart=java -cp /home/pco-kiosk/pco-kiosk.jar -Dpco.tokens.secret=<secret> -Dpco.tokens.key=<key> net.stratfordpark.pco.Application Restart=on-failure [Install] WantedBy=multi-user.target
<secret>
and<key>
with your API credentials. NOTE: Putting secrets in a service file is a bad practice and you should never, ever do it under normal circumstances. I admit to laziness here since this is kiosk rather than a multi-user environment. Don't be like me. - Then:
systemctl daemon-reload
,systemctl enable pcokiosk.service
- Edit
/etc/apt/apt.conf.d/50unattended-upgrades
to enable at least security updates. Configure to automatically restart at 02:00, or whatever time makes sense. - If you need to pre-set wifi credentials you can add a file in
/etc/NetworkManager/system-connections
. For example,Sample.nmconnection
:
[connection]
id=Sample
uuid=7a47e4ee-1da0-43d6-b71e-b9490d1ad138
type=wifi
interface-name=wlan0
[wifi]
mode=infrastructure
ssid=Sample
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=MySamplePassword
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
Then nmcli connection reload
and make sure it's listed in nmcli -f NAME,UUID,FILENAME connection
.
- When you're all done, make a backup. Mac instructions here.