Amazon ALEXA Lists Exercise – Put’em on Paper…

4. Solution Components

Let’s look at each of the components in detail. You may want to create the items in the same order as we did here, particularly with the ALEXA stuff.

4.1 Amazon AWS Lambda glue code

To understand the code, you’d have to make yourself familiar with the following resources:

And yes, we’re using plain old python spaghetti code (POPSCTM) – no Flask-Ask or similar. After all, this is supposed to be an excercise…

4.1.1 Source Code

Nothing fancy in there, but do note that you’re required to change two things:

  1. line 103: generate your own secret here.
  2. line 113: replace with your own DynDNS host name.

4.1.2 Creating the Lambda function

In order to create the lambda function:

  • log into your Amazon developer console,
  • navigate to AWS,
  • find the „Lambda“ button,
  • create a new lambda function from scratch named printer-glue-code with lambda_basic_execution role running on python 3.6; it can remain named  lambda_function.lambda_handler .
  • Then, paste the code from above and save the function.
  • Also, you should set the timeout to 20 seconds under „Basic Settings“.

Now, add ALEXA as allowed calling source:

  • Switch to the tab „Triggers“ (current one is called „configuration“) and press „Add Trigger“
  • In the grey box, select „ALEXA Skills Kit“ and press „Submit“
  • Never mind the error, just close the box by pressing „cancel“.
  • Upon refreshing the triggers, you should see the ALEXA Skills Kit trigger

Lastly, take note of the ARN in the upper right corner:

You can press the „Test“ button and use the default event. It should come up with a green success message.

4 Kommentare zu “Amazon ALEXA Lists Exercise – Put’em on Paper…”

1.   Kommentar von Tom
Erstellt am 09. Dezember 2018 um 22:40 Uhr.

Hi,
great post.
Could please tell which thermal printer you have used?
The amazon link isnt‘ working anymore.
Thanks

2.   Kommentar von McSeven
Erstellt am 10. Dezember 2018 um 20:27 Uhr.

hi, Thanks. The one I used isn’t available on Amazon anymore, but any USB receipt printer should work… Just look for what mike24’s ESC/POS library is supporting and buy one of those models… Best, Christoph

3.   Kommentar von Tom
Erstellt am 11. Dezember 2018 um 20:53 Uhr.

Thanks for the reply. This product list on github helps a lot.
One further question: Could you really delete the original shopping list with the skill? In your video you use the original „Einkaufsliste“ so you could also delete this one per API? In your code for the lambda it is „shopping list“ and not the original code snipped?

Danke und Gruß
Tom

4.   Kommentar von McSeven
Erstellt am 12. Dezember 2018 um 20:23 Uhr.

hi, well, the Einkaufsliste is used by the ALEXA language model. it translates into „shopping list“ in the skill. Therefore the difference… Cheers.

Einen Kommentar hinterlassen