Page 1 of 1

Tutorial for an Alexa Skill to control the PI

Posted: Wed Feb 22, 2017 10:01 pm
by jasmeu
As I found no clear and easy to follow tutorial in the internet on how to:
- have Alexa (with Echo) understand commands beyond turn on / turn off
- control a raspberry PI with voice using an Echo device and Alexa
- stay not "very insecure" with the entire prototype

I wrote my own one: http://www.jasm.eu/2017/02/22/amazon-al ... -together/

Enjoy and feel free to ask here, in case anything is unclear.

Re: Tutorial for an Alexa Skill to control the PI

Posted: Fri Mar 31, 2017 9:18 pm
by tomhannen
This was a very helpful tutorial, and worked for me - thank you.
I'm hoping to use raspberry pi strogonanoff
https://github.com/dmcg/raspberry-strogonanoff

to control some lights from Alexa.. This looks like it could help! I'll let you know if I get stuck...

Re: Tutorial for an Alexa Skill to control the PI

Posted: Sun Apr 02, 2017 11:24 am
by tomhannen
Hi - I got this to work, but I have a few questions? If you could make a tutorial for a more advanced version, it would be really useful!

What's the best way to make it work relatively permanently? If I leave it all up and running overnight, it stops working the next morning (Alexa says skill not found, or something similar -(maybe the test version times out after a while?)

How do I send variables back and forth? At the moment, I've managed to write a single script that turns a light on using Strogonanoff. What's the best way to expand the number of "intents"? (bearing in mind I'm a muddling non-programmer, who doesn't really understand how cgi-bin files work...)

I'd like to be able to issue different commands for different lights "Alexa, tell mylights to switch light 1 on", etc...

Many thanks for any help you can offer :)

Re: Tutorial for an Alexa Skill to control the PI

Posted: Tue Aug 29, 2017 2:15 pm
by Quattroman
Hi, when I run the Alexa command in the Amazon developer programme, the command is "Alexa, tell Kermit today" the raspberry pi and the amazon service response tell me "501 can only POST to CGI scripts.

Anyone help me resolve this?

Thanks

Peter

Re: Tutorial for an Alexa Skill to control the PI

Posted: Sat Sep 09, 2017 10:03 am
by andrewjb3
Peter,
That means Alexa is sending it's POST request to your server (on the PI), and the server is receiving it. The error is that it's sending to the wrong page, or to a page that's not in the cgi-bin folder.
So...
The 'alexa.sh' file in the example has to be in the cgi-bin folder.
Then, in the skill setup on amazon, you have to be pointing to the correct place. For example, when I first did it, I accidentally used cgi_bin rather than cgi-bin..

Re: Tutorial for an Alexa Skill to control the PI

Posted: Sun Nov 12, 2017 7:36 pm
by Car camera rig
How far did you guys get with this project?

Re: Tutorial for an Alexa Skill to control the PI

Posted: Thu May 31, 2018 10:38 pm
by prashanthsmurthy
Thank you very much, was quite intutive and worked. After installing ngrok, I had to register, get an auth token and run "./ngrok authtoken <> <>" once only after which the public URL started working. Just something I wanted to add...

I could get it to work on the website and verified that the raspberry pi was hit on port 8000. Thanks again for your effort putting this content together!

Re: Tutorial for an Alexa Skill to control the PI

Posted: Tue Jul 10, 2018 6:00 pm
by bankoja
Hello, I've been trying to figure out a way to control my microsoft surface hub using alexa and my raspberry pi. Just wanted to know if it would be possible to use Alexa to open putty on the raspeberry pi, and give commands from there?

Re: Tutorial for an Alexa Skill to control the PI

Posted: Tue Sep 11, 2018 8:11 pm
by aminb
Thank you for this great job , is there a way to make this work offline?