Bart Simons

Bart Simons

Thoughts, stories and ideas.

Bart Simons



.net .net 5 .net core Apache C# CentOS LAMP NET Framework Pretty URLs Windows Server WireGuard access log add analysis android api at the same time authentication authorization automate automation azure azurerm backup bash basics batch bootstrap build capture cheat sheet chromium chroot class cli click to close code coverage code snippet command line commands compile compiling compression containers control controller controlling convert cpu usage create credentials csv csvparser curl data dd deployment desktop detect devices disable diskpart dism distributed diy docker dom changes dotnet core drivers ease of access encryption example export file transfer files fix folders framework generalize getting started ghost gui guide gunicorn gzip html html tables icewarp igd imagex import inotify install installation interactive ios iphone itunes java javascript jquery json kiosk kotlin linux live load data loading screen lock screen loopback audio lxc lxd lxml macos manage manually message messages minio mirrored mod_rewrite monitor monitoring mstest mutationobserver mysql net 5 nexmo nginx no oobe node node.js nodejs not installing notification notifications object storage on desktop one command openssl owncloud parallels parallels tools parse perfect philips hue play port forwarding powershell processing ps-spotify python quick raspberry pi record rip ripping rsync rtmp save save data sbapplication scraping script scripting scriptingbridge scripts security send server service sharedpreferences sms songs sonos spotify spotify api spotlight ssh stack streaming streamlink studio sudo swarm swift sync sysprep system audio systemd tables terminal testing tracking tutorial twilio ubiquiti ubuntu ubuntu 18.04 ui code unifi unlock unsplash source upnp uptime usb tethering wallpapers wasapi website websites webview windows windows 10 without itunes without oobe workaround xaml

Raspberry Pi Kiosk Tutorial

The Raspberry Pi has proven itself to be a great computing device while keeping cost as low as possible. For less than $40 you are getting a great little device with its 64-bit ARM processor. This made me think, would it be a good idea to turn the Raspberry Pi 3 into a kiosk?

The software that you'll need

A list is not even needed, because you only need three things: Raspbian Jessie Lite installed as the OS, the X11 display stack installed and the Chromium webbrowser installed on the Pi.

Why Chromium

Chromium is the open source variant of the popular Google Chrome browser. It has great potential for this project because of the --kiosk flag. With this option you can create a full-screen browser window inside your empty X11 session.

Installing the X11 display stack

You can install the X11 display stack on your Raspberry Pi with the following command:

sudo apt install xserver-xorg xinit

This will install the X11 server on your Pi together with the X11 server initialisation program. You also have to run this command:

sudo dpkg-reconfigure x11-common

To select who's authorized to start the X11 server. Make sure it is set like this:

x11-common package reconfiguration

Installing Chromium

Just run sudo apt install chromium-browser to install Chromium on your Pi. It's literally that simple.

Writing the .xinitrc script

When you execute the xinit command on your Pi, you will see a terminal window instead of Chromium. To fix this, you'll need to write a file in your home directory called ~/.xinitrc. This file contains everything that gets run when the X11 server starts up. So, edit this file with nano (or any other text editor) and make sure it looks like this:

.xinitrc file with Chromium

Save it, and try running Chromium by invoking the xinit command on your Pi.

But... my window is not fullscreen!

It could be that your Pi shows black borders around the screen, which has to do something with overscan. Open your /boot/config.txt file (with sudo) and add disable_overscan=1 to this file like this:

Disable Overscan

Reboot your Pi and the problem should magically disappear! (at least, that's what happened to me...)

Starting X11 at boot

Raspbian comes with a built-in tool to configure your Pi: raspi-config. Run this command on your Pi and you will be greeted with a command-line dialog window. Go to option 3 and press enter:

raspi-config main menu option 3

And then go for option 2:

raspi-config boot options option 2

Press enter, go to finish and when the program asks for a reboot choose yes.

Once you have rebooted your Pi, you'll have to do one more thing to finish this project: finally starting X11 at boot! My method might be more sophisticated than needed, but hey: it worked for me. Edit the ~/.bashrc file in your favourite text editor and add the following to the bottom of the file:

if [ -z "$SSH_CLIENT" ] || [ -z "$SSH_TTY" ]; then
    xinit -- -nocursor

save the file and reboot your Pi. Enjoy your beautiful self-made Raspberry Pi Kiosk!

Load webpage from an URL specified in a file

A Raspberry Pi with the default partition layout contains two partitions: the OS partition, and the BOOT partition which is formatted in FAT32 and gets automatically mounted at boot. For example: create a new file in /boot/ called website.txt and put your desired URL in it. Finally to make it work you simply replace the URL in your ~/.xinitrc file with $(cat /boot/website.txt) and it should work! The thing is that you can actually see and modify contents of this file in Windows, since the BOOT partition is partitioned as FAT.

Bart Simons

Bart Simons

View Comments