Compare commits

...

7 Commits

9 changed files with 112 additions and 7 deletions

View File

@ -1,6 +1,13 @@
AnotterKiosk N-AnotterKiosk (Not-AnotterKiosk)
============================= =============================
### I have hacked this about alot from the main branch, mainly Raspberry Pi changes
- Removed the RO filesystem
- Added scheduled screen on/off
- Added scheduled chrome page refresh
- Rpi3 Overclock settings
- Disabled KMS driver for HW screen rotation (screen rotated portrait by default)
### Overview ### Overview
Another kiosk browser OS? Yes, this one is a little bit opinionated :) Another kiosk browser OS? Yes, this one is a little bit opinionated :)
@ -69,4 +76,4 @@ Whenever the heartbeat stops (for whatever reason), the device will first restar
### Inspiration / Other Kiosk-OSes: ### Inspiration / Other Kiosk-OSes:
- https://github.com/jareware/chilipie-kiosk/ - https://github.com/jareware/chilipie-kiosk/
- https://github.com/guysoft/FullPageOS - https://github.com/guysoft/FullPageOS

View File

@ -17,6 +17,8 @@ reboot_time = 04:00
; configure screen to power on/off as specific time of day (time format in 24 hours) ; configure screen to power on/off as specific time of day (time format in 24 hours)
;screen_off_time=23:00 ;screen_off_time=23:00
;screen_on_time=07:00 ;screen_on_time=07:00
; configure chrome to refresh the page every x minutes
;refresh_screen_every_x_min=15
[wifi] [wifi]
; If you need more complex WiFi settings (like WPA2-Enterprise, hidden SSIDs, etc.) ; If you need more complex WiFi settings (like WPA2-Enterprise, hidden SSIDs, etc.)

View File

@ -80,6 +80,8 @@ systemctl enable nginx
systemctl enable ssh systemctl enable ssh
systemctl enable kiosk-sechedule-screen.service systemctl enable kiosk-sechedule-screen.service
systemctl enable schedule-reboot.service systemctl enable schedule-reboot.service
systemctl enable screen-refresh.service
systemctl enable setup-screen-refresh.service
# generate a version info/build info file # generate a version info/build info file

View File

@ -0,0 +1,10 @@
[Unit]
Description=Refresh Screen
After=graphical.target
[Service]
Type=oneshot
User=pi
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority
ExecStart=/usr/bin/refresh-screen

View File

@ -0,0 +1,11 @@
[Unit]
Description=Initial screen refresh timer setup
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/setup-refresh-timer
RemainAfterExit=true
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,4 @@
#!/bin/bash
export DISPLAY=:0
/usr/bin/xdotool key F5

View File

@ -0,0 +1,61 @@
#!/bin/bash
INI_FILE="/boot/kioskbrowser.ini"
REFRESH_INTERVAL=$(awk -F '=' '/^\[screen\]/ { in_screen=1; next }
in_screen && /^\[/ { in_screen=0 }
in_screen && $1 ~ /refresh_screen_every_x_min/ { gsub(/ /, "", $2); print $2 }' "$INI_FILE")
# Function to safely remount root FS
remount_root() {
local mode=$1
echo "Remounting root filesystem as $mode..."
mount -o remount,"$mode" / || {
echo "Failed to remount root as $mode"
exit 1
}
}
# Safely check if REFRESH_INTERVAL is a positive integer
if [[ "$REFRESH_INTERVAL" =~ ^[0-9]+$ ]] && (( REFRESH_INTERVAL > 0 )); then
echo "Setting up screen refresh every $REFRESH_INTERVAL minutes..."
SERVICE_UNIT="/etc/systemd/system/screen-refresh.service"
TIMER_UNIT="/etc/systemd/system/screen-refresh.timer"
# Remount as read-write
remount_root rw
# Write unit files
cat <<EOF | tee "$SERVICE_UNIT" > /dev/null
[Unit]
Description=Refresh Screen
[Service]
Type=oneshot
ExecStart=/usr/bin/refresh-screen
EOF
cat <<EOF | tee "$TIMER_UNIT" > /dev/null
[Unit]
Description=Run screen refresh every $REFRESH_INTERVAL minutes
[Timer]
OnBootSec=1min
OnUnitActiveSec=${REFRESH_INTERVAL}min
Persistent=false
[Install]
WantedBy=timers.target
EOF
# Reload and enable timer
systemctl daemon-reload
systemctl enable --now screen-refresh.timer
# Remount as read-only
remount_root ro
echo "Screen refresh timer setup complete."
else
echo "Invalid or missing refresh interval"
fi

View File

@ -1 +1 @@
console=serial0,115200 console=tty1 root=PARTUUID=544c6228-02 rootfstype=ext4 ro rootwait logo.nologo consoleblank=0 loglevel=0 quiet console=serial0,115200 console=tty1 root=PARTUUID=544c6228-02 rootfstype=ext4 rw rootwait logo.nologo consoleblank=0 loglevel=0 quiet

View File

@ -28,11 +28,14 @@
enable_uart=1 enable_uart=1
disable_splash=1 disable_splash=1
dtparam=audio=on dtparam=audio=on
gpu_mem=128 gpu_mem=256
# Enable DRM VC4 V3D driver # Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d #dtoverlay=vc4-kms-v3d
max_framebuffers=2 #max_framebuffers=2
# Rotate the screen
display_hdmi_rotate=1
# Run in 64-bit mode # Run in 64-bit mode
arm_64bit=1 arm_64bit=1
@ -46,10 +49,15 @@ disable_overscan=1
# (e.g. for USB device mode) or if USB support is not required. # (e.g. for USB device mode) or if USB support is not required.
otg_mode=1 otg_mode=1
[all] [pi3]
arm_freq=1350
core_freq=500
gpu_freq=500
over_voltage=4
[pi4] [pi4]
# Run as fast as firmware / board allows # Run as fast as firmware / board allows
arm_boost=1 arm_boost=1
[all] [all]
avoid_warnings=1