Skip to content
ArtMG edited this page Feb 6, 2024 · 8 revisions

This project looks at minimal ways to offer a browser. It also looks to add a small display with basic touch input, to use the Pi as a kiosk for purposes including:

  • monitoring and alerting
  • home automation
  • media playback information and control
  • simply watching videos in a browser

For simplicity we assume that the main application is web-based, so we only need a browser. Alternatives could include minimal media centre solutions (e.g. Kodi-oriented LibreElec), but these often don't have full browsing capabilities.

Also, our use-cases for kiosks are concerned more with accessibility than security. We do not anticipate them being used in environments where security or session refresh / cleanup are issues.

see also:

  • Media Centre
    • specialist distros for playing videos and music

Display

As opposed to the regular HDMI connection, you may have an integral screen on the device, using a direct-controlled display panel,

Hardware

  • Quimat 3.5 Inch Touch Screen Monitor 320*480 Resolution TFT LCD Display
    • single point touch
    • may be ordered with Protective Case + 3 x Heat sinks+ To [ASIN: B06W55HBTX] (c. £20)

Drivers

Some vendors have developed drivers using the Linux Framebuffer, so kernel fbtft drivers are available in recent images. Others may need installing according to vendor's instructions.

The Pi Foundation 7" display requires the packages raspberrypi-ui-mods raspberrypi-net-mods which are easy to install from the repos.

# for Quimat 3.5" model
sudo apt-get update
sudo apt-get install -y git

git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show

# extras for 201703 Raspbian
# credit [https://github.com/goodtft/LCD-show]
cd LCD-show
sudo dpkg -i -B xserver-xorg-input-evdev_1%3a2.10.3-1_armhf.deb
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
sudo reboot

