Raspberry Pi Kiosk - robeden/pco-kiosk GitHub Wiki

Purpose

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.

Setup (2023 Edition)

I started with a Raspberry Pi 4 2MB, so these instructions will be tailored to that hardware.

  1. Install Ubuntu (22.04 at the time of this writing)
  2. Create the initial user as pco-kiosk
  3. Rotate the display
  4. 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=
    
  5. Install Java: apt install openjdk-17-jre-headless
  6. Put the release jar in /home/pco-kiosk/pco-kiosk.jar
  7. Configure the kiosk service to start by adding /etc/systemd/system/pcokiosk.service:
    [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
    
    Replace <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.
  8. Then: systemctl daemon-reload, systemctl enable pcokiosk.service
  9. 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.
  10. 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.

  1. When you're all done, make a backup. Mac instructions here.
⚠️ **GitHub.com Fallback** ⚠️