Home | Random | Downloads | About | Hikes | WebCam | Search | Sitemap | Email | Feed

Chromecast won't connect to wifi - finally found the fix

Chromecast won't connect to wifi - finally found the fix

I've struggled for a while with Chromecast. The idea is great. I love using my phone rather than a remote. I like the idea of being able to cast any screen or browser tab in principle (in practice I think I've only done this once). I like the nice curated background pictures and that I could get round to using my own photos one day.

But here is how it works in practice. Fire up app. Select Chromecast icon and watch it go through the motions of connecting. Nothing streams. Reboot Chromecast, phone and router. Hard reset Chromecast and configure from scratch again. Reboot everything some more. Disconnect house from grid for ten minutes and switch off gas mains as well to be on the safe side. Finally, streaming! Repeat.

It's miserable. With both a Chromecast and a Chromecast 2 (which I really hoped might fix the problem). I've been through two different routers and I've tried a bunch of different settings but nothing seems to make the thing work. I even renamed the device to remove spaces.

For a while I considered buying an OnHub. Maybe Google's router would work with Chromecast? But it can't be bothered with Ethernet ports for some reason and so I'd need a new switch and then I'd probably need another power port and how important is John Oliver right now anyway (very)?

As much as I want Chromecast to work I've binned the wretched thing and bought an Amazon Fire TV Stick. Same basic principle but with apps on the device rather than your phone and a remote control.

I'd rather not have another remote, but it works instantly and without risking an aneurysm. It's also available with voice control which lets you both search for programs and trigger Alexa (my typical morning is asking Alexa for a flash briefing and then sobbing quietly when a daughter yells 'Alexa, stop... Alexa, play Gangnam Style').

My only gripe so far is that the voice search doesn't search inside non-Amazon apps (Netflix, HBO, etc).

Share:

Get ITHCWY By Email

I'm over social media - the Facebook page for this blog is a hopeless way to reach people and I removed the slow horrible sharing widgets a while ago. But I have this nagging suspicion that RSS is a super-niche activity for techno-libertarians harking back to the good old days of the Internet with open protocols and wall-free gardens and isn't entirely up to snuff either. So I'm going to experiment for a monthly email list for people who vaguely follow the blog or use Catfood Software products but don't quite manage to come back here every day to check for updates. Sign up here.

Why? Excellent question. The rules for blogs are to pick a narrow topic of interest, know your audience and do keyword research and drop SEO honeypot bombs to draw that audience in. I did that for Catfood Software but this isn't that kind of blog. It's a random collection of my hobbies and interests. So if you're not sure read through the Featured section in the side bar to get a preview.

I write a lot of code so what you'll get for sure is updates from Catfood Software and other occasional side projects. When I struggle with the process or discover something I write about that as well - these posts are more interesting to other developers and less exciting if you just want your desktop wallpaper (or Android phone) to look awesome. I love to make videos that don't have me in as well, mainly complicated time-lapses so you'll find a lot of those too. Also hikes in and around the San Francisco Bay Area. Occasionally politics.

If that works for you and you're not an RSS type then please join and let me know how I'm doing.

Share:

News: California may end tyrannical daylight savings

California may end tyrannical daylight savings

Yes, I'd vote for this. Please do it.

Share:

Book reviews for February 2016

