Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to discover chromecasts. No results? #20

Open
jonaz opened this issue Oct 20, 2014 · 5 comments
Open

trying to discover chromecasts. No results? #20

jonaz opened this issue Oct 20, 2014 · 5 comments

Comments

@jonaz
Copy link

jonaz commented Oct 20, 2014

Im having trouble using mdns to discover my chromecasts.
First i thought the issue was related to \032 (asci space). But when i renamed chromecast without spaces i still get nothing.

Have anyone else had issues with chromecasts?

This is an output from dig.

dig @224.0.0.251 -p 5353 -t PTR _googlecast._tcp.local.

; <<>> DiG 9.9.2-P2 <<>> @224.0.0.251 -p 5353 -t PTR _googlecast._tcp.local.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17559
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 3

;; QUESTION SECTION:
;_googlecast._tcp.local.        IN  PTR

;; ANSWER SECTION:
_googlecast._tcp.local. 10  IN  PTR Chromecast\032Cumulus._googlecast._tcp.local.

;; ADDITIONAL SECTION:
Chromecast\032Cumulus._googlecast._tcp.local. 10 IN SRV 0 0 8009 Chromecast\032Cumulus.local.
Chromecast\032Cumulus._googlecast._tcp.local. 10 IN TXT "id=9472d23123344568ad3c5660f5bd" "ve=02" "md=Chromecast" "ic=/setup/icon.png" "fn=Chromecast Cumulus" "ca=5" "st=0"
Chromecast\032Cumulus.local. 10 IN  A   192.168.5.110
@elliots
Copy link

elliots commented Nov 4, 2014

I've seen them not appear till I open an application on android that can cast (though not always), and seem to have less success on osx than linux. Here is the code we're using - https://github.com/ninjasphere/driver-go-chromecast/blob/master/driver.go#L40

@jonaz
Copy link
Author

jonaz commented Nov 5, 2014

@elliots did you try dig @224.0.0.251 -p 5353 -t PTR _googlecast._tcp.local.
It Always shows a chromecast. Where mdns query never does for me.

@jonaz
Copy link
Author

jonaz commented Nov 5, 2014

I have now done some debugging. printing out things in the query function for loop in client.go.

$ go run mdns.go
anwer= _googlecast._tcp.local. 10      IN      PTR     Vardagsrummet._googlecast._tcp.local.
inp= &{Vardagsrummet._googlecast._tcp.local.  <nil> <nil> 0  <nil> false false}
inp.Name= Vardagsrummet._googlecast._tcp.local.
2014/11/05 15:45:29 [INFO] mdns: Closing client {0xc20803a020 0xc20803a028 0xc20803a030 0xc20803a038 true 0xc2080043c0 {1 0}}

The real answers from chromecast using dig shows this:

;; ANSWER SECTION:
_googlecast._tcp.local. 10      IN      PTR     Vardagsrummet._googlecast._tcp.local.

;; ADDITIONAL SECTION:
Vardagsrummet._googlecast._tcp.local. 10 IN SRV 0 0 8009 Vardagsrummet.local.
Vardagsrummet._googlecast._tcp.local. 10 IN TXT "id=02bcb20766bec5e94478af49858fc2a2" "ve=02" "md=Chromecast" "ic=/setup/icon.png" "fn=Vardagsrummet" "ca=5" "st=0"
Vardagsrummet.local.    10      IN      A       192.168.13.173

Which means that mdns tries to lookup PRT record for Vardagsrummet._googlecast._tcp.local. when it should try to find the SRV record?

@jonaz
Copy link
Author

jonaz commented Nov 5, 2014

Ok i've now fixed chromecast support in mdns in my fork in this commit. Really simple change: Querying first PRT, then TXT then SRV and then A.

jonaz@c5550c6

But since i dont have any other mdns records to query i cannot know how much ive broken!

@elliots
Copy link

elliots commented Nov 5, 2014

@jonaz looks good, my chromecast driver is working well now. It also works fine the one other place I'm using it (to find other instances of our own product on the network).

I did see it come up with more than I asked for a few times (records that don't match my query) but I think I'd seen that previously...

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

No branches or pull requests

2 participants