User Tools

Site Tools


raspberry_pi_kiosk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
raspberry_pi_kiosk [2020/01/23 20:10] herwarthraspberry_pi_kiosk [2020/05/16 18:44] (current) herwarth
Line 1: Line 1:
-====== Introduction ====== +====== Raspberry as Kiosk PC ====== 
-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 Booster Lite edition at: [[https://www.raspberrypi.org/downloads/raspbian/]]+==== Raspbian Buster Lite ==== 
 +Download Raspbian Buster Lite edition at: [[https://www.raspberrypi.org/downloads/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:
 <code> <code>
-sudo raspi-config+raspi-config
 </code> </code>
 <code> <code>
Line 15: Line 16:
 systemctl start ssh.service systemctl start ssh.service
 </code> </code>
-===== Making the system a read-only system =====+<code - /etc/systemd/timesyncd.conf> 
 +[Time] 
 +NTP=172.16.0.254 
 +#FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org 
 +#RootDistanceMaxSec=5 
 +#PollIntervalMinSec=32 
 +#PollIntervalMaxSec=2048 
 +</code> 
 +==== 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.
 <code> <code>
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 - /etc/fstab> <code - /etc/fstab>
-proc                  /proc             proc    defaults                                    0 0 +proc                  /proc              proc    defaults                                    0 0 
-PARTUUID=6c586e13-01  /boot             vfat    defaults,ro                                 0 2 +PARTUUID=6c586e13-01  /boot              vfat    defaults,ro                                 0 2 
-PARTUUID=6c586e13-02                 ext4    defaults,noatime,ro                         0 1 +PARTUUID=6c586e13-02                  ext4    defaults,noatime,ro                         0 1 
-tmpfs                 /tmp              tmpfs   defaults,noatime,nosuid,mode=1777,size=100m 0 0 +tmpfs                 /tmp               tmpfs   defaults,noatime,nosuid,mode=1777,size=100m 0 0 
-tmpfs                 /var/tmp          tmpfs   defaults,noatime,nosuid,size=30m            0 0 +tmpfs                 /var/tmp           tmpfs   defaults,noatime,nosuid,size=30m            0 0 
-tmpfs                 /var/log          tmpfs   defaults,noatime,nosuid,mode=0755,size=100m 0 0 +tmpfs                 /var/log           tmpfs   defaults,noatime,nosuid,mode=0755,size=100m 0 0 
-tmpfs                 /var/run          tmpfs   defaults,noatime,nosuid,mode=0755,size=2m   0 0 +tmpfs                 /var/run           tmpfs   defaults,noatime,nosuid,mode=0755,size=2m   0 0 
-tmpfs                 /var/lib/lightdm  tmpfs   defaults,noatime,nosuid,size=30m            0 0 +tmpfs                 /etc/console-setup tmpfs   defaults,noatime,nosuid,mode=0755,size=2m   0 0 
-tmpfs                 /home/pi          tmpfs   defaults,noatime,nosuid,size=500m           0 0+tmpfs                 /var/lib/systemd/timesync tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0 
 +tmpfs                 /var/lib/lightdm   tmpfs   defaults,noatime,nosuid,size=30m            0 0 
 +tmpfs                 /home/pi           tmpfs   defaults,noatime,nosuid,size=100m           0 0
 </code> </code>
 <code> <code>
Line 66: Line 77:
 TimeoutSec=30s TimeoutSec=30s
 </code> </code>
-Because /var/spool is also a tmpfs filesystem, we need to disable that directory to become mask 0755. Comment out the following line so it looks like this: +Because /var/spool is also a tmpfs filesystem, we need to disable that directory to become mask 0755. Copy the following file 
-<code - /usr/lib/tmpfiles.d/var.conf>+<code> 
 +cp /usr/lib/tmpfiles.d/var.conf /etc/tmpfiles.d 
 +</code> 
 +comment out the following line so it looks like this: 
 +<code - /etc/tmpfiles.d/var.conf>
 . .
 . .
Line 73: Line 88:
 #d /var/spool 0755 - - - #d /var/spool 0755 - - -
 </code> </code>
-===== Disable ugly boot splash and rotate screen ===== +==== 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+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 - /boot/config.txt> <code - /boot/config.txt>
 +.
 +.
 +.
 display_rotate=3 display_rotate=3
 disable_splash=1 disable_splash=1
 </code> </code>
-===== ro and rw aliases to make writable filesystem easy =====+==== 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: Bash aliases to remount filesystem RO and RW are very convenient. Add the following at the end of the following file:
 <code - /etc/bash.bashrc> <code - /etc/bash.bashrc>
Line 89: Line 107:
     PS1='\[\033[01;32m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '     PS1='\[\033[01;32m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
 } }
 +alias temp='/opt/vc/bin/vcgencmd measure_temp'
 alias ro='sudo mount -o remount,ro / ; sudo mount -o remount,ro /boot' alias ro='sudo mount -o remount,ro / ; sudo mount -o remount,ro /boot'
 alias rw='sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot' alias rw='sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot'
 PROMPT_COMMAND=set_bash_prompt PROMPT_COMMAND=set_bash_prompt
 </code> </code>
- +Reboot the system. Login and check if the filesystems are mounted R/O 
 +<code> 
 +mount |grep /dev/ |grep ro 
 +</code> 
 +<code> 
 +/dev/mmcblk0p2 on / type ext4 (ro,noatime) 
 +/dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro) 
 +</code> 
 +===== Graphical User Interface ===== 
 +Because we have a R/O filesystem now, we need to make it R/W when doing stuff. 
 +<code> 
 +rw 
 +</code> 
 +==== Install Xserver ==== 
 +<code> 
 +apt-get -y install --no-install-recommends xserver-xorg xinit xterm x11-xserver-utils 
 +apt-get -y install --no-install-recommends lightdm openbox unclutter 
 +</code> 
 +The pi user needs to be added to the tty group: 
 +<code> 
 +usermod -a -G tty pi 
 +</code> 
 +==== Chromium browser ==== 
 +Chromium supports kiosk mode, which is great for our purpose 
 +<code> 
 +apt-get -y install --no-install-recommends chromium-browser 
 +</code> 
 +==== Autostart ==== 
 +Edit the autostart script to start the browser once logged in: 
 +<code - /etc/xdg/openbox/autostart> 
 +xset -dpms 
 +xset s off 
 +xset s noblank 
 +unclutter -idle 0 & 
 +chromium-browser --noerrdialogs --disable-infobars --kiosk https://www.google.com & 
 +</code> 
 +Enable auto login to graphical desktop. Choose 3 Boot Options -> B1 Desktop / CLI -> B4 Desktop Autologin  
 +<code> 
 +raspi-config 
 +</code> 
 +Reboot! Your Pi should now start in Chromium Kiosk mode! 
 +{{tag>linux}}
raspberry_pi_kiosk.1579810214.txt.gz · Last modified: by herwarth