Sand (Sand, #1-5) by Hugh Howey

Sand (Sand, #1-5) by Hugh Howey

4/5

Very good, I was rather hoping Howey was a one hit wonder but now I see that I'm going to have to read the whole cannon.

 

Cockroaches (Harry Hole, #2) by Jo Nesbø

Cockroaches (Harry Hole, #2) by Jo Nesbø

4/5

Finally the #2 Hole has been translated. It's a good one. Sad because it's saying goodbye all over again.

 

The Sellout by Paul Beatty

The Sellout by Paul Beatty

4/5

Starts with a black guy called Me in the Supreme Court for slavery and gets progressively more weird and funny from there. Excellent.

 

Fortune Smiles by Adam Johnson

Fortune Smiles by Adam Johnson

5/5

Stonking collection of perfect short stories. After I finished each one I was gutted that it wasn't turned into a whole book.

 

Share:

Get an email when your security camera sees something new (Apps Script + Cloud Vision)

Get an email when your security camera sees something new (Apps Script + Cloud Vision)

Nest (previously DropCam) can email you when it detects activity but that gets boring quickly. How about an email only when it sees something totally new?

The script below downloads a frame from a web cam and then calls the Google Cloud Vision API to label features. It keeps a record of everything that has previously been seen and only sends an email when a new feature is detected. You could easily tweak this to email on a specific feature (i.e. every time your dog is spotted), or to count the number of times a feature appears. I'm using a Nest cam but any security camera that has a publicly visible image download URL will work.

var OAuthCreds = {
  "type""service_account",
  //...
};

var SendEmailTo = '';
var MonitorImageUrl = '';



function main() {
  var timestamp = Date.now().toString();
  var scriptProperties = PropertiesService.getScriptProperties();
  var currentProps = scriptProperties.getProperties();
  
  Logger.log('Grabbing a frame');
  var url = MonitorImageUrl + '&cb=' + timestamp;
  var response = UrlFetchApp.fetch(url);
  var image = response.getBlob();
  image.setName('image.jpg');
  var bytes = image.getBytes();
  var encodedImage = Utilities.base64EncodeWebSafe(bytes);
  
  Logger.log('Calling cloud vision');
  var service = getService();
  if (service.hasAccess()) {
    
    var request = {
      "requests":[
        {
          "image":{
            "content": encodedImage
          },
          "features":[
            {
              "type""LABEL_DETECTION",
              "maxResults":50
            }
          ]
        }
      ]
    }
    
    var annotateUrl = 'https://vision.googleapis.com/v1/images:annotate';
    var annotateResponse = UrlFetchApp.fetch(annotateUrl, {
      "headers": {
        Authorization: 'Bearer ' + service.getAccessToken()
      },
      "method" : "post",
      "contentType" : "application/json",
      "payload" : JSON.stringify(request, null, 2)
    });
    var json = JSON.parse(annotateResponse.getContentText());
    
    var anythingNew = false;
    var newText = '';
    
    for (var l = 0; l < json.responses[0].labelAnnotations.length; l++) {
      var description = json.responses[0].labelAnnotations[l].description;
      var score = json.responses[0].labelAnnotations[l].score;
      
      if (!(description in currentProps)) {
        Logger.log('Found new feature: ' + description);
        scriptProperties.setProperty(description, score);
        anythingNew = true;
        newText += 'Found: ' + description + ' (score: ' + score + ')\r\n';
      }
    }
    
    if (anythingNew) {
      MailApp.sendEmail(SendEmailTo, 'Found something new on the webcam ' + new Date(), newText, { 
        attachments: [image] 
      });
    }
    
  } else {
    Logger.log(service.getLastError());
  }
}

// modified from https://github.com/googlesamples/apps-script-oauth2/blob/master/samples/GoogleServiceAccount.gs#L50 below...
function getService() {
  return OAuth2.createService('CloudVision')
      // Set the endpoint URL.
      .setTokenUrl(OAuthCreds.token_uri)

      // Set the private key and issuer.
      .setPrivateKey(OAuthCreds.private_key)
      .setIssuer(OAuthCreds.client_email)

      // Set the name of the user to impersonate. This will only work for
      // Google Apps for Work/EDU accounts whose admin has setup domain-wide
      // delegation:
      // https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority
     // .setSubject(USER_EMAIL)

      // Set the property store where authorized tokens should be persisted.
      .setPropertyStore(PropertiesService.getScriptProperties())

      // Set the scope. This must match one of the scopes configured during the
      // setup of domain-wide delegation.
      .setScope('https://www.googleapis.com/auth/cloud-platform');
}

function reset() {
  var service = getService();
  service.reset();
}

There is a bit of setup to get this working. Create a new Apps Script project in Google Drive and paste the code above in. You'll need to provide you own values for the three variables at the top.

OAuthCreds is the contents of the JSON format private key file for a Google Developer Console project. Go to the console, create a new project and enable the Cloud Vision API. You'll also need to enable billing (more on this below) - a trial account will work fine for this. Once the API is enabled create a service account under Credentials and download the JSON file. Just paste the contents of this into the script.

That's the hard part over. Now enter the URL of the image to monitor (see this post for instructions on finding this for a Nest / DropCam device) as MonitorImageUrl and your email address for SendEmailTo.

One last thing - follow the instructions here to reference the OAuth2 for Apps Script library.

Once this is all done run the script (the main() function) and authorize it. You should get an email with a picture attached and a list of the labels detected together with a confidence score from 0 to 1. If this doesn't happen check the logs (under the View menu).

You can now schedule the script to run repeatedly (Resources -> Current project's triggers). You get up to 1,000 units a month for free so once an hour should be safe. If you need more frequent updates check the Cloud Vision pricing guide for details.

After a few runs you should only get an email when something new is detected. If you're seeing too many wild guesses then add a filter on the score to exclude low confidence features.

Enjoy, and leave a comment if you have problems (or modify this in interesting ways).

(Previously)

Share:

Mandelbrot Spin Zoom

Mandelbrot Spin Zoom

Zooming into the Mandelbrot Set is always fun but I feel it's often a bit static and would be enlivened by a good spin so you can corkscrew your way down. Enjoy:

This was cloud rendered over two weeks using a Google Compute Engine high CPU instance (on a free trial, thanks Google).

I used the coordinates from a video posted by metafis on YouTube and a palette approach posted by Alex Russell on Stack Overflow.

The music is Flaming Memories generated by JukeDeck.

Share:

West of West Portal

West of West Portal

This timelapse contains edited highlights from January 2015 to January 2016. I have a Nest Cam (previously DropCam) pointed at the Pacific from the back of my house. To create the footage I grab a frame every 20 seconds and save it to Google Drive using Google Apps Script. I fire up a program about once a week that creates a daily timelapse movie from the frames.

The music on the video is from the excellent JukeDeck. This particular track was randomly but happily called California Battle.

As well as the conventional timelapses I'm creating a couple of different videos from all of the footage. More over the next few months.

(Previously)

Share:

Bayview Rise

Bayview Rise

Share:

Book reviews for January 2016

Starhawk (The Academy, #7) by Jack McDevitt

Starhawk (The Academy, #7) by Jack McDevitt

3/5

It's a prequel - how Hutch became Hutch - and because of that it's a bit limited in scope. Comfortable filler with a few good moments - worth reading for completeists.

 

Share:

News: Wisdom teeth removal is rarely necessary

Wisdom teeth removal is rarely necessary

Glad to hear it because my dentist is always wanting to rip out my wisdom teeth and I've always refused...

Share:

Previous Page | Next Page

I Thought He Came With You

Robert Ellison's Blog

7,250,102,164 people still need to read this blog.

Cheek Cells, Methylene Blue Stain

Cheek Cells, Methylene Blue Stain

Monthly Email Update