This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| raspberry_pi_kiosk [2020/01/23 19:58] – herwarth | raspberry_pi_kiosk [2020/05/16 18:44] (current) – herwarth | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | This howto describes how to install a Chromium based kiosk using minimal installation. | + | ===== Introduction |
| - | ====== Installation | + | This howto describes how to install a Chromium based kiosk using minimal installation. Everything is done as the root user in this howto. |
| - | ===== Raspbian Buster Lite ===== | + | ===== Installation ===== |
| - | Download Raspbian | + | ==== Raspbian Buster Lite ==== |
| + | Download Raspbian | ||
| Use Etcher or whatever to install the downloaded zip on a SD card. | Use Etcher or whatever to install the downloaded zip on a SD card. | ||
| - | ===== Initial settings to enable remote configuration | + | ==== Initial settings to enable remote configuration ==== |
| - | Use raspi-config to set network and change password of the pi user | + | Use raspi-config to set network and change password of the pi user and change the hostname: |
| < | < | ||
| - | sudo raspi-config | + | raspi-config |
| </ | </ | ||
| < | < | ||
| Line 15: | Line 16: | ||
| systemctl start ssh.service | systemctl start ssh.service | ||
| </ | </ | ||
| - | ===== Making the system a read-only system | + | <code - / |
| + | [Time] | ||
| + | NTP=172.16.0.254 | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | </ | ||
| + | ==== Making the system a read-only system ==== | ||
| The goal is to make a Kiosk so we can disconnect the power and do no harm to the filesystem. We also want to limit SDCard wear. | The goal is to make a Kiosk so we can disconnect the power and do no harm to the filesystem. We also want to limit SDCard wear. | ||
| < | < | ||
| Line 32: | Line 41: | ||
| Edit fstab so it looks something like this. Your PARTUUIDs are different! | Edit fstab so it looks something like this. Your PARTUUIDs are different! | ||
| <code - / | <code - / | ||
| - | proc /proc | + | proc /proc proc defaults |
| - | PARTUUID=6c586e13-01 | + | PARTUUID=6c586e13-01 |
| - | PARTUUID=6c586e13-02 | + | PARTUUID=6c586e13-02 |
| - | tmpfs / | + | tmpfs / |
| - | tmpfs / | + | tmpfs / |
| - | tmpfs / | + | tmpfs / |
| - | tmpfs / | + | tmpfs / |
| - | tmpfs / | + | tmpfs / |
| - | tmpfs / | + | tmpfs / |
| + | tmpfs / | ||
| + | tmpfs / | ||
| </ | </ | ||
| < | < | ||
| Line 53: | Line 64: | ||
| cp / | cp / | ||
| </ | </ | ||
| + | Edit the copied service file and make the Service section look like this: | ||
| + | <code - / | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | [Service] | ||
| + | Type=oneshot | ||
| + | RemainAfterExit=yes | ||
| + | ExecStartPre=/ | ||
| + | ExecStart=/ | ||
| + | ExecStop=/ | ||
| + | TimeoutSec=30s | ||
| + | </ | ||
| + | Because /var/spool is also a tmpfs filesystem, we need to disable that directory to become mask 0755. Copy the following file | ||
| + | < | ||
| + | cp / | ||
| + | </ | ||
| + | comment out the following line so it looks like this: | ||
| + | <code - / | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | #d /var/spool 0755 - - - | ||
| + | </ | ||
| + | ==== Disable ugly boot splash and rotate screen ==== | ||
| + | I need to rotate the screen, because I use the monitor in portrait mode. 0=normal, 1=90 degrees CW, 2=180 degrees CW, 3=90 degrees CCW, and 4=upside down. Add the following to the end of the file: | ||
| + | <code - / | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | display_rotate=3 | ||
| + | disable_splash=1 | ||
| + | </ | ||
| + | ==== R/O and R/W aliases to make writable filesystem easy ==== | ||
| + | Bash aliases to remount filesystem RO and RW are very convenient. Add the following at the end of the following file: | ||
| + | <code - / | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | set_bash_prompt() { | ||
| + | fs_mode=$(mount | sed -n -e " | ||
| + | PS1=' | ||
| + | } | ||
| + | alias temp='/ | ||
| + | alias ro=' | ||
| + | alias rw=' | ||
| + | PROMPT_COMMAND=set_bash_prompt | ||
| + | </ | ||
| + | Reboot the system. Login and check if the filesystems are mounted R/O | ||
| + | < | ||
| + | mount |grep /dev/ |grep ro | ||
| + | </ | ||
| + | < | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | ===== Graphical User Interface ===== | ||
| + | Because we have a R/O filesystem now, we need to make it R/W when doing stuff. | ||
| + | < | ||
| + | rw | ||
| + | </ | ||
| + | ==== Install Xserver ==== | ||
| + | < | ||
| + | apt-get -y install --no-install-recommends xserver-xorg xinit xterm x11-xserver-utils | ||
| + | apt-get -y install --no-install-recommends lightdm openbox unclutter | ||
| + | </ | ||
| + | The pi user needs to be added to the tty group: | ||
| + | < | ||
| + | usermod -a -G tty pi | ||
| + | </ | ||
| + | ==== Chromium browser ==== | ||
| + | Chromium supports kiosk mode, which is great for our purpose | ||
| + | < | ||
| + | apt-get -y install --no-install-recommends chromium-browser | ||
| + | </ | ||
| + | ==== Autostart ==== | ||
| + | Edit the autostart script to start the browser once logged in: | ||
| + | <code - / | ||
| + | xset -dpms | ||
| + | xset s off | ||
| + | xset s noblank | ||
| + | unclutter -idle 0 & | ||
| + | chromium-browser --noerrdialogs --disable-infobars --kiosk https:// | ||
| + | </ | ||
| + | Enable auto login to graphical desktop. Choose 3 Boot Options -> B1 Desktop / CLI -> B4 Desktop Autologin | ||
| + | < | ||
| + | raspi-config | ||
| + | </ | ||
| + | Reboot! Your Pi should now start in Chromium Kiosk mode! | ||
| + | {{tag> | ||