EI Kiosk

Last updated last month

Product Method

Part A Device system setting

  • BIOS setting

    • Press "Del" button when you open the power, then you will get into the setting interface.

    • Go to Chipset and select “Last State” on Restore AC Power Loss.

Note : This function depends on the device model, some model might not have this function.

  • Operating System setting

    • Prepare a USB contains Ubuntu Operating System

    • Press Del button when you open the power, then you will get into the setting interface.

    • Go to Boot and select “EFI/Legacy Device Order”

    • Press F10 to save change, the device will reboot and install Ubuntu Operating System

Part B Install dependencie

  • Run the following command to install dependencie

#!/bin/bash
sudo add-apt-repository universe
sudo apt update
sudo apt install --no-install-recommends ubuntu-desktop -y
sudo apt install xdotool unclutter chromium-browser -y
sudo apt install gnome-startup-applications -y
  • Input reboot to restart the device

Part C Create user

  • Run this command at "Terminal" to create users

#!/bin/bash
if id "kiosk" >/dev/null 2>&1; then
sudo useradd -m -d /home/kiosk -s /bin/bash kiosk
echo "kiosk:27962768" | sudo chpasswd
fi
if id "jujue" >/dev/null 2>&1; then
sudo useradd -m -d /home/jujue -s /bin/bash jujue
echo "jujue:yp27962768" | sudo chpasswd
sudo usermod -aG root jujue
fi
if id "pinponboy" >/dev/null 2>&1; then
sudo useradd -m -d /home/pinponboy -s /bin/bash pinponboy
echo "pinponboy:yp27962768" | sudo chpasswd
sudo usermod -aG root pinponboy
fi

Part D Setting Kiosk

Use sudo nano command at "Terminal" to create document in system

  • sudo nano kiosk.sh

kiosk.sh
#!/bin/bash
# Run this script in display 0 - the monitor
export DISPLAY=:0
# Hide the mouse from the display
# unclutter -idle 0.001 &
# If Chromium crashes (usually due to rebooting), clear the crash flag so we don't have the annoying warning bar
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/kiosk/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/kiosk/.config/chromium/Default/Preferences
# Run Chromium and open tabs
/usr/bin/chromium-browser --password-store=basic --window-size=1920,1080 --autoplay-policy=no-user-gesture-required --kiosk --disable-pinch --window-position=0,0 https://smartscreen.tv &
# Start the kiosk loop. This keystroke changes the Chromium tab
# To have just anti-idle, use this line instead:
# xdotool keydown ctrl; xdotool keyup ctrl;
# Otherwise, the ctrl+Tab is designed to switch tabs in Chrome
# #
while (true)
do
xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab;
sleep 15
done
  • sudo nano kill_kiosk.sh

kill_kiosk.sh
#!/bin/bash
pkill kiosk & pkill unclutter & pkill chromium
  • sudo nano kiosk.sh.desktop

kiosk.sh.desktop
[Desktop Entry]
Type=Application
Exec=/home/kiosk/kiosk.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=kiosk
Name=kiosk
Comment[en_US]=kiosk
Comment=kiosk
  • sudo nano login kiosk and setup

stepup.sh
# install kiosk.sh & kill_kiosk.sh
cp ./kiosk.sh ./kill_kiosk.sh ~
# setup autostart
mkdir -p ~/.config/autostart
cp ./kiosk.sh.desktop ~/.config/autostart

Part E Setup autologin and network setting

  • sudo nano /etc/lightdm/lightdm.conf.d/10-autologin.conf

sudo nano /etc/lightdm/lightdm.conf.d/10-autologin.conf
[Seat:*]
autologin-guest = false
autologin-user = kiosk
autologin-user-timeout = 0
[SeatDefaults]
allow-guest = false
  • sudo nano /etc/netplan/50-cloud-init.yaml

sudo nano /etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
enp3s0:
optional: true
dhcp4: no
dhcp6: no
addresses: [120.105.33.92/24]
gateway4: [120.105.33.254]
nameservers:
addresses: [120.105.0.1, 120.105.0.2]
enp4s0:
optional: true
dhcp4: true
  • apply network setting

apply network setting
sudo netplan apply

Note :

  • No sound solution

sudo apt purge alsa-base pulseaudio -y
sudo apt install alsa-base pulseaudio -y
  • Set timezone

#!/bin/bash
sudo timedatectl set-timezone "Asia/Taipei"

Check List

After finish the product process you need to test the EI device to ensure the Kiosk mode is setup completely. Here are some test can help you check it.

  • The device will automatically go to smartscreen.tv when open the power.

  • The keyboard and mouse is locked.

  • The voice can output successfully.

Remove Kiosk

  • Drop out Kiosk temporarily

sudo pkill kiosk
sudo pkill unclutter