Skip to content

chasecee/pi-kiosk-scripts

Repository files navigation

Raspberry Pi Chromium Kiosk Setup README

This README provides a guide on setting up a Raspberry Pi to automatically launch Chromium in kiosk mode, displaying a specified webpage on boot. You can clone this repo or just use it as a guide to set it up yourself.

Prerequisites

  • Raspberry Pi (tested on Pi Zero 2 W)
  • Raspberry Pi OS with desktop environment
  • Basic familiarity with terminal and command line

Step-by-Step Guide

Initial Setup

  1. Install Raspberry Pi OS :
  • Use Raspberry Pi Imager to flash Raspberry Pi OS (with desktop) to an SD card.
  • Boot your Raspberry Pi with this SD card.
  • Follow the setup wizard (connect to Wi-Fi, update software, etc.).
  1. Enable SSH (Optional) :
  • For remote access, enable SSH on your Pi.

Install Necessary Packages

  1. Install Chromium and Unclutter :
  • Open a terminal.
  • Update and install Chromium:
sudo apt-get update
sudo apt-get install chromium-browser
  • Install unclutter to hide the mouse cursor:
sudo apt-get install unclutter
  • Install xdotool to manage display sleep/wake:
sudo apt-get install xdotool x11-utils

Configure Autostart (Attempted Method)

  1. Autostart Setup :
  • Edit the LXDE autostart script:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
  • Add the following to launch Chromium in kiosk mode:
@xset s off
@xset -dpms
@xset s noblank
@unclutter -idle 0.1 -root
@chromium-browser --kiosk --noerrdialogs --disable-translate --disable-infobars --disable-features=TranslateUI --incognito "http://your-web-page.com"
  • Replace "http://your-web-page.com" with your desired URL.

Cron Job Setup (Alternative Method)

  1. Create a Startup Script :
  • Create a script in /home/pi/pi-kiosk-scripts/:
mkdir -p /home/pi/pi-kiosk-scripts
nano /home/pi/pi-kiosk-scripts/start_chromium.sh
  • Or use the script from this repo
  • Add the following content to the script:
#!/bin/bash
export DISPLAY=:0
xset s off
xset -dpms
xset s noblank
unclutter -idle 0.1 -root &
chromium-browser --kiosk --noerrdialogs --no-restore --disable-translate --disable-infobars --disable-features=TranslateUI --incognito "http://your-web-page.com"
  • Make the script executable:
chmod +x /home/pi/pi-kiosk-scripts/start_chromium.sh
  1. Set Up Cron Job :
  • Edit the crontab file:
crontab -e
  • Add the following line to run the script at boot:
@reboot sleep 60 && /home/pi/pi-kiosk-scripts/start_chromium.sh

Troubleshooting

  • Logs : Add logging to your script for troubleshooting.
  • Manual Testing : After reboot, test the script manually.
  • Cron Logs : Check cron logs (grep CRON /var/log/syslog) for issues.
  • Display Issues : Ensure the script is executed when the graphical environment is ready.

Final Notes

  • This setup was tailored for a Raspberry Pi 4B running Raspberry Pi OS with desktop.
  • Adjustments may be necessary for different hardware or software versions.
  • This guide assumes a basic level of comfort with command-line operations and text file editing on the Raspberry Pi.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages