====== MIX Raspberry Pi Kiosk Display ====== 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 [[BaseRaspberryPiSetupBookworm] |Raspberry Pi Base Setup]] and [[InstallingMIXOnRPi]| MIX installation]] first. ===== 1. Install the graphical components ===== 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%%''. ===== 2. Enable console auto-login ===== Run: sudo raspi-config Choose: **System Options -> Boot / Auto Login -> Console Autologin** Choose **Finish** and do not reboot yet. ===== 3. Start the graphical display automatically ===== Run: echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx' | sudo tee -a /home/mix/.bash_profile ===== 4. Set the MIX kiosk address ===== Edit: sudo nano /etc/xdg/openbox/environment Add: export KIOSK_URL=http://localhost:7226 Save with **Ctrl+O**, **Enter**, **Ctrl+X**. ===== 5. Configure Chromium kiosk startup ===== 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=%%'' option before ''%%--kiosk%%''. ===== 6. Add browser recovery to rc.local ===== 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. ===== 7. Reboot and verify the kiosk ===== sudo reboot The expected result is: - The Pi boots. - The ''%%mix%%'' user logs in automatically. - The graphical session starts. - Chromium opens the MIX interface full-screen. - No Chromium profile-lock warning appears. If the kiosk does not start, use the [[RaspberryPiTroubleshootingandSupportChecks]|troubleshooting article]] before changing additional configuration.