In order to be able to visualise the home control interface on the touch screen, a browser is required. The resolution of the touch screen is limited to 800x480, so every pixel counts. By putting the browser in full screen mode and hiding all the navigation bars, maximum space is made available. This is often referred to as "kiosk mode".

Browser

Rick has already demonstrated how to put the stock browser "Epiphany" in kiosk mode. In order to try something different and be able to compare with Rick's solution, I decided to use the Chromium browser instead.

Chromium is not available in the default repositories. But according to this thread, Chromium can be sourced from the Ubuntu repositories, in order to install on Raspbian Jessie.

To solve this issue, specify which display to use the browser with (the touch screen):

pi@piiot1:~ $ chromium-browser --display=:0

Tadaaa! Chromium is installed and running on Raspberry Pi.

Kiosk

With Chromium installed and executable, let's take a look at some interesting switches. Switches are command line parameters that can be passed when launching Chromium, altering its behaviour and/or appearance.

For my application, these seemed like the most relevant switches:

--display: specify the display to launch the browser on

--kiosk: enable kiosk mode, full screen without toolbars or menus

--noerrdialogs: do not display any error dialogs

--disable-pinch: disable pinching to zoom

--overscroll-history-navigation: disable swiping left and right to navigate back and forth between pages

Navigation

At startup, the Chromium browser is started with different tabs. These tabs are not visible due to the kiosk mode though (and can't accidentally be closed either). In order to navigate between these tabs and refresh their content, we need to know how to simulate the correct keypresses, triggering the tab switching.

What this does, is switch tab by simulating the "CTRL + <TAB_ID>" combination, optionally followed by an "F5", refreshing the selected tab.

Trellis

In order to implement this tab switching functionality, I'm using the 4x4 button matrix called Trellis, which I introduced in my previous post. It connects to the I2C pins and requires two software libraries to be installed.

On the hardware side, nothing fancy: connect the Trellis to the I2C pins and power it via the 5V pin:

On the software side, start by installing some dependencies, if not yet installed: