Sunday, February 28, 2016

This project is as awesome as it is dumb. A website where you can order a robot to flip a coin for you, and watch the outcome on streaming video.

Note that mobile users probably won't be able to see the live video.

I used a combination of ServoBlaster, VLC, and good old CGI + Bash to make this work.

The robot, sitting on my kitchen counter
View from the camera, which is live streamed to the website

Powered by a Raspberry Pi

Sunday, February 7, 2016

Alexa-Connected Speakers

This is a follow-up to my last post, Internet Connected Speakers

The speaker-controlling widget
I finally got around to building an Alexa skill to control my speakers. Now I can control my TV's volume hands-free with my Amazon Echo, and the commercial skip feature works great.

All code hosted on Bitbucket here

If you'd like to build your own:

1. Make the IR blaster device as explained in the last post.

2. Program it using the sketch in my Bitbucket repository. You will have to modify the WiFi SSID and password variables.

3. Set up your home router so that your IR blasting server is hosted on a port other than 80.

4. Sign up for an AWS account and create an AWS Lambda function to control your speakers. The Lambda code is also in my repository; you will have to modify the host and port variables. Use "Alexa Skills Kit" as the event source. Note the ARN of the lambda that you create.

5. Set up an Alexa skill using the Alexa Skills Getting Started Guide. Creating your own Alexa skill requires many steps. If you follow the getting started guide, you will set up an example skill. You can replace the intents and hints from the example with those hosted in my git repository. Then, use the Lambda ARN as the skill endpoint.

Note that this project is terribly insecure. If someone knew my home IP address, they could very easily gain control over my speakers. The ESP8266 is currently limited in that it does not support TLS when hosting a server. If TLS were supported, the device could use a secret password only known to the Lambda invoking the function. But without TLS, that password would be transmitted publicly. Until secure servers are supported on the ESP8266, I can't recommend this project for anything serious.