start_web_conditionally.py read the flag with
`config_data.get("web_display_autostart", False)`, so a config that simply
lacked the key got no web interface. Both config/config.template.json and
first_time_install.sh ship the key as true, so the code default contradicted
the shipped default in two places: absence means an older or hand-edited
config, not a request to stay down.
The failure mode was silent in the worst way. The "not starting" path exits 0,
so `systemctl status ledmatrix-web` reported the unit as successfully started
while nothing was listening on the port, and the only trace was one journal
line saying the flag was "false or not set" -- which reads as a deliberate
setting rather than a missing key.
Also start the web interface when config.json is missing or unparseable,
instead of exiting. The web interface is how a config gets created and
repaired, so a broken config is exactly when the user needs it most; leaving
it down means there is no way back in. Only an explicit false/off disables
autostart now, and the disabled message says "explicitly disabled" so the
journal distinguishes a real setting from a default.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Utility Scripts
This directory contains utility scripts for maintenance and system operations.
Scripts
clear_cache.py- Clears LEDMatrix cache data (specific keys or all cache)start_web_conditionally.py- Conditionally starts the web interface based on config settingswifi_monitor_daemon.py- Background daemon that monitors WiFi/Ethernet connection and manages access point modecleanup_venv.sh- Cleans up Python virtual environment filesclear_python_cache.sh- Clears Python cache files (pycache, *.pyc, etc.)pixlet_config_editor.sh- Opens Pixlet's own config UI for one installed Starlark appapply_dns_single_request.sh- Addsoptions single-requestto the resolver (run byledmatrix-dns-fix.service)
Usage
Clear Cache
python3 scripts/utils/clear_cache.py --list # List cache keys
python3 scripts/utils/clear_cache.py --clear-all # Clear all cache
python3 scripts/utils/clear_cache.py --clear <key> # Clear specific key
Start Web Interface Conditionally
This script is typically called by the systemd service (ledmatrix-web.service) and checks the web_display_autostart setting in config/config.json before starting the web interface.
WiFi Monitor Daemon
This daemon is typically run as a systemd service (ledmatrix-wifi-monitor.service) and automatically manages WiFi access point mode based on network connectivity.
Pixlet Config Editor
Run it when you want Pixlet's own config form for a Starlark app -- live render preview, cascading dropdowns -- rather than the LEDMatrix one.
./scripts/utils/pixlet_config_editor.sh # list installed apps
./scripts/utils/pixlet_config_editor.sh penndot_signs # edit, on localhost:8080
Deliberately not a service. It stops the display for the length of the
session and pixlet serve listens with no authentication, so it should only
be running while you are actually editing. It backs the config up first and
restarts the display on exit, however it exits.
It binds loopback only, with no flag to change that: anything that can reach
pixlet serve can rewrite the app's config, and a printed warning is not
access control. To edit from another machine, forward the port -- SSH does the
authenticating and nothing is left listening on the LAN:
ssh -L 8080:localhost:8080 pi@ledpi.local
Apply DNS Single-Request Fix
Installed and run by ledmatrix-dns-fix.service; see systemd/README.md.
Safe to run by hand (sudo ./scripts/utils/apply_dns_single_request.sh) and
idempotent.