Amazon web services

Registering with Amazon Web Services to get the most out of the mirror.

Advertisements

After discovering our minor setback in my last post, I had to find a way to get Alexa to notify the mirror application when a command was issued (or a question was asked), without using the Java Client.

Turns out you can add your own extra “skills” to Alexa.  What Amazon calls a “Skill” is extra functionality you can write yourself, and add to the portfolio of Alexa commands you can ask the mirror.  In order to do that we need to get an account to the Amazon Web Services (AWS).

You can register for this using your developer account at the URL below.

https://aws.amazon.com

Aws offers a broad range of online services, some of which are free, and some of which are priced.

From the Aws portal site you can create a free account.  You can sign up for it at the top right of the window.

aws-create

Doing so is quite a straight forward process.  You have to supply your name, email, etc.  But you also have to enter your credit card number.

Even though we will be using the so called “Free Tier” of AWS (services that aren’t charged for) you have to enter a valid credit card number.

It’s also important you enter a correct phone number. In order to verify your identity Amazon calls you when finishing up the sign up process.  It is an automated voice controlled computer asking you to enter a pin number.  After completing the process you can access the services from the Aws Portal.

The service we’ll need to add extra skills to our mirror is called Aws Lambda.

lambda

In short: it’s just a place where you can paste some code (Javascript, perl, and even c#) that will be executed in the cloud.  This code is referred to by the custom skills that can be created with Alexa.  After all, all custom skills do is call a web service somewhere.  This web service can also be some service started on your own hardware.  However, in my case, i’m not on a fixed IP with my internet provider, so it’s kind of hard to host a web server with one or more services attached to it.  Furthermore, I have to maintain it, and make sure it’s “always up”.

Using the lambda services you get server time on one of the servers of Amazon, executing that piece of code every time you ask it to.  Simple as that.  The service is free… at least, almost free.  You get 1.000.000 free calls per month.  That’s one million.  1 with six zeroes.  That’s a whole lotta command to ask the mirror in one month.  Basically, it means: free.

You can find some more extra free features at this URL : https://aws.amazon.com/free/

Extra storage, computing time and database hosting, basically for free.  Some paying services are free up to 12 months.

A second service we will be using is the DynamoDB service.  This is a service which is also included in the “Free” tier.  The screenshot below shows the details.

schermafbeelding-2017-01-30-om-23-02-16

According to me, quite enough to handle our requests.  So basically : free.  That’s great.

My intention is fairly simple.  I will be writing the details of the commands to a table in DynamoDB, in some sort of queue.  This queue can then be polled by the mirror. Furthermore, I will be able to maintain a log of all queries, and some stats on the mirror.  These are some nice extra perks.

Someone on the Magic Mirror portal also pointed me towards a solution somebody else made using the AWS IoT service (Internet of Things), in which I would have to register the Raspberry Pi as a device to be addressed in order to execute commands I send it.  In the end it would probably be a good solution, but when browsing the pricing model I saw it was free up until 12 months.  According to not a durable solution, so I’m going for the DynamoDB solution because it provides me with more extensive features, and can plug in to my existing architecture.

Let’s get cracking!

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s