DIY Projects

Open an HTML page when starting Raspberry Pi OS with Chromium Browser in full screen (kiosk mode)

The Chromium browser installed by default on Raspberry Pi OS allows like all internet browsers to open a web page in full screen. Kiosk mode is used to display a Node-RED Dashboard, the interface of a home automation server such as Jeedom, Domoticz, Home Assistant. Combined with a touch screen, you can easily control your home automation accessories from any room in the house.

 

To control home automation accessories, it is best to run the home automation software on a NAS or on another Raspberry Pi.

Benefits of kiosk mode

You can, of course, just press the F11 key to bring up the browser in full screen. However, you have to do it manually every time after launching the browser. By running the browser in Kiosk mode, the application will automatically launch in full screen. Users cannot bring it back to normal window by pressing F11 key.

When you run browsers in Kiosk mode,

Check that Chromium is installed

Open a Terminal and run this command to verify that Chromium is correctly installed on the system (this is the case by default).

chromium-browser --version
 --disable-quic --enable-tcp-fast-open --ppapi-flash-path=/usr/lib/chromium-browser/libpepflashplayer.so --ppapi-flash-args=enable_stagevideo_auto=0 --ppapi-flash-version=
Chromium 78.0.3904.108 Built on Raspbian , running on Raspbian 10

If Chromium is not installed, run the following command to do so

sudo apt-get install --no-install-recommends chromium-browser

Minimum configuration on Raspberry Pi OS Lite

To be able to start Chromium, the X11 graphics rendering engine must be installed. If you are using the Desktop version of Raspberry Pi OS, you can skip to the next paragraph.

The Lite version is the minimum version without a graphical interface suitable for servers or the Raspberry Pi Zero WH.

Note. You will install the X11 graphical environment on your distribution. The performance of your installation decreases you. It is possible to choose not to start X11.

Run the following command

sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit

At the end of the installation, launch X11 by executing the command

startx

Test Chromium startup in Kiosk mode

Run the following command, replacing the blog’s internet address with the web page you are interested in, for example Domoticz at http://localhost:8080/#/Dashboard

/usr/bin/chromium-browser --kiosk  https://diyprojects.io

Here is the test performed with a Waveshare 1024 x 600 pixel touchscreen.

Open a web page automatically when starting Raspberry Pi OS

To launch Chromium automatically and open a Web page, all you have to do is modify the autostart file on the LXDE desktop. Start by opening the configuration file

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Then add the following commands without forgetting to modify the page to load at startup

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
/usr/bin/chromium-browser --kiosk  --disable-restore-session-state http://localhost:8080/#/Dashboard

Here, we start the Domoticz Dashboard

Save with the key combination Ctrl + X then Y.

Wait until the WiFi connection is available before launching Chromium

If the connection to the WiFi network is not yet established, you may get a white screen at startup. To avoid this, you only need to modify a few boot parameters using the raspi-config utility .

sudo raspbi-config

Go to the Boot Options menu

Activer l’option B2 Wait for Network at Boot

Open the B1 Desktop / CLI option and choose the B4 Desktop Autologin Desktop GUI option which will automatically launch the graphical desktop without asking for the pi user password .

To restart

Raspberry Pi OS restarts and automatically opens the Domoticz Dashboard.

Tips and Frequently Asked Questions

Here are some tips and frequently asked questions

How to exit kiosk mode (full screen)

Function key F11 is disabled in Kiosk mode. You must use the Alt + F4 key combination to exit full screen mode.

Can we access the Raspberry Pi with VNC in full screen mode?

Yes, absolutely, you can use VNC to use the RPi remotely from another computer connected on the same network. The displayed screen will be perfectly identical. To exit kiosk mode, use the Alt + F4 key combination .

Can we access the dashboard of a home automation server such as Domoticz or Home Assistant?

Yes, absolutely. You just have to indicate the address of the Dashboard in the autostart file of LXDE

Disable automatic start

Just comment out with the # character the chromium-browser command like this

# /usr/bin/chromium-browser --kiosk --disable-restore-session-state http://localhost:8080/#/Dashboard

Can we use a virtual keyboard?

There is a virtual keyboard called Matchbox. The problem is that it remains permanently in the foreground unlike the virtual Windows keyboard which is displayed only when the cursor is placed in an input field.

To install lMatchbox

sudo apt install matchbox-keyboard

Updates

2020/11/04 First publication of the article

Version française

Click to rate this post!
[Total: 0 Average: 0]
Exit mobile version