Alexa + Raspberry Pi = Fun!

So, after a week a of grappling, trying to make Alexa AVS work on a humble Raspberry Pi 2 Model B, I finally had success! Yayyy! Now, thus far, the responses I have received on declaring this little victory of mine have been more or less like “meh!”, but still, I write about it because for me the experience was far more satiating.

So here goes.

I was fascinated by Amazon Echo, and the fact that Amazon has thrown open the doors to the developer community to build its (what is known as) skills. Since Echo is not widely available in this part of the world yet, plus, getting an Echo and getting it to work doesn’t sound like ‘fun’; I decided to look for Alexa (soft-) implementations for other platforms.

I think the very first result that Google returns is to Amazon’s Alexa Sample App for a bunch of platforms, including Raspberry Pi. This is an awesome project by a group of Alexa enthusiasts, and more or less a cakewalk if you have a newer Pi running Raspbian Jessie. Just trigger the automated install, and grab a cup of coffee (as they say), or a 5-course-meal if you’re on a slow Internet connection, and you’re pretty much done.

The struggle here was: I did not have Jessie (had Wheezy), and have an old Pi, and my Internet connection is not that great.

My ‘woes’ started with PortAudio not installing (due to wget timeout), to Node.js not recognizing the BodyParser module, to my version of CMake not supporting the TARGET_INCLUDE_DIR flag. I will spare you the gory details of how I struggled to ‘build’ the latest Node.js on this tiny thing!*

On the hardware side, I had to get a USB microphone**, or, to be precise, one of those Logitech cams with an in-built mic. Also, I realized that I’d be needing a USB hub with adequate amperage. So I got this — and am very happy with it. It’s a 4-port 2.5A hub — which means enough juice for keyboard, mouse AND the camera+mic!

Long story short — I had to upgrade both the hardware, and software (to Jessie)! And voila!, the automated install took care of everything. Everything except PortAudio, that still required me to increase the wget timeout from 10s to 60s (maybe it has something to do with this region).

So ladies and gentlemen, here’s a little demo of what was achieved at the end of it all (please excuse the bad audio):

(If you’re really keen on consuming the advice being dispensed, click here.)

Needless to say, on the whole I am in awe of what Amazon has done with Alexa, and what all has it enabled to be done. I could imagine so many applications from as simple as playing ‘Spelling Bee’ with the kids, to home automation, and what not. Indeed, I loved it!!

* Do drop me a note if you’re struggling with any of the above — I did get around almost all of the issues, but it needs a lot of patience. To give you an idea: building the ‘latest’ Node.js on the Pi2 was an overnight job!

** Turns out, Pi does not support 3.5mm port microphone.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.