Warning: Old blog posts are now out of date due to native programming.





That is the entire lambda I use to return the .html for Alexa to read. The weird piece is obviously the URL. How and where do I get this? Since my NodeJS server is hosted locally, I need to open it up safely to the world. I will do this NGROK . Ngrok is a stable tunneling service, which will open up a specific port to the world. Since I are using npm, all I need to do is run.



npm install ngrok -g ngrok http 3000





This will start a tunneling service which looks something like this.





Session Status online Version 2.1.18 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding http://28f407d0.ngrok.io -> localhost:3000 Forwarding https://28f407d0.ngrok.io -> localhost:3000





Since I am using http: we will take the 'http://28f407d0.ngrok.io ' to be my URL. Now my RPI server is being tunneled to the world through that URL and can be interacted with.



Now all anyone needs to do is invoke the skill and it will read off the .html I am hosting!





Alright Finally: Python Programming on the Pi, how I do it, why I did it, and some restrictions.

Unofficial Seahawks Football is a live skill I created using python to populate my .html file.









This is not necessary. I have tested writing to a .html through a NodeJS python call, using



The benefits to using this, is obviously being able to run python code. Which was the best way for me to retrieve Seahawks stats. I am also able to format more complicated responses easier. Plus it made sense since my server was already gathering the information live. In the case of this skill, I actually populate the .html live with the game. So the .html file population is effectively separate from the skill call, thus the information is always available. I use a python script to change my Philips hue lights for every point scored in a Seahawks game, which I use to populate my .html files ( nfl.py ).This is not necessary. I have tested writing to a .html through a NodeJS python call, using python-shell . To do this run a python-shell call and return the .html file after success. The main restrictions are taking too long to write to the file and Alexa timing out.The benefits to using this, is obviously being able to run python code. Which was the best way for me to retrieve Seahawks stats. I am also able to format more complicated responses easier. Plus it made sense since my server was already gathering the information live.





The cons are obviously running my own server and a tunneling service, both have to be reliable. JSON is a great way to transfer information, if there is a json endpoint readily available it should be used directly by Alexa. I will be going about this way with my next NHL skill :)





Pushing Alexa to the limit! Feel free to contact me if you have any questions.



Mr. CatNaps





Hello Friends!I am back on blogger to talk about my favorite subject. The Amazon Echo (Alexa). Now that there are plenty of ways to interact with her natively I have been exploring new worlds. Utilizing a Raspberry Pi I have been able to host a NodeJS end point and interact with it via http: end points. You can check out my server here and my hub alexa skill that interacts with it.For the longest time I was restricted with only sending information one way, from Alexa to the Pi. However, I have finally figured out a way to bridge the gap. Writing to .html files. By writing to .html files, I am able to hit them via an endpoint and return information.Using this NodeJS call in my home server I can return an .html file. I personally format the file as a string that will be read back by Alexa. The following is an example of nfl_events.html With a simple http call from an Aelxa skill anyone can retrieve and read off that .html.