Integration with Amazon Echo

Posted on
Mon Aug 03, 2015 4:30 pm
manoncloud9 offline
Posts: 75
Joined: Apr 27, 2014
Location: Minneapolis MN

Re: Integration with Amazon Echo

I tried to do an install today and did not make it past the npm install - I downloaded the latest npm - should I send you a log file?

I am super excited to use your plug in I think I understand it or the basics anyway.

Joe

Posted on
Mon Aug 03, 2015 5:05 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

The only node module needed is one called http-digest to support digest auth. I might as well get rid of the packages.json file under the src directory and replace it with the node_modules dir with the dependency included... That way people don't have to npm install this one module, it will just come with the source. Will do that tonight when I get home - gimme and hour or two.

Matt

Posted on
Mon Aug 03, 2015 5:07 pm
manoncloud9 offline
Posts: 75
Joined: Apr 27, 2014
Location: Minneapolis MN

Re: Integration with Amazon Echo

Ok thanks - I will probably not be able to get to it tonight - but will try

Should I send you the error log?

Joe

Posted on
Mon Aug 03, 2015 7:53 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

Joe,
Sure, you can send a log. I won't promise you how much time I will spend looking at it :-) Unfortunately, the node_modules directory explodes into all of http-digest's dependencies as well. Turns out to be 905 files @ ~6.5MB. So, I will not include the dependencies as previously mentioned. I'll do some version dumps for my NPM environment so we can get a baseline... I am using NVM to manage npm versions. It works well in preventing the need to use sudo, or creating special groups for npm-owned directories, or changing permission on said directories, etc. NVM stores all npm versions under a user local directory (~/.nvm) and all global modules for a given version are stored here as well (in sub directories). This makes managing your npm install(s) a breeze.

Code: Select all
theprompt:~$ nvm --version
0.24.1

theprompt:~$ npm version
{ http_parser: '1.0',
  node: '0.10.38',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.36',
  zlib: '1.2.8',
  modules: '11',
  openssl: '1.0.1m',
  npm: '1.4.28' }

Has anyone else gotten this working yet? Some issues noted here https://github.com/msreynolds/askIndigo/issues. Please feel free to add or suggest issues/features. I've got a few grand ideas myself, but we'll save that for another day :D

Posted on
Mon Aug 03, 2015 8:26 pm
manoncloud9 offline
Posts: 75
Joined: Apr 27, 2014
Location: Minneapolis MN

Re: Integration with Amazon Echo

So am I waiting for you to send new files?


Sent from my iPhone using Tapatalk

Posted on
Mon Aug 03, 2015 10:24 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

Nope, all code is up to date on github (with current issues)... you were sending/posting a log file?

Matt

Posted on
Wed Aug 05, 2015 9:54 am
manoncloud9 offline
Posts: 75
Joined: Apr 27, 2014
Location: Minneapolis MN

Re: Integration with Amazon Echo

Here is the log file - sorry for the delay
Attachments
npm-debug.log
(7.19 KiB) Downloaded 54 times
npm-debug.log
(7.19 KiB) Downloaded 51 times

Posted on
Wed Aug 05, 2015 12:05 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

I can't get the echo to access the ask indigo skill. She keeps saying "sorry, i'm having trouble accessing your ask indigo skill right now." Maybe I've edited the index.js incorrectly? I'm not using go prism but I've put in the correct username/password/domain/port of how I log into indigo from outside my network. for the Amazon Echo Appication ID do I only input the numbers and take out the []? (i.e.: var APP_ID = 'amzn1.echo-sdk-ams.app.[99eeb5c1-f1c6-4879-aa18-6ec54943c8d5]'; or would it be this: var APP_ID = 'amzn1.echo-sdk-ams.app.99eeb5c1-f1c6-4879-aa18-6ec54943c8d5'; Any ideas?

Dave

Posted on
Wed Aug 05, 2015 12:54 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

The later would be the correct format:
var APP_ID = 'amzn1.echo-sdk-ams.app.99eeb5c1-f1c6-4879-aa18-6ec54943c8d5

I have not tested this with any access mechanism other than Go Prism. I could set up my router to NAT the port and try and see if it works. I just wouldn't leave my configuration this way. I will admit I am curious if the non-GoPrism setup with a port other than 80 works or not, as this is probably as common as people with GoPrism accounts... Is your url/domain on https by chance?

Matt

Posted on
Wed Aug 05, 2015 1:06 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

That is the format i was using. No on the https, I was just using the built in DDNS of my asus router.

Posted on
Wed Aug 05, 2015 2:00 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

When you use a sample event from /test/alexa_requests.json and run the test on the Lambda console, do you see the correct request getting made? The test should barf to the Lambda console debug info, including the device name and then followed by "Making request: " followed by the URL ASKIndigo has constructed from your voice command. Something like "Making request: http://somedomain.com:someport/devices/ ... method=put". This test methodology does not require translating your voice, nor accessing your skill properly... its done entirely with the json data. Assuming Alexa heard you correctly and your skill is accessible, these json payloads are what your skill should receive as a response from Alexa to your voice command. So its simulating the response Alexa would send your skill and seeing what your skill does with that example response.

If the request is being constructed properly and it doesn't work, I would be sorta stumped as to why, and it might be hard for me to debug. If the request isn't getting made correctly, then ASKIndigo might have a bug or need some tweaking.

You updated your sample utterances and uploaded those and the intent schema to the Alex Dev portal, right?

