Setting Up Raspberry Pi Web Kiosk


This post shows steps to setup a web kiosk using Raspberry Pi. The goal is to load a web page using a browser in full-screen kiosk mode directly after boot up.

I tested it with Raspberry Pi 3 running Raspbian Stretch (November 2017 version) with Raspberry Pi official 7″ display. I used Chromium as browser. Also, Internet connection is required since the kiosk access a web site on the Internet.

 

Steps
1. install software
Install unclutter which hides mouse cursor.

 

2. Screen setting
2-1. Create .xinitrc in home directory.

2-2. Copy below lines, save and close the file.

Line 4-6 disables blank screen. [1]
Line 9 enables the mouse pointer only when it’s moving.
The browser loads full-screen weather [2] which is great for kiosk example. (Line 12)
‘incognito’ option disables session restore prompt on Chrome browser. [3] (Line 12)

 

3. Setting for launching browser when login
3-1. Open .bashrc.

3-2. Add below lines at the end of the file.

 

At this point, full-screen weather (specified at line 12 in step 2-2) will be shown after boot up. Check it by rebooting the board.
Below steps are to remove unnecessary stuff for kiosk, such as Rainbow image, Raspberry logo, Desktop GUI, login messages, etc

 

4. Disable Desktop Environment (PIXEL/LXDE)
Since desktop environment is not required for kiosk, let’s disable it.

4-1. Launch raspi-config.

4-2. Navigate to “Boot Options” > “Desktop / CLI“, then select “Console Autologin“.

 

5. Disable “Welcome to PIXEL” splash
Disable plymouth-start service.

 

6. Remove Rainbow Screen
6-1. Open “/boot/config.txt”.

6-2. Add below at the end of the file.

 

7. Remove Raspberry Pi logo and blinking cursor
7-1. Open “/boot/cmdline.txt”.

7-2. Add below at the end of the line.

‘logo.nologo’ and ‘vt.global_cursor_default=0’ remove Raspberry Pi logo and blinking cursor, respectively.

 

8. Remove login message
8-1. Create ‘.hushlogin’ file in home directory.

It removes login message below [4]:

 

9. Remove autologin message by modify autologin service
9-1. Open the unit file for autologin service.

9-2. Modify the line starts with “ExecStart”
From:

To:

It removes autologin message below:

 

10. Verify
Now, everything should be ready. Reboot the board and see if it works properly.

 

In case a lightning bolt icon is shown in the right-top corner of the screen, see this post.

 

 

References
[1] How do I prevent the screen from going blank?
[2] https://www.wunderground.com/fullscreenweather
[3] How to hide chrome warning after crash?
[4] Remove GNU licence and ‘no warranty’ thing when logging into ssh
[5] Setup a Raspberry Pi Kiosk with Chromium
[6] How to build a web kiosk with Raspberry Pi and make the SD read-only

 

 

Sponsor Link

Leave a Reply

Your email address will not be published. Required fields are marked *