Skip to content

Instantly share code, notes, and snippets.

@fjctp
Last active July 6, 2024 09:38
Show Gist options
  • Save fjctp/210f4e870f913416b8d0e17fd36153c2 to your computer and use it in GitHub Desktop.
Save fjctp/210f4e870f913416b8d0e17fd36153c2 to your computer and use it in GitHub Desktop.
RPi Zero W kiosk

Summary

Setup RPi Zero W as a kiosk

Step

  1. write Raspbian Lite image to a SD card
  2. enable ssh
touch /boot/ssh
  1. setup WiFi
/boot/wpa_supplicant.conf

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="MySSID"
    psk="SSIDPASSWORD"
}
  1. inert the SD card to RPi zero w and boot-up 5.Autologin in Console
sudo raspi-config
  • Select “Desktop / CLI” and then “Console Autologin”.
  1. Install openbox and x-server
sudo apt-get install -y --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox
  1. install chromium browser
sudo apt-get install -y --no-install-recommends chromium-browser
  1. Start chromium automatically when X started
/etc/xdg/openbox/autostart 

# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

# Start Chromium in kiosk mode
chromium-browser --noerrdialogs --disable-infobars --kiosk 'http://www.google.com'
  1. start x automatically
~/.bash_profile

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

Reference

@AKhateeb
Copy link

I've done many retries, it seems chromium does NOT support RPI Zero W, however, I decided to use an old RPI B2, it worked fine (Chromium in Kiosk Mode)

@holly-hacker
Copy link

holly-hacker commented Jul 5, 2024

I've been trying to get this to work. startx would give me permission errors, which I fixed the following way:

# add user to tty group to allow opening /dev/tty1
sudo usermod -aG tty pi

# fix inability to open vertual console (as per https://gist.github.com/alepez/6273dc5220c1c5ec5f3f126e739d58bf)
sudo apt-get install xserver-xorg-legacy

Then create /etc/X11/Xwrapper.config and add the following text:

allowed_users=anybody
needs_root_rights=yes

Chromium no longer supports the raspberry pi 0, so you can use firefox instead. I decided to use firefox ESR in hopes that it would use less memory. Simply change the chromium call to this:

firefox-esr -kiosk 'https://google.com'

This launches X, but after 18 minutes the screen is still black, so something must still be wrong. Any further input is appreciated.

EDIT 2024-07-06: It turns out that the most recent version of firefox doesn't want to run either. I tried looking into Midori but I don't think it has a kiosk mode. I'll probably be switching to an old pi 2 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment