Pārlūkot izejas kodu

Fix SpoolBuddy kiosk screen blanking immediately on boot

  The touchscreen display blanked right after boot, requiring a touch
  to wake. Two issues: no consoleblank=0 in cmdline.txt (kernel blanks
  the console during Plymouth→labwc transition), and the wlr-randr
  anti-blank loop slept 60s before its first run.

  - Add consoleblank=0 to kernel cmdline in install.sh
  - Move sleep after wlr-randr in labwc autostart so it fires immediately
maziggy 1 mēnesi atpakaļ
vecāks
revīzija
42028ffc98
2 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 1 0
      CHANGELOG.md
  2. 5 2
      spoolbuddy/install/install.sh

+ 1 - 0
CHANGELOG.md

@@ -16,6 +16,7 @@ All notable changes to Bambuddy will be documented in this file.
 - **REST Smart Plug: Separate Power/Energy URLs and Unit Multipliers** ([#472](https://github.com/maziggy/bambuddy/issues/472)) — REST/Webhook smart plugs can now use individual URLs for power and energy data instead of requiring all values in a single status response. Each value falls back to the shared Status URL when no separate URL is configured, so existing setups work without changes. Added power and energy multipliers for unit conversion (e.g., set energy multiplier to `0.001` to convert Wh to kWh). Useful for platforms like ioBroker that expose each data point as a separate API endpoint.
 
 ### Fixed
+- **SpoolBuddy Kiosk Screen Blanks on Boot** — The touchscreen display would blank immediately after the RPi booted, requiring a touch to wake. Added `consoleblank=0` to the kernel cmdline to disable Linux console blanking during the Plymouth-to-labwc transition, and changed the `wlr-randr` anti-blank loop to fire immediately instead of sleeping 60 seconds first.
 - **Queue Widget Ignores Plate-Clear Setting** ([#752](https://github.com/maziggy/bambuddy/issues/752)) — The "Clear Plate & Start Next" button on printer cards appeared even when "Require plate-clear confirmation" was disabled in Settings → Queue. The backend correctly auto-dispatched without waiting, but the frontend widget always showed the prompt. The widget now respects the setting and shows a passive queue link instead when plate-clear confirmation is disabled.
 - **WebSocket Crash on Printers Without `fun` Field** ([#873](https://github.com/maziggy/bambuddy/issues/873)) — Connecting to printers that don't send the MQTT `fun` field (A1, P1 series, X1Plus firmware) caused a repeating `'str' object has no attribute 'get'` crash in the WebSocket handler, showing the printer as offline with missing AMS and SD card info. The developer mode probe introduced in 0.2.3b1 published an MQTT message inside `_update_state()` between overwriting `raw_data` with the full MQTT dict (where `vt_tray` is a raw dict) and restoring the previously normalized list — the `publish()` call released the GIL, letting the event loop read the un-normalized dict and iterate over string keys instead of spool dicts. Fixed by normalizing `vt_tray` dict→list in the MQTT data before assignment, and moving preserved field restoration before the probe. Added defensive normalization in `printer_state_to_dict` as a belt-and-suspenders guard.
 

+ 5 - 2
spoolbuddy/install/install.sh

@@ -1003,6 +1003,9 @@ setup_kiosk() {
         # Remove serial console (Plymouth needs tty-only console)
         sed -i 's/console=serial0,[0-9]* //' "$cmdline"
 
+        # Disable console blanking (kernel default is 600s, can blank during boot transition)
+        grep -q "consoleblank=" "$cmdline" || sed -i 's/$/ consoleblank=0/' "$cmdline"
+
         # Add splash quiet loglevel=3 logo.nologo if missing
         grep -q "splash" "$cmdline" || sed -i 's/$/ splash quiet loglevel=3 logo.nologo/' "$cmdline"
 
@@ -1178,8 +1181,8 @@ EOF
 # Force 1024x600 (panel doesn't advertise this natively)
 wlr-randr --output HDMI-A-1 --custom-mode 1024x600@60 &
 
-# Prevent display blanking (labwc 0.9.x has no config option for this)
-(while true; do sleep 60; wlr-randr --output HDMI-A-1 --on 2>/dev/null; done) &
+# Prevent display blanking (labwc <0.8 lacks screenBlankTimeout config support)
+(while true; do wlr-randr --output HDMI-A-1 --on 2>/dev/null; sleep 60; done) &
 
 # Launch Chromium via helper that resolves URL from spoolbuddy/.env
 $kiosk_launcher &