Skip to content

Instantly share code, notes, and snippets.

@jonathanbarton
Last active March 25, 2019 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanbarton/b0f6ea34b51e4774ac553a516ee67abd to your computer and use it in GitHub Desktop.
Save jonathanbarton/b0f6ea34b51e4774ac553a516ee67abd to your computer and use it in GitHub Desktop.
Pi Zero (Jessie/Stretch) Chromium Kiosk Mode

IA. New Raspbian Image?

Cross-Platform:

Download: https://www.balena.io/etcher/

Raspbian Image List: http://downloads.raspberrypi.org/raspbian/images/ Raspbian Latest Image: https://www.raspberrypi.org/downloads/raspbian/ (Use full desktop image)

IB. Clone Existing Image?

Notes: Make sure you use the same size/format SD card, as writing to different size cards regardless of image file size can cause issues.

Windows:

Download: https://sourceforge.net/projects/win32diskimager/

MacOS:

diskutil list

sudo dd if=/dev/disk2 of=~/Desktop/raspberrypi.dmg

diskutil unmountDisk /dev/disk2

sudo newfs_msdos -F 16 /dev/disk2

sudo dd if=~/Desktop/raspberrypi.dmg of=/dev/disk2

II. Setup After Booting Up

1. Setup Wifi:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add the following to the end of file:

network={
    ssid="testing"
    psk="testingPassword"
    # key_mgmt=NONE ## Uncomment this line and comment out psk if unprotected network
}

Restart wlan0:

wpa_cli -i wlan0 reconfigure

2. Setup SSH

sudo raspi-config -> Interfacing Options -> SSH -> Enable

3. Autologin user:

sudo raspi-config -> Boot Options -> Console Autologin

4. Reboot:

sudo reboot

5. Copy autostart script into current autologin user (pi):

cp /etc/xdg/lxsession/LXDE-pi/autostart /home/pi/.config/lxsession/LXDE-pi/autostart
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart

Notes: the /home/pi/.config/lxsession/LXDE-pi/autostart file and parent folders MAY not exist; if they don't, edit the /etc/xdg/lxsession/LXDE-pi/autostart directly. This will change autostart settings for ALL USERS.

6. Edit autostart script (replace http://localhost with URL):

#@xscreensaver -no-splash  # comment this line out to disable screensaver
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --kiosk http://localhost/ 

List of commandline switches for chromium: https://peter.sh/experiments/chromium-command-line-switches/

or use man chromium-browser

7. Reboot:

sudo reboot

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