Switch to Paho v2 callbacks; add loop_start() and reconnect_delay_set() for auto-reconnect Rework on_connect/on_disconnect to v2 signatures; handle session_present and reconnection flows Gate heartbeats with client.is_connected() and add short retry on rc=4 (NO_CONN) Re-send discovery after reconnect; ensure re-subscription to all topics Add startup terminal message with ISO timestamp in simclient.py Docs: update README and Copilot instructions with reconnection/heartbeat guidance and benign rc=4 notes
52 lines
2.4 KiB
Plaintext
52 lines
2.4 KiB
Plaintext
# Infoscreen Client configuration template
|
|
# Copy this file to .env and fill in values appropriate for your environment.
|
|
|
|
# Environment
|
|
# IMPORTANT: CEC TV control is automatically DISABLED when ENV=development
|
|
# to avoid constantly switching the TV on/off during testing.
|
|
# Set to 'production' to enable automatic CEC TV control.
|
|
ENV=development # development | production
|
|
DEBUG_MODE=0 # 1 to enable debug mode
|
|
LOG_LEVEL=INFO # DEBUG | INFO | WARNING | ERROR
|
|
|
|
# MQTT Broker Configuration
|
|
# Replace with your MQTT broker hostname or IP. Do NOT commit real credentials.
|
|
MQTT_BROKER=<your-mqtt-broker-host-or-ip>
|
|
MQTT_PORT=1883
|
|
|
|
# Timing Configuration (seconds)
|
|
HEARTBEAT_INTERVAL=60 # Heartbeat frequency in seconds
|
|
SCREENSHOT_INTERVAL=180 # Screenshot capture frequency in seconds
|
|
DISPLAY_CHECK_INTERVAL=15 # Display Manager event check frequency in seconds
|
|
|
|
# File/API Server (used to download presentation files)
|
|
# By default, the client rewrites incoming file URLs that point to 'server' to this host.
|
|
# If not set, FILE_SERVER_HOST defaults to the same host as MQTT_BROKER.
|
|
# You can also set FILE_SERVER_BASE_URL (e.g., http://192.168.1.10:8000) to override entirely.
|
|
FILE_SERVER_HOST= # optional: e.g., 192.168.43.100
|
|
FILE_SERVER_PORT=8000 # default port for API server
|
|
FILE_SERVER_SCHEME=http # http or https
|
|
# FILE_SERVER_BASE_URL= # optional: takes precedence over the above when set
|
|
|
|
# HDMI-CEC TV Control (optional)
|
|
# Automatically turn TV on/off based on event scheduling
|
|
# NOTE: CEC is automatically DISABLED when ENV=development to avoid constantly switching TV on/off during testing
|
|
CEC_ENABLED=true # Enable automatic TV power control in production (true/false)
|
|
CEC_DEVICE=0 # Target CEC device (TV, 0, etc.)
|
|
CEC_TURN_OFF_DELAY=30 # Seconds to wait before turning off TV after last event ends
|
|
CEC_POWER_ON_WAIT=5 # Seconds to wait after power ON command (for TV to boot up)
|
|
CEC_POWER_OFF_WAIT=5 # Seconds to wait after power OFF command (increased for slower TVs)
|
|
|
|
# Optional: MQTT authentication (if your broker requires username/password)
|
|
#MQTT_USERNAME=
|
|
#MQTT_PASSWORD=
|
|
|
|
# Optional TLS settings (if using secure MQTT)
|
|
#MQTT_TLS_CA_CERT=
|
|
#MQTT_TLS_CERT=
|
|
#MQTT_TLS_KEY=
|
|
|
|
# Notes:
|
|
# - Keep actual secrets and host-specific values in a local .env file that is NOT committed.
|
|
# - This template is safe to check into version control.
|