display: refresh EPD on WAN interface change and improve WAN detection#8
Merged
display: refresh EPD on WAN interface change and improve WAN detection#8
Conversation
Introduce dynamic WAN selection to monitor and select the optimal WAN interface at runtime. Changes include: - Health check subsystem for WAN interfaces (periodic latency and reachability probes). - Scoring algorithm to evaluate interfaces using latency, throughput and error rates. - Failover and recovery logic to move traffic away from degraded links. - Configuration options to tune probe intervals, thresholds, and to enable/disable selection. - Integration with existing WAN manager/daemon and CLI. - Unit and integration tests covering key scenarios. - README and config schema updates with usage examples. This improves availability and performance for multi-WAN deployments while keeping backward compatibility when the feature is disabled.
When the WAN manager starts reconfiguring interfaces it writes a transitional state ("reconfiguring") into the runtime WAN state.
Detect this transition in the E-Paper daemon and perform a best-effort display clear before rendering the next status frame. For such transitions we also force a full (non-gentle) refresh to minimise artifacts.
This reduces visual glitches when the active interface changes while keeping normal gentle/partial updates for routine refreshes.
- Clear and force full refresh when active WAN interface switches (e.g. eth0 -> wlan1)\n- Prefer kernel default route when wan_state is missing\n- Remove redundant "WAN" prefix and suppress "[WAN] unknown" messages in renderer\n- Reserve footer area to avoid text overlap and adjust fonts\n- Backwards-compatible StatusCollector init handling for older installs
…1.0\n- Add changelog entry for display/WAN improvements (commit 478b8ee)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: display: refresh EPD on WAN interface change and improve WAN detection
Summary
This PR improves runtime WAN detection and E-Paper (EPD) rendering behavior. The primary goals are:
wan_state_pathfor testing and overrides.EPaperDaemoninitialization tolerant of olderStatusCollectorsignatures (backwards-compatible fallback).Version was bumped to
3.1.0andCHANGELOG.mdwas updated. See commits478b8eeandeee6e81for the implementation and release bump.Changes (high-level)
azazel_pi/core/display/status_collector.pywan_state_pathargument for injection/testing.ip route get) to determine the active interface.azazel_pi/core/display/epd_daemon.pyStatusCollectorsignatures (catchesTypeErrorand retries without the extra param).azazel_pi/core/display/renderer.pyFiles changed
azazel_pi/core/display/status_collector.pyazazel_pi/core/display/epd_daemon.pyazazel_pi/core/display/renderer.pyCHANGELOG.md(added 3.1.0 entry)pyproject.toml(version bump to 3.1.0)Why this is a minor bump (3.0.0 -> 3.1.0)
All changes are backward-compatible runtime improvements and feature additions (no breaking API changes). They primarily improve behavior (EPD UX and detection heuristics), so a minor version increment is appropriate.
How to test (developer / CI)
python3 -m venv .venv source .venv/bin/activate pip install -U pip pip install pytest pytest-cov pytest -vsudo python3 /opt/azazel/azazel_pi/core/display/epd_daemon.py --debug # or, if testing the workspace copy directly (less privileged): python3 ./azazel_pi/core/display/epd_daemon.py --debugExample log excerpts (observed during development)
These excerpts are representative of the output produced during development and debugging.
TypeError observed before the runtime was updated (illustrates compat fix):
Daemon startup and update loop messages (normal debug output):
Interface detection/log example (route-based fallback):
When a WAN change is detected the daemon logs a message and forces a clear + full refresh; look for a message similar to:
Deployment notes (on-device)
/opt/azazel/azazel_pi. If you deploy the workspace copy over the installed copy, back up the existing/opt/azazel/azazel_pifirst.azazel-epd.servicesystemd unit. Rotation and daemon options can be controlled via the systemd drop-in at/etc/systemd/system/azazel-epd.service.d/override.confusingEnvironment=entries, e.g.:Environment=EPD_ROTATION=180./opt, run:Checklist for reviewers
Commits of interest
478b8ee— display: refresh EPD on WAN interface change and improve WAN detection (feature implementation)eee6e81— chore(release): bump version to 3.1.0 (changelog + pyproject)