Skip to content

Add passive mDNS discovery as a second device-discovery source#840

Draft
chrisdp wants to merge 3 commits into
masterfrom
feature/mdns-passive-discovery
Draft

Add passive mDNS discovery as a second device-discovery source#840
chrisdp wants to merge 3 commits into
masterfrom
feature/mdns-passive-discovery

Conversation

@chrisdp

@chrisdp chrisdp commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Adds passive mDNS / DNS-SD discovery as a second source alongside the existing SSDP discovery, wired into RokuFinder so it needs no DeviceManager changes.

What it does

  • New MdnsListener joins the mDNS multicast group and listens for device announcements without sending any queries. This adds no traffic of its own and sidesteps the responder rate-limiting that makes repeated active scanning unreliable.
  • Identifies Rokus by the integrator=Roku TXT marker (or the _display service) and reads the serial from the device's .local hostname, which matches the SSDP USN serial one-to-one.
  • RokuFinder translates sightings into its existing found / lost events, deduped by serial. mDNS sightings deliberately bypass the ssdp:alive heartbeat-suppression path, which is tuned to Roku's ~20-minute SSDP cadence and does not apply to mDNS. mDNS sightings also reset the active-scan settle timer so they participate in scans.
  • Zero new dependencies: the DNS wire parsing is hand-rolled.

Notes

  • mDNS is opportunistic and best-effort: it reliably catches boot/join/change/goodbye and any responses other hosts' queries elicit, but does not guarantee finding a long-idle device. SSDP remains the primary, dependable source; mDNS supplements it and provides richer TXT metadata (model, firmware, friendly name).
  • Also adds a project mdns-scan skill (.claude/skills/mdns-scan/): a standalone scanner used during development to inspect what devices advertise over mDNS.

Draft: opening for early review of the approach.

chrisdp added 3 commits July 1, 2026 15:20
RokuFinder now runs a passive mDNS/DNS-SD listener alongside SSDP. It
joins the mDNS multicast group and listens for device announcements
without sending queries, identifies Rokus by the integrator=Roku TXT
marker or the _display service, and reads the serial from the .local
hostname. Sightings feed the existing found/lost events and bypass the
ssdp:alive heartbeat-suppression path, which is specific to SSDP.
A zero-dependency raw scanner plus SKILL.md that enumerates service
types, resolves instances, and highlights matching devices. Useful for
finding Rokus and inspecting device TXT metadata during development.
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