Just thought I would chuck a little guide together to get a working Perspective Kiosk on simple Raspberry Pi 4 Hardware.
Webkit Browser Engine: supported by Ignition as part of Safari compatibility.
Full Kiosk Mode: No desktop OS on this system, no other apps, no way to exit.
Hardware Acceleration: Panel PC hardware supported by linux is able to be utilised.
On Screen Keyboard: Critical missing piece of 99% of similar attempts. Auto opens and closes with focus on text entry elements.
Auto-Boot: System Boots on power on, no login and ready to go in 25seconds.
Auto Network Refresh: The system will refresh the page automatically when a network change is detected.
No Menus: No interface items at all besides the rendered webpage.
Touchscreen Support: Any touchscreen that works in linux is usable.
I have built and tested this on the Seeed Studios ReTerminal-DM, which is a $700AUD 10.1" Raspberry Pi Compute Module 4 based panel computer.
This guide assumes you are able to work out simple tasks like setting an IP and editing a text file on linux.
Use this at own risk.
Install a copy of the latest version of (6.1.21 or higher) Raspbian Lite OS, follow the manufacturer guide for your device, for me, I followed:
*If you have the ReTerminal-DM, don’t do the touchscreen orientation section.
** Critical steps here - Enable SSH, Set a username and password.
This should get you set up with a Pi that boots to a console login page with the username and password that you chose when uploading the image.
Setting Up the Kiosk
Log in to this console with SSH, this is now your base for all the commands on the unit.
Enter the following into the terminal:
$ sudo apt update $ sudo apt install snapd
You will also need to reboot your device. This can be accomplished from the terminal (and from the desktop), but make sure you save any open documents first:
$ sudo reboot
After this, install the core snap in order to get the latest snapd.
$ sudo snap install core core 16-2.45.2 from Canonical✓ installed
Now install Ubuntu Frame with the following command:
$ sudo snap install ubuntu-frame
On Raspbian, Ubuntu Frame does not start by default. To change this default run the following command:
$ sudo snap set ubuntu-frame daemon=true
Now install wpe-webkit-mir-kiosk:
$ sudo snap install wpe-webkit-mir-kiosk
Now we connect it to the display server:
$ sudo snap connect wpe-webkit-mir-kiosk:wayland
As per above, on Raspbian, wpe-webkit-mir-kiosk does not start by default. To change this default run the following command:
$ sudo snap set wpe-webkit-mir-kiosk daemon=true
Now we set the target url for your perspective session, which here is the demo ignition on IA web server.
$ sudo snap set wpe-webkit-mir-kiosk url=http://demo.inductiveautomation.com
Now start the service:
$ sudo snap start wpe-webkit-mir-kiosk
You should now see on screen the perspective session you linked to.
On Screen Keyboard
Next we configure the On Screen Keyboard:
$ sudo snap install ubuntu-frame-osk
Make sure it’s connected to the display server interface:
$ snap connect ubuntu-frame-osk:wayland
And make it a service:
$ sudo snap **set** ubuntu-frame-osk daemon=true
You can switch between light and dark mode with the theme option:
$ sudo snap set ubuntu-frame-osk theme=dark $ sudo snap set ubuntu-frame-osk theme=light
Now we have a working system on the screen, and if you have a working touchscreen, it should be able to interact with the session as normal.
On my system, the LCD was set up in portrait orientation, which is not the install direction for the unit, so to fix this we open up some settings.
$ sudo nano /boot/cmdline.txt
Use the arrow keys to navigate to the end of the line and add the following:
Then we save and exit the file (+W , Y , )
(1 = Rotate Clockwise 90 degrees, 2 = 180, 3 = 270)
$ sudo reboot
Now your Pi should boot and display the screen in the right orientation.
You may notice that the system will always boot to a browser error saying “dns resolution failed”, This is because the system boots up and starts the browser before the network interface is connected and online.
To fix this, we do a little hack fix (There is likely a nice way to do this, but this works if a little messy).
$sudo nano /lib/dhcpd/hooks/01-Test
Now we add at the bottom of the file the following:
if [ $reason = “BOUND”] || [ $reason = “STATIC”]; then snap set wpe-webkit-mir-kiosk url=https://demo.inductiveautomation.com fi
This effectively reloads the url every time the network either gets a new DHCP address or is configured with a Static IP, which happen every time you reconnect a network.
I have a bunch of other tweaks figured out, but this should get you started pretty well.
One note of warning though, the Raspberry Pi has very limited processing power, and you will need to build any pages you want to display fairly well and follow the optimisation tips in the forum to keep your loading times down to a reasonable time.
I can see a bunch of people on Maker Edition using this for simple projects, and that is probably the best use of limited hardware like this.