Configure and calibrate

  • [https://ittechandtips.com/2016/02/10/raspberry-pi-installing-your-3-5-inch-touchscreen-display/]
  • [http://www.circuitbasics.com/raspberry-pi-touchscreen-calibration-screen-rotation/]
  • xinput-calibrator
  • console blanking
    • e.g. near end of /etc/rc.local
      • sudo sh -c "TERM=linux setterm -blank 0 >/dev/tty0"

Tweaks

### change orientation (rotate display)
sudo nano /boot/config.txt

# At the top of the file, enter a new line:
display_lcd_rotate=2

# display_hdmi_rotate=2   # alternative if you need to change orientation of your HDMI output
# credit https://www.raspberrypi.org/documentation/configuration/config-txt/video.md


### switch between Quimat display and hdmi

sudo su
HDMI-SYS-SHOW

# Revert to LCD
sudo su
LCD35-SYS-SHOW

Software

browser

Browsers that work well in kiosk mode include:

  • kweb
    • minimal
    • some limitations, but many helper apps
    • see [https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=40860&p=1135605&hilit=kiosk#p1135605]
  • chrome
    • fully featured
    • could be offered as "backup" alternative to kweb
    • based on Google's Blink engine, originally forked from WebKit's WebCore
  • firefox
    • ?
    • based on Mozilla's Gecko engine
    • kiosk addins available
  • ?
    • based on WebKit, with development by Apple and other mobile manufacturers

There have been some less mainstream minimal browsers for Pi platforms including: pschultz kiosk-browser, Topguy mlbrowser; however these projects were not active for long and are now somewhat dusty. Also they require a thick stack below them, so might not be optimal.

Android apps

If you want to use a tablet-type system as a limited function kiosk, or remote-control style device you might consider the following apps:

WPE: Web Platform for Embedded

One to watch may be WPE developed by metrological Bv (NL), smart TV developers, that is being adopted by some major TV corporations. After developing for Wayland, they are looking at other backends.

They already support Wayland and EGLFS (plugin for Qt5 apps directly on EGL / OpenGL ES without windowing system)

links:

  • [https://blogs.igalia.com/magomez/2016/12/19/wpe-web-platform-for-embedded/]
  • [https://wiki.qt.io/RaspberryPi2EGLFS]

Supporting stack

The open kiosk stack Porteus does not currently have an Arm build, and others that do like Linutop are commercial. Perhaps it's almost as easy, and certainly more educational, to build your own stack :)

You could use Full Raspbian (rather than lite) and startx to go graphic. Some people think that's overkill and propose other solutions. You might find that a Pi 3 will be powerful enough to use the full desktop stack and still work quickly enough. On the other hand a Pi Zero might require a more minimal approach. You can always try Full Raspbian first to see.

  • LXDE desktop

    • if it works fast enough, try the Pixel desktop improvements by RPF
  • Xorg

    • to set up minimal kiosk see [http://stackoverflow.com/a/24178824]
  • pygame

    • [http://www.furtherfield.org/rp-resources/RP-workshop-handout.pdf]
    • [http://www.pygame-doku.laymaxx.de/tut/intro/intro.html]
  • Urwid.org

  • Framebuffer browsers

    • the Linux framebuffer allows you to drive graphics from the console
    • it avoids X Window System altogether
    • Browsers include:
      • NetSurf
        • raspbian repo version requires X
        • see netsurf-fb for version using framebuffer (sdl) backend
        • packages available for arch linux
      • Link2 (now somewhat dated)
      • Zetakey [https://www.zetakey.com/browser-linux.php]
        • Webkit-based,
        • HTML 5 compatible
        • Free for private, non-commercial usage
        • Supports arm
    • see Webkit Audio Container
      • Source to build a Qt app rendering WebKit to sit directly on framebuffer
      • [https://github.com/slandis/Webkit-Audio-Container]
      • [https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=170924]
  • Wayland window system (and Maynard desktop)

    • RPF / Raspbian waiting on vc4 ?
    • might work in Fedora?
  • vc4 (foss) driver is to make use of (Pi's) broadcom hardware graphical accelerator

    • active development, but still a work in progress

Desktop on Raspbian Lite

If you want to avoid some of the 'bloat' of full Raspbian, you can start off with Raspbian Lite. On top you can add either a stripped version or the regular version of the PIXEL desktop.

# credit - https://www.raspberrypi.org/forums/viewtopic.php?t=133691

####  EITHER  Stripped Raspbian Pixel

# this brings the bare minimum for desktop

sudo apt install --no-install-recommends raspberrypi-ui-mods lxsession
# these are optional extras to theme properly
sudo apt install pi-greeter rpd-icons gtk2-engines-clearlookspix

# if you get errors setting up raspberrypi-ui-mods update-desktop-database: not found
#  sudo apt install desktop-file-utils gconf2


####     OR   regular Raspbian Pixel

# This brings the usual Pixel experience, 
but without all the apps and services of 
full raspbian.

sudo apt install raspberrypi-ui-mods


#### Chromium Browser

sudo apt install rpi-chromium-mods


#### kiosk user

KIOSK_USER=kiosk
KIOSK_USERNAME=Kiosk
KIOSK_PWD=kioSk4
 
sudo adduser --disabled-password --gecos "$KIOSK_USERNAME" $KIOSK_USER
echo ${KIOSK_USER}:${KIOSK_PWD} | sudo chpasswd
sudo usermod -a -G audio,video $KIOSK_USER

#### Autologin
sudo sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=pi/autologin-user=$KIOSK_USER/"
# earlier versions did not have it enabled
sudo sed /etc/lightdm/lightdm.conf -i -e "s/^#autologin-user=,*/autologin-user=$KIOSK_USER/"


#### Auto-start Chromium

sudo mkdir -p /home/$KIOSK_USER/.config/lxsession/LXDE-pi/
# credit - https://raspberrypi.stackexchange.com/a/40745
sudo cp /etc/xdg/lxsession/LXDE-pi/autostart /home/$KIOSK_USER/.config/lxsession/LXDE-pi/autostart

sudo tee -a /home/$KIOSK_USER/.config/lxsession/LXDE-pi/autostart <<EOF!
@chromium-browser --incognito --kiosk https://www.google.co.uk/
EOF!
sudo chown $KIOSK_USER:$KIOSK_USER /home/$KIOSK_USER/.config/lxsession/LXDE-pi/autostart

You may choose to vary the incognito, kiosk or url, and you may consider adding in ad- or flash-blocking components, depending on your use-case.

To help understand and diagnose issues with Desktop configurations, see also: https://github.com/artmg/lubuild/blob/master/help/configure/Desktop.md

Other distros

check out:

  • Arch Linux ARM (ALARM)
  • Fedora ARM [https://fedoraproject.org/wiki/Architectures/ARM]