Matt

Posted on
Wed Aug 05, 2015 3:12 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

the test does' t work. this is what the results is:{
"errorMessage": "Unexpected token ILLEGAL",
"errorType": "SyntaxError",
"stackTrace": [
"Module._compile (module.js:439:25)",
"Object.Module._extensions..js (module.js:474:10)",
"Module.load (module.js:356:32)",
"Function.Module._load (module.js:312:12)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)"
]
}

Log output is:

START RequestId: 01f44394-3bb6-11e5-88fe-d1686a49c45f
Syntax error in module 'index': SyntaxError
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
END RequestId: 01f44394-3bb6-11e5-88fe-d1686a49c45f
REPORT RequestId: 01f44394-3bb6-11e5-88fe-d1686a49c45f Duration: 12.83 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 28 MB


The test was trying the "turn off guest bathroom light." The only edits I made to the index.js was to change the username/passwprd/domain/port info and add the Echo application ID. Is there more that needs to be edited? I did update the utterances also

Posted on
Wed Aug 05, 2015 4:44 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

And you pasted your intent schema in the portal also? I have a class tonight, but will dig into your error more when I get home (9pm MT)

Posted on
Wed Aug 05, 2015 7:02 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

Yes I did, I just copied and pasted, I made no changes to the intent schema. No worries, whenever you have time, I appreciate you looking into it for me. Thanks,
Dave

Posted on
Wed Aug 05, 2015 11:26 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

There is this set of Alex example skills provided by Amazon in the portal: Below is the helloWorld one. Try to get this plugin to run. If it runs then there might be something wrong with my code, etc. If it does not run then there is something wrong with the link between your lambda function and your defined alexa skill in the dev portal. If you're new to amazon dev portal, like I was, I didn't get that I had to create a Role first. But once I did, I could pick a Role, and then complete the setup in the Lambda console, etc. Let me know how that helloWorld example goes.

Intent Schema
Code: Select all
{
  "intents": [
    {
      "intent": "HelloWorldIntent",
      "slots": []
    },
    {
      "intent": "HelpIntent",
      "slots": []
    }
  ]
}

Sample Utterances
HelloWorldIntent say hello
HelloWorldIntent say hello world
HelloWorldIntent hello
HelloWorldIntent say hi
HelloWorldIntent say hi world
HelloWorldIntent hi
HelloWorldIntent how are you

HelpIntent help
HelpIntent help me
HelpIntent what can I ask you
HelpIntent get help
HelpIntent to help
HelpIntent to help me
HelpIntent what commands can I ask
HelpIntent what commands can I say
HelpIntent what can I do
HelpIntent what can I use this for
HelpIntent what questions can I ask
HelpIntent what can you do
HelpIntent what do you do
HelpIntent how do I use you
HelpIntent how can I use you
HelpIntent what can you tell me

Code: Select all
// Alexa SDK for JavaScript v1.0.00
// Copyright (c) 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. Use is subject to license terms.

/**
 * This simple sample has no external dependencies or session management, and shows the most basic
 * example of how to create a Lambda function for handling Alexa Skill requests.
 *
 * Examples:
 * One-shot model:
 *  User: "Alexa, tell Greeter to say hello"
 *  Alexa: "Hello World!"
 */

/**
 * App ID for the skill
 */
var APP_ID = undefined; //replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]";

/**
 * The AlexaSkill prototype and helper functions
 */
var AlexaSkill = require('./AlexaSkill');

/**
 * HelloWorld is a child of AlexaSkill.
 * To read more about inheritance in JavaScript, see the link below.
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript#Inheritance
 */
var HelloWorld = function () {
    AlexaSkill.call(this, APP_ID);
};

// Extend AlexaSkill
HelloWorld.prototype = Object.create(AlexaSkill.prototype);
HelloWorld.prototype.constructor = HelloWorld;

HelloWorld.prototype.eventHandlers.onSessionStarted = function (sessionStartedRequest, session) {
    console.log("HelloWorld onSessionStarted requestId: " + sessionStartedRequest.requestId
        + ", sessionId: " + session.sessionId);
    // any initialization logic goes here
};

HelloWorld.prototype.eventHandlers.onLaunch = function (launchRequest, session, response) {
    console.log("HelloWorld onLaunch requestId: " + launchRequest.requestId + ", sessionId: " + session.sessionId);
    var speechOutput = "Welcome to the Alexa Skills Kit, you can say hello";
    response.ask(speechOutput);
};

HelloWorld.prototype.eventHandlers.onSessionEnded = function (sessionEndedRequest, session) {
    console.log("HelloWorld onSessionEnded requestId: " + sessionEndedRequest.requestId
        + ", sessionId: " + session.sessionId);
    // any cleanup logic goes here
};

HelloWorld.prototype.intentHandlers = {
    // register custom intent handlers
    HelloWorldIntent: function (intent, session, response) {
        response.tellWithCard("Hello World!", "Greeter", "Hello World!");
    },
    HelpIntent: function (intent, session, response) {
        response.ask("You can say hello to me!");
    }
};

// Create the handler that responds to the Alexa Request.
exports.handler = function (event, context) {
    // Create an instance of the HelloWorld skill.
    var helloWorld = new HelloWorld();
    helloWorld.execute(event, context);
};





Matt

Page 4 of 24 1, 2, 3, 4, 5, 6, 7 ... 24

Who is online

Users browsing this forum: No registered users and 2 guests