Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,729,619 Members 46,624 Now Online
XDA Developers Android and Mobile Development Forum

chromecast SSDP discovery

Tip us?
 
offyoutoddle
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 8
Join Date: Apr 2010
Default chromecast SSDP discovery

Hi,

I'm trying to write an app that needs to discover the Chromecasts ip address. Since everything I've read indicates it uses SSDP, I have sent a UDP packet to the broadcast group address 239.255.255.250 on port 1900 as follows:


M-SEARCH * HTTP/1.1
MX: 5
ST: "upnp:rootdevice"
MAN: "ssdp:discover"
HOST: 239.255.255.250:1900

everything on my network except my chromecast responds on port 1900. Does anyone know if this packet is not sufficient to get a Chromecast to reply, or if I need to listen on a different port to 1900? I'm really struggling to get anwhere with this and I can't figure out why!
 
Asphyx
Old
#2  
Senior Member
Thanks Meter 243
Posts: 1,625
Join Date: Dec 2007
try port 8008 That seems to be used for ssdp in chrome
 
offyoutoddle
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 8
Join Date: Apr 2010
Quote:
Originally Posted by Asphyx View Post
try port 8008 That seems to be used for ssdp in chrome
just tried that and no different unfortunately. I get a response from my router still, (192.168.0.1) but not from the chromecast.

I think 8008 is the http tcp port that is used for RAMP commands isn't it?
 
bhiga
Old
(Last edited by bhiga; 10th June 2014 at 10:22 PM.)
#4  
bhiga's Avatar
Recognized Contributor
Thanks Meter 747
Posts: 2,017
Join Date: Oct 2010

 
DONATE TO ME
Quote:
Originally Posted by offyoutoddle View Post
M-SEARCH * HTTP/1.1
MX: 5
ST: "upnp:rootdevice"
MAN: "ssdp:discover"
HOST: 239.255.255.250:1900

everything on my network except my chromecast responds on port 1900. Does anyone know if this packet is not sufficient to get a Chromecast to reply, or if I need to listen on a different port to 1900? I'm really struggling to get anwhere with this and I can't figure out why!
DIAL Protocol Spec says your Search Target header (ST) needs to be
urn:dial-multiscreen-org:service:dial:1
Chromecast threads: FAQ - READ THIS FIRST! / Rootable Serial Numbers | Root Mini-FAQ | FlashCast flashing Mini-FAQ
BYO powered OTG cable | WiFi Bandwidth and Router considerations | Not all 1080p/720p is same
Search Tip: Google search terms site:forum.xda-developers.com for only XDA forum results. Example
Follow the rules / Use 'Search' before posting / Post in the correct sections / Do not spam the board / Press thanks, don't post 'Thanks'
 
deeper-blue
Old
#5  
Member
Thanks Meter 580
Posts: 43
Join Date: Nov 2010
Location: somewhere in good ol' Germany
Take a look at the documentation here:
https://github.com/jloutsenhizer/CR-...umentation-WIP

The current APIv2 actually uses mDNS to discover Cast devices.
The Following User Says Thank You to deeper-blue For This Useful Post: [ Click to Expand ]
 
Asphyx
Old
#6  
Senior Member
Thanks Meter 243
Posts: 1,625
Join Date: Dec 2007
Quote:
Originally Posted by offyoutoddle View Post
just tried that and no different unfortunately. I get a response from my router still, (192.168.0.1) but not from the chromecast.

I think 8008 is the http tcp port that is used for RAMP commands isn't it?
That may only be the port that the CCast uses to respond....Try the other suggestions I was only guessing since that was what Chrome reported as ssdp for CCast....But like I said it may be the response port and not the port that elicits the CCast to respond with it's info!
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Make Your Own DIY Capacitive Stylus

The XDA Portal is a place where we like to talkabout things that are interesting, fun, and sometimes … more

Remove Unnecessary WhatsApp Elements with Xposed

In modern life, you can’t underestimate the power ofthe dark sidemessaging … more