Use this article only when the Raspberry Pi itself will drive an HDMI monitor or touch screen which displays the MIX (MIStudio) user interface.
If the MIStudio UI will be viewed in a web browser from a PC, HMI panel, or tablet, you do not need this setup.
Complete the Raspberry Pi Base Setup and MIX installation first.
On a Raspberry Pi OS Lite installation:
sudo apt install -y xserver-xorg xinit x11-xserver-utils openbox chromium tint2
Older Raspberry Pi OS releases may call the browser package chromium-browser.
Run:
sudo raspi-config
Choose:
System Options → Boot / Auto Login → Console Autologin
Choose Finish and do not reboot yet.
Run:
echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx' | sudo tee -a /home/mix/.bash_profile
Edit:
sudo nano /etc/xdg/openbox/environment
Add:
export KIOSK_URL=http://localhost:7226
Save with Ctrl+O, Enter, Ctrl+X.
Make a dated backup first:
sudo cp /etc/xdg/openbox/autostart /etc/xdg/openbox/autostart.bak.$(date +%Y%m%d_%H%M%S) 2>/dev/null sudo nano /etc/xdg/openbox/autostart
Replace the contents with:
# Keep the screen on xset -dpms xset s noblank xset s off # Prevent an unclean browser shutdown from stopping kiosk startup sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State' sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences # Rotate the display if required #xrandr -o left # Start the task bar and then open MIX full-screen tint2 & chromium --noerrdialogs --disable-infobars --disk-cache-dir=/dev/null --disk-cache-size=1 --kiosk $KIOSK_URL
Save with Ctrl+O, Enter, Ctrl+X.
Use chromium-browser instead of chromium on older Raspberry Pi OS releases.
If ErgoTech supplied an on-screen keyboard extension, add its --load-extension=<folder> option before --kiosk.
An unexpected power loss can leave Chromium lock files behind. On the next boot Chromium may then report which the profile appears to be in use by another Chromium process.
The boot-maintenance script can safely remove these stale locks before the kiosk starts.
Back up the current file:
sudo cp /etc/rc.local /etc/rc.local.bak.$(date +%Y%m%d_%H%M%S) sudo nano /etc/rc.local
Find:
chmod 1777 /tmp
Immediately after it, add:
# Remove stale browser locks and cap the desktop error log
rm -f /home/mix/.config/chromium/Singleton*
find /home/mix -name ".xsession-errors" -size +10M -exec truncate -s 1M {} \;
Save with Ctrl+O, Enter, Ctrl+X.
Test the complete startup-maintenance script before rebooting:
sudo sh -x /etc/rc.local
It should finish without shell errors.
sudo reboot
The expected result is:
mix user logs in automatically.If the kiosk does not start, use the troubleshooting article before changing additional configuration.