chromecast

So I’ve been interested in the chromecast device since I had heard of it a while back and finally got around to ordering one. For $35 before shipping its not bad, even if its just to play with briefly.

Mine finally arrived today! I am going to share some very quick things I’ve discovered about this nifty little device.

Let me first start off by mentioning that I have NOT gotten this device to successfully connect to my wireless network. Part of the reason I even investigated this (and thus decided to share some of my findings here) are due to being unable to get this sweet little device onto my wifi network. That being said I think looking under the hood allows us to peer into how Google designed this device and how it works!

So step 1? Plug the thing into a power source and stick it into one of my TVs many HDMI ports and see what comes up!

The first thing that comes up is a welcome screen showing you the name of the device which is always ChromecastXXXX where the Xs are four randomly generated numbers. At this point I downloaded the android app and proceeded with the configuration which allowed me to do the following things:

1. detect my chromecastXXX device
2. configure it to connect to my wifi network
3. connect to it via my wifi network for the main functionality provided it can now connect to my wifi network.

It was step 3 that kept failing no matter how many times I tried (and rebooted the device) so I decided to see exactly how this setup process worked.

So I grabbed one of my smaller laptops (this one) and decided to try the “manual setup” which is decribed at (https://cast.google.com/chromecast/setup?np=manualsetup).

So how does step 1 work? How was my app able to detect the presence of my ChromecastXXXX device? I assumed it was bluetooth and that configuration occured over a paired bluetooth channel. As it turns out that is not the case. It’s actually good old wifi!

So step one in the manual setup process is to connect to the wireless network with the SSID that represents your device name. In the case where I actually took note of this my device SSID was Chromecast8991.

So the little thing starts up an AP and lets you configure it somewhat like a router! Cool. So I connected to this AP and requested an IP address with dhclient. After [forever] I got one.

I got an IP of 192.168.255.250 and the device itself turned out to be 192.168.255.249. Of course the first thing I did was check for open ports. The following ports were open:

53 (non working DNS)
8008 (main communications)

As soon as you connect to the device as a client it will give you a random 4 digit code on screen which I imagine is used for further communications in the case someone else decides to connect to your unencrypted and open device SSID. It will prevent someone unable to see your TV screen to configure your device but thats about it. Once I get this thing working I will take a look at sniffing network traffic to see if I can “cross the streams” on other people’s chromecasts so to speak. Would be hilarious.

Anyway once you get this code the first step in the configuration begins. All communication with the device at this point is done over json encoded data over HTTP.

The next phase involves telling the device to scan for wireless networks so you can tell it which to connect to and with what security mechanisms. The network traffic looks like this:

Based on the traffic you can see that the /setup/eureka_info URL is used to request the initial scan/results. You can also see various information about the bssid/ssid as well as some of its current configuration, the hostname of the system connected to it, and a bunch of IDs. Also that I’ve somehow opted into sending Google information when there is a crash as well as for stats is noted. Fun. You can see that there seems to be public key crypto which is good if we’re going to be sending our wifi network details over an open and unencrypted wireless network.

I did notice during the multiple times I’ve tried to connect this to my wireless network that the public key changes so it is generated by the device and not hardcoded (which is just fine). What I did find very interesting is that this very request the last couple of times included GPS data which means this device has GPS????? Here is a snippet of a previous response:

A fun thing to note is that I’ve opted for not sending any information but this is conveniently ignored and I am still opting in for submitting data when there is a crash and for stats. Anyway, you can see SSID signal levels and other information. At this point you configure the device to connect to a wifi network by telling it the SSID and password.

At this point you can see that the request to connect uses the URL /setup/connect_wifi and is encrypted with the public key of the router (thankfully). You can see the target SSID/BSSID cipher type and password in the request.

It is at this point that the on screen display says: Connecting to “myssid” and for me it sits there FOREVER and never connects. I even tried to connect to a router I setup 5 feet away and ended up with this being the furthest it would go.

Obviously once I get this connected I’ll continue my review of this cool little device and more importantly see what kind of fun things we can discover by analyzing its network traffic. For example I don’t even see the 4 digit code used in the communication between the client and the device but who knows? Maybe it is used in some obscure way that I haven’t seen. Another interesting thing is that although you can see that the http traffic is local between you and the device, it is facilitated over a connection to the public internet URL (https://cast.google.com/chromecast/setup?np=manualsetup) that uses local IP links/requests. I havent’ even looked at the website/js that performs these actions yet but I’m sure it would be interesting as well. Especially since I’m sure it takes note of the various responses returned from your GPS enabled device.

All in all, very impressive for a $35 device. Its tiny and comes with a built in AP used for configuration. I look forward to checking out its actual functionality once successfully connected!

Posts navigation

4 comments on “chromecast”

I’ve been trying to connect my Chromecastration (CC) device for 2 days and like you decided to dig in a bit. I’ve come to the conclusion that its strictly designed for DHCP. Google assumes we are all stupid and can’t manage a static IP based network.

I know very well I can get this working in a snap if I change my network over to DHCP but I refuse. Soooo I installed the CC into my TV, downloaded the CC app to my laptop. Got so far into it and couldn’t connect to the CC. I noticed my wifi indication kept going offline. Something was trying to change my wifi.

After a few minutes of staring like a zombie, I said hey this is trying connect to the CC. Well my laptop has a static IP so if that’s whats going on it will never happen. I got the bright idea to set my laptop to “DHCP” mode, Sure enough I was now connected to the CC’s little wifi network.

Like you I received an IP of 192.168.255.250 etc. I was able to configure up to the point that it wanted my SSID/password for my wifi network. That’s when everything failed epically. Not having my packet sniffer I’m not sure what’s going on that it failed to connect to my wifi network.

I suspect that its waiting for an IP address from my DHCP server that I don’t have and wont have !!!. So I got real smart for a minute and said how can I assign the CC an IP on my network without a DHCP server. Well my wifi router didn’t have what I needed.

So I installed a DHCP server android app on my Samsung GS4. I verified that it does work with my IPAD – it received an IP address on my wifi network as a test.

SO I have a mini DHCP server waiting for a request from the CC. I seen in the DHCP log a request from 0.0.0.0 but it never sends out an IP like it did to my IPAD. At this point I said screw this and threw it the box and decided it was not worth the trouble.

I also had the same issue with a Google Chromebook – same deal wants a DHCP IP.

The device is not GPS enabled, and anyway most people use it indoors where there is no GPS reception. Probably you see your lat/long because the device is connected to the Internet and knows the wifi SSID around it, this is enough to guess an accurate location http://en.wikipedia.org/wiki/Wi-Fi_positioning_system

That is possible yes. Either way the fact that they’re interested in grabbing your location while you’re setting up or using your device is a bit unsettling though. Real time tracking of every smart phone user is of course common place these days.