(feat) Enhance device discovery for complex and mesh networks #226
Open
postphotos wants to merge 4 commits intovishen:masterfrom
Open
(feat) Enhance device discovery for complex and mesh networks #226postphotos wants to merge 4 commits intovishen:masterfrom
postphotos wants to merge 4 commits intovishen:masterfrom
Conversation
Further fixes (adding in --broad-search)
…w feature final cleanup of implementation; completing basic documentation of new feature
vishen
reviewed
Aug 27, 2025
Owner
vishen
left a comment
There was a problem hiding this comment.
Apologies this took so long for me to review. This looks good. I've left a comment about putting the new flag in with the rest of the global flags.
Author
|
Awesome! I also cleaned up the rest of the |
vishen
reviewed
Oct 22, 2025
Owner
vishen
left a comment
There was a problem hiding this comment.
Apologies for the delay, have been on paternity leave.
This looks good other than a couple of minor comments.
| var app application.App | ||
| var err error | ||
|
|
||
| if broadSearch { |
Owner
There was a problem hiding this comment.
Is this still needed if castApplication checks this flag as well?
| exit("unable to seek current media: %v", err) | ||
| } | ||
| }, | ||
| Run: func(cmd *cobra.Command, args []string) { |
Owner
There was a problem hiding this comment.
The formatting on these look off, was this done with gofmt?
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.
Hi @vishen, first off—thank you for creating and maintaining this fantastic tool!
This pull request introduces enhanced discovery mechanisms to make go-chromecast more robust for users with mesh networks, multiple VLANs, or larger device ecosystems. The changes are fully backward-compatible and significantly improve device discovery reliability.
Issue Encountered
After setting up a mesh wifi network, I found that device discovery became unreliable. While the
go-chromecast scan --cidr 192.168.4.0/24command could find some devices, it consistently missed others, including Chromecast groups, even when they were on the same subnet. The tool was also hardcoded to scan192.168.50.0/24by default, which didn't match most home networks.Solution
The default issue may affect a ton of use cases:
To address this, I've expanded on the existing scanning capabilities to provide a more powerful and flexible discovery process:
--broad-searchFlag (Universal across all relevant commands)Added to all device-connecting commands for the simplest and most powerful discovery. This flag automatically combines mDNS with comprehensive port scanning across all detected network interfaces to find devices that standard discovery might miss.
Works with all commands:
Enhanced
scanCommandThe
scancommand now supports flexible subnet targeting:Automatic Network Detection
-iconfiguration in most cases192.168.50.0/24defaultTesting
Test Coverage: Added unit tests for new utility functions (subnet parsing, flag handling) and integration tests using
testscriptto validate CLI behavior. Includes mocks for network-dependent functionality to ensure reliable testing. Tests can be run withgo test ./...or individual components withgo test ./cmd/.Performance Note:
--broad-searchis slower than standard discovery as it performs comprehensive network scanning, but finds devices that mDNS alone might miss.Backward Compatibility
I wanted to make sure any existing workflows will continue to work and leave existing functionality unchanged. This means:
--cidrflag works exactly as beforeI believe these changes make go-chromecast significantly more powerful on modern home networks. Please let me know if you have any questions or need any adjustments to merge this in!