jasmeu
Posts: 14
Joined: Sun Mar 17, 2013 5:26 pm

Tutorial for an Alexa Skill to control the PI

Wed Feb 22, 2017 10:01 pm

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.

tomhannen
Posts: 18
Joined: Sun Jul 31, 2011 9:27 am

Re: Tutorial for an Alexa Skill to control the PI

Fri Mar 31, 2017 9:18 pm

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...

tomhannen
Posts: 18
Joined: Sun Jul 31, 2011 9:27 am

Re: Tutorial for an Alexa Skill to control the PI

Sun Apr 02, 2017 11:24 am

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 :)

Quattroman
Posts: 5
Joined: Mon Dec 24, 2012 2:38 pm

Re: Tutorial for an Alexa Skill to control the PI

Tue Aug 29, 2017 2:15 pm

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

andrewjb3
Posts: 1
Joined: Sat Sep 09, 2017 9:59 am

Re: Tutorial for an Alexa Skill to control the PI

Sat Sep 09, 2017 10:03 am

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..

Car camera rig
Posts: 6
Joined: Sun Nov 12, 2017 2:23 pm

Re: Tutorial for an Alexa Skill to control the PI

Sun Nov 12, 2017 7:36 pm

How far did you guys get with this project?

prashanthsmurthy
Posts: 1
Joined: Thu May 31, 2018 10:32 pm

Re: Tutorial for an Alexa Skill to control the PI

Thu May 31, 2018 10:38 pm

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!

bankoja
Posts: 1
Joined: Tue Jul 10, 2018 5:57 pm

Re: Tutorial for an Alexa Skill to control the PI

Tue Jul 10, 2018 6:00 pm

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?

aminb
Posts: 3
Joined: Thu Aug 09, 2018 2:40 pm

Re: Tutorial for an Alexa Skill to control the PI

Tue Sep 11, 2018 8:11 pm

Thank you for this great job , is there a way to make this work offline?

Return to “Automation, sensing and robotics”