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:25] herwarthraspberry_pi_kiosk [2020/05/16 18:44] (current) herwarth
Line 1: Line 1:
-====== Introduction ======+====== Raspberry as Kiosk PC ====== 
 +===== Introduction =====
 This howto describes how to install a Chromium based kiosk using minimal installation. Everything is done as the root user in this howto. This howto describes how to install a Chromium based kiosk using minimal installation. Everything is done as the root user in this howto.
-====== Installation ====== +===== Installation ===== 
-===== Raspbian Buster Lite ===== +==== Raspbian Buster Lite ==== 
-Download Raspbian Booster Lite edition at: [[https://www.raspberrypi.org/downloads/raspbian/]]+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 and change the hostname: Use raspi-config to set network and change password of the pi user and change the hostname:
 <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>
-===== R/O and R/W 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'
Line 101: Line 120:
 /dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro) /dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
 </code> </code>
-====== Graphical User Interface ======+===== Graphical User Interface =====
 Because we have a R/O filesystem now, we need to make it R/W when doing stuff. Because we have a R/O filesystem now, we need to make it R/W when doing stuff.
 <code> <code>
 rw rw
 </code> </code>
-===== Install Xserver =====+==== Install Xserver ====
 <code> <code>
 apt-get -y install --no-install-recommends xserver-xorg xinit xterm x11-xserver-utils apt-get -y install --no-install-recommends xserver-xorg xinit xterm x11-xserver-utils
-apt-get -y install --no-install-recommends lighhtdm openbox unclutter+apt-get -y install --no-install-recommends lightdm openbox unclutter
 </code> </code>
 The pi user needs to be added to the tty group: The pi user needs to be added to the tty group:
Line 115: Line 134:
 usermod -a -G tty pi usermod -a -G tty pi
 </code> </code>
-===== Chromium browser =====+==== Chromium browser ====
 Chromium supports kiosk mode, which is great for our purpose Chromium supports kiosk mode, which is great for our purpose
 <code> <code>
 apt-get -y install --no-install-recommends chromium-browser apt-get -y install --no-install-recommends chromium-browser
 </code> </code>
-===== Autostart =====+==== Autostart ====
 Edit the autostart script to start the browser once logged in: Edit the autostart script to start the browser once logged in:
 <code - /etc/xdg/openbox/autostart> <code - /etc/xdg/openbox/autostart>
Line 134: Line 153:
 </code> </code>
 Reboot! Your Pi should now start in Chromium Kiosk mode! Reboot! Your Pi should now start in Chromium Kiosk mode!
 +{{tag>linux}}
raspberry_pi_kiosk.1579811107.txt.gz · Last modified: by herwarth