Project kali ini kita akan membuat display menggunakan rasbperi pi
akan di pasang display 7 inch yang di gunakan untuk menampilkan informasi dari BMS via web browser
konsepnya install armbian kemudian instal chromium full page untuk display page bms
challengenya gimana caranya bms bia terdisplay tanpa username dan password.
Kita tidak akan memakai distro yang sudah jadi.
Kita coba custom manual dari awal instalasi armbian
- Install armbian versi lite biar gak makan storage lebih besar
- buat scrip install yang isinya sbb
#!/bin/bash
set -e
KIOSK_URL="https://192.168.50.28"
KIOSK_USER="pi"
echo "=== Update system ==="
sudo apt update
sudo apt upgrade -y
echo "=== Install X11 + Openbox + Chromium ==="
sudo apt install -y \
xserver-xorg \
x11-xserver-utils \
xinit \
openbox \
chromium \
unclutter \
dbus-x11 \
fonts-noto \
fonts-noto-color-emoji
echo "=== Create Openbox config ==="
mkdir -p /home/$KIOSK_USER/.config/openbox
cat > /home/$KIOSK_USER/.config/openbox/autostart <<EOF
# Disable screen blanking
xset s off
xset s noblank
xset -dpms
# Hide mouse cursor
unclutter -idle 0.5 -root &
# Start Chromium kiosk
while true; do
chromium \
--kiosk \
--noerrdialogs \
--disable-infobars \
--disable-session-crashed-bubble \
--disable-translate \
--disable-pinch \
--overscroll-history-navigation=0 \
--no-first-run \
--start-maximized \
"$KIOSK_URL"
sleep 3
done
EOF
echo "=== Create .xinitrc ==="
cat > /home/$KIOSK_USER/.xinitrc <<EOF
#!/bin/sh
exec openbox-session
EOF
chmod +x /home/$KIOSK_USER/.xinitrc
echo "=== Configure auto start X on tty1 ==="
touch /home/$KIOSK_USER/.bash_profile
if ! grep -q "startx" /home/$KIOSK_USER/.bash_profile; then
cat >> /home/$KIOSK_USER/.bash_profile <<'EOF'
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
startx
fi
EOF
fi
echo "=== Fix permissions ==="
sudo chown -R $KIOSK_USER:$KIOSK_USER /home/$KIOSK_USER/.config
sudo chown $KIOSK_USER:$KIOSK_USER /home/$KIOSK_USER/.xinitrc
sudo chown $KIOSK_USER:$KIOSK_USER /home/$KIOSK_USER/.bash_profile
echo "=== Enable console autologin ==="
sudo raspi-config nonint do_boot_behaviour B2 || true
echo "======================================="
echo " KIOSK INSTALL COMPLETE"
echo " URL : $KIOSK_URL"
echo " Reboot with: sudo reboot"
echo "======================================="