Skip to content

fix(wake): reliable WoL delivery, MAC backfill from probes, actionable failure hint - #24

Merged
gthgomez merged 1 commit into
mainfrom
fix/wake-reliability
Oct 8, 2026
Merged

gthgomez merged 1 commit into
mainfrom
fix/wake-reliability

Conversation

@gthgomez

@gthgomez gthgomez commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Investigation findings (wake button "does not work")

  1. Missing MACs silently disabled WoL: only SSDP discovery persisted wifi/ethernet MACs; the periodic device-info probe never wrote them back, so TVs added manually by IP could never receive magic packets. Probes now backfill missing MACs (DeviceRegistry.backfillNetworkIdentity, never overwriting known values).
  2. Broadcast delivery was fragile: a single burst to 255.255.255.255 — commonly dropped by routers/APs with client isolation. Wake now sends 3 bursts to both the global and the subnet-directed broadcast derived from the TV's IP (pure wakeBroadcastAddresses helper, 4 unit tests), with a 500ms settle before the Home keypress probe.
  3. Opaque failure: a wake attempt with no saved MAC now says so ("rescan the TV to capture one") instead of a generic failure.

Hardware caveat that no app change can lift: deep-off wake requires Fast TV Start (or equivalent) enabled on the TV; standby wake works over the network regardless.

Verification

./gradlew :app:assembleDebug :app:testDebugUnitTest — pass; WakeBroadcastAddressesTest 4/4.

…hint

Investigation found three silent failure modes in the wake path:
1. Manual-by-IP devices never had wifi/ethernet MACs stored (only SSDP discovery persisted them; the device-info probe wrote none back), so WoL was silently skipped. Every successful probe now backfills missing MACs (DeviceRegistry.backfillNetworkIdentity).
2. WoL sent one burst to 255.255.255.255 only — many routers/APs drop the global broadcast. Now sends 3 bursts to BOTH the global and the subnet-directed broadcast derived from the TV's own IP (wakeBroadcastAddresses, unit-tested), with a 500ms settle before the Home probe.
3. Wake failure feedback said nothing when no MAC existed; it now appends a 'rescan to capture a MAC' hint.

Verification: ./gradlew :app:assembleDebug :app:testDebugUnitTest — pass (WakeBroadcastAddressesTest 4/4)
@gthgomez
gthgomez merged commit 4a8b956 into main Oct 8, 2026
@gthgomez
gthgomez deleted the fix/wake-reliability branch October 8, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant