Building a Custom Perspective Kiosk on Linux Hardware

Indeed, that looks like a capable machine. Will keep it in mind.
We ordered a few of these recently, good experience so far!

We've been using OnLogic for 95% of our Edge deployments. While we've had a few units sent back for RMA, dealing with their team is always easy, well worth the minor frustrations we've encountered.

On a side note, looks like others have made some good headway on a Perspective-native solution for on-screen-keyboard:

Forum: https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/26?u=chris_bingham
Blog: https://www.aoautomation.io/blog/tutorials-lessons-learned-1/perspective-number-keypad-3
Exchange: https://inductiveautomation.com/exchange/2380/installation

I still like the idea of OS keyboard (mobile users vs desktop vs touchscreen, etc.). However, that Exchange keyboard is looking promising.

I got in touch with OnLogic, but after the appalling customer service experience, they are off the list for any future considerations.

If you read the overview on that keypad, you will see that I wrote the original one he based it on about 18 months ago. He has attributed this nicely in the description, which is actually very nice of him, so kudos to him, also his graphics look nicer than mine.
This keypad is great, but it fails every time on login. So thats why I abandoned it as a solution for touchscreen HMI usage.
The only way to get the login to work with a keypad without editing IA code is to use the OS keyboard.

1 Like

I've been playing around with other Chromium packages. Promising results so-far with Electron. OSK (ubuntu-frame-osk) working as-expected, drop-down menus not crashing the browser. I followed this example (Packaging an Electron application (Quick Start) as an IoT GUI - Docs - Ubuntu Community Hub) as a starting point. Basically, on a development box (with certain dependencies pre-installed, including ubuntu-frame):

cd ~
git clone https://github.com/MirServer/iot-example-graphical-snap.git
cd iot-example-graphical-snap
git checkout 22/Electron-quick-start
# Update default URL @ parts:electron-helloworld:override-build
sudo nano snap/snapcraft.yaml 
# Update chromium flags @ exec $SNAP/.../electron-quick-start
sudo nano wrapper/wrapper.sh
lxd init --auto
snapcraft
sudo snap install --dangerous *.snap
/snap/iot-example-graphical-snap/current/bin/setup.sh
# Edit: Comment below due to plugs should be connected in setup script above.
# sudo snap connect iot-example-graphical-snap:wayland
sudo snap set iot-example-graphical-snap daemon=true

Now taking some vacation for a week. Hope to return and finish setting up a deployable kiosk to test out...

1 Like

This time, focusing exclusively on snap packages. Here are the solutions I've been toying with:

  • Chromium Browser via electron-quick-start (inspiration from the above iot-example snap script, opted for Quick Start | Electron instead)
    • Pros: Lots. Snap package is easy to deploy, should work on Ubuntu Core (needs testing), easy to update... Easy to add additional flags to browser call w/ integration to snap environment vars: 'snap set url', 'snap set host-rules', etc. App loads after reboot without any fancy footwork (i.e. automatically AFTER ubuntu-frame). OSK fully functional at IDP. Scroll bars are meaningful, window rescales as expected, etc.
    • Cons: Found an issue (perhaps the only one, albeit significant) whereby the OSK appears only briefly within Perspective Project when clicking on an input field, then closes & does not reappear :slightly_frowning_face: .
  • Perspective Workstation Snap w/ Xwayland functionality. I was able to package Xwayland and a window manager in a snap, and display a -different- Java app on ubuntu-frame. I've been working through packaging Perspective Workstation in the snap, but keep hitting various Java errors I'm trying to work through.
    • Pros: TBD
    • Cons: The developer. :slight_smile: I haven't been able to successfully load the workstation-linux.jar to test anything yet. Snap environment & confinement are all uphill for this guy. Luckily, I've got a firehose nearby to keep me hydrated.
1 Like

Right now I have a bit of a rollout script for ubuntu-server.
Pre-requisites are Ignition Edge installed and internet access.
Not the neatest but it boots into perspective after the gateway runs.

#!/bin/bash
# Install Ubuntu-Frame:
echo "INFO    | Installing Ubuntu Frame snap..."
snap install ubuntu-frame
snap set ubuntu-frame daemon=true
snap connect ubuntu-frame:wayland

# Install UbuntuFram OSk:
echo "INFO    | Installing Frame OSK snap..."
snap install ubuntu-frame-osk
snap set ubuntu-frame-osk daemon=true
snap set ubuntu-frame-osk theme=dark
snap connect ubuntu-frame-osk:wayland

my_Url="http://demo.inductiveautomation.com"
echo "INFO    | my_Url=http://127.0.0.1:8088/data/perspective/client/Edge"

# Install Firefox Snap:
echo "INFO    | Installing Firefox snap..."
snap install firefox
snap connect firefox:wayland

# Install Firefox Snap:
echo "INFO    | Installing CURL ..."
apt install curl

# Create Service to run Firefox in Ubuntu-Frame:
echo "INFO    | Creating Service to run Firefox at startup..."
cat > /etc/systemd/system/firefox-frame.service << EOF
[Unit]
Description=Firefox Wayland Kiosk
After=snap.ubuntu-frame.daemon.service snap.ubuntu-frame-osk.daemon.service Ignition-Gateway.service getty.target
Wants=snap.ubuntu-frame-osk.daemon.service
Requires=snap.ubuntu-frame.daemon.service Ignition-Gateway.service
Conflicts=display-manager.service
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=3
Environment=WAYLAND_DISPLAY=wayland-0
Environment=MOX_CRASHREPORTER_DISABLE=1
Environment=GDK_BACKEND=wayland
Environment=MOZ_ENABLE_WAYLAND=1
Environment=HOME=/root
Environment=XDG_RUNTIME_DIR=/run/user/0
Environment=XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
ExecStartPre=/usr/bin/sleep 10
ExecStartPre=/snap/bin/firefox --CreateProfile "default"
ExecStartPre=sh /usr/bin/local/runKiosk.sh
ExecStart=/snap/bin/firefox -P default --kiosk --private-window "http://127.0.0.1:8088/data/perspective/client/Edge"
Nice=15

[Install]
WantedBy=graphical.target
EOF

# Create delay script to wait for working gateway:
echo "INFO    | Creating script to delay starting till Ignition Edge is running...."
cat > /usr/bin/local/runKiosk.sh << EOF
#!/bin/bash

until [ "`curl --silent --max-time 1 --fail "http://127.0.0.1:8088/StatusPing" | grep 'RUNNING'`" != "" ];
do
  sleep 2
done
EOF

echo "INFO    | Reload daemon, start kiosk, enable service at startup..."
systemctl daemon-reload
systemctl start firefox-frame
systemctl enable firefox-frame
1 Like