Integration with Amazon Echo

Posted on
Thu Aug 06, 2015 4:30 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

Nope, it didn't work. below is the output. I'm using lambada basic execution as the role. I'm a complete newbie when it comes to this stuff. I'll have to read up on the portal to try and see what's going on. Again, thanks for your help.

"errorMessage": "Cannot find module './AlexaSkill'",
"errorType": "Error",
"stackTrace": [
"Function.Module._resolveFilename (module.js:338:15)",
"Function.Module._load (module.js:280:25)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)",
"Object.<anonymous> (/var/task/index.js:22:18)",
"Module._compile (module.js:456:26)",
"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)"

START RequestId: 7a86d1b5-3c89-11e5-9aaf-c7133b0c6464
Unable to import module 'index': Error
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/var/task/index.js:22:18)
at Module._compile (module.js:456:26)
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)
END RequestId: 7a86d1b5-3c89-11e5-9aaf-c7133b0c6464
REPORT RequestId: 7a86d1b5-3c89-11e5-9aaf-c7133b0c6464 Duration: 23.04 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 27 MB

Posted on
Thu Aug 06, 2015 8:43 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

"errorMessage": "Cannot find module './AlexaSkill'",

Looks like perhaps you didn't zip the contents of src properly? AlexaSkill.js must be in the zip you upload to Lambda console, along with index.js and the node_modules directory. If you unpack your zip file, the src dir must not be included, just the files mentioned.

Matt

Posted on
Thu Aug 06, 2015 8:46 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

manoncloud9 wrote:
Here is the log file - sorry for the delay

Joe, looks like your having npm permissions issues.

http://lmgtfy.com/?q=38+warn+locking+Er ... ES%2C+open

At least one of the answers from the first 3 results should help you solve your problem. I recommend using NVM to avoid these sort of issues.

Matt

Posted on
Thu Aug 06, 2015 9:09 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

mreyn2005 wrote:
"errorMessage": "Cannot find module './AlexaSkill'",

Looks like perhaps you didn't zip the contents of src properly? AlexaSkill.js must be in the zip you upload to Lambda console, along with index.js and the node_modules directory. If you unpack your zip file, the src dir must not be included, just the files mentioned.


That error message was for the hello world skill. Is the zip required for that skill? I just pasted the code rather than doing a zip.

Dave

Posted on
Thu Aug 06, 2015 9:11 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

mreyn2005 wrote:
"errorMessage": "Cannot find module './AlexaSkill'",

Looks like perhaps you didn't zip the contents of src properly? AlexaSkill.js must be in the zip you upload to Lambda console, along with index.js and the node_modules directory. If you unpack your zip file, the src dir must not be included, just the files mentioned.

Matt


I just reread. What i did not include in the original zip for the ask indigo skill was the Node_modules directory. I only had the 3 file listed on your github. I guess that could be the problem then. I don't have time to test now but I'll try tomorrow. Thanks again for the help.

Dave

Posted on
Thu Aug 06, 2015 9:23 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

I only had the 3 file listed on your github.


Code: Select all
Zip the following contents under askindigo/src/

askindigo/src/node_modules
askindigo/src/AlexaSkill.js
askindigo/src/index.js


Yeah you have to zip the helloWorld example, but it does not have a node_module directory included, because there are no external module dependencies in the example.

If you write/paste code in the online editor, you're essentially writing the equivalent of index.js. The only problem with this is approach is that you can not include any external modules. I needed to do digest auth and decided to use the external module 'http-digest', so I had to come up with a zip file instead of coding in the online editor. The helloWorld example provided is the 'Hello World" for how to do your own zip file.

Keep us posted.

Matt

Posted on
Sat Aug 08, 2015 1:42 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo


Posted on
Sat Aug 08, 2015 3:17 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

I'm still having no luck. This is what i get with the hello world skill now.

{
"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)"
]
}


/var/task/index.js:17
var APP_ID = ‘amzn1.echo-sdk-ams.app.9b6233c8-29e8-4946-abce-0562f160c033’;
^
START RequestId: 8189410c-3e11-11e5-9251-2d338b228cb0
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: 8189410c-3e11-11e5-9251-2d338b228cb0
REPORT RequestId: 8189410c-3e11-11e5-9251-2d338b228cb0 Duration: 68.39 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 9 MB

Posted on
Sat Aug 08, 2015 4:50 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

Matt,
I started over from scratch using your github and this is what I now get from the ASKindigo function:

START RequestId: ab023ab7-3e1a-11e5-87a3-5b7914920ff2
2015-08-08T22:13:16.704Z ab023ab7-3e1a-11e5-87a3-5b7914920ff2 session applicationId: amzn1.echo-sdk-ams.app.99eeb5c1-f1c6-4879-aa18-6ec54943c8d5
2015-08-08T22:13:16.705Z ab023ab7-3e1a-11e5-87a3-5b7914920ff2 dispatch intent = DeviceChangeIntent
2015-08-08T22:13:16.706Z ab023ab7-3e1a-11e5-87a3-5b7914920ff2 Device: Guest Bathroom Light
2015-08-08T22:13:16.706Z ab023ab7-3e1a-11e5-87a3-5b7914920ff2 Turning Guest Bathroom Light Off
2015-08-08T22:13:16.706Z ab023ab7-3e1a-11e5-87a3-5b7914920ff2 Making request: http://rockyproc.asuscomm.com/devices/G ... method=put
END RequestId: ab023ab7-3e1a-11e5-87a3-5b7914920ff2
REPORT RequestId: ab023ab7-3e1a-11e5-87a3-5b7914920ff2 Duration: 5000.25 ms Billed Duration: 5000 ms Memory Size: 128 MB Max Memory Used: 19 MB
Task timed out after 5.00 seconds

Posted on
Sat Aug 08, 2015 5:52 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

Looks like everything is good except your Lambda function is timing out. I've set my timeout to 12 seconds, as the average runtime of my function is typically 5-9 seconds. Otherwise, everything looks good, assuming the Making request: url is correct?

See attached.

Matt
Attachments
LambdaTimeout12Seconds.png
LambdaTimeout12Seconds.png (52.04 KiB) Viewed 2952 times

Posted on
Sat Aug 08, 2015 9:38 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

So it has something to do with my router DDNS as it will always timeout the request, I tried unto 30 seconds. I then subscribed for a month of go prism just to confirm that it would work and sure enough it works fine with that. Any thoughts as to the issue? I have no issues logging into the DDNS url from outside my network.

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

Re: Integration with Amazon Echo

I've noticed now that alexa is only sending off device commands to indigo. Even though alexa correctly hears the "on" the indigo log shows an off command sent.

Posted on
Sun Aug 09, 2015 3:33 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

I closed that issue yesterday:
https://github.com/msreynolds/askIndigo/issues/3

Try updating the Intent Schema in the Amazon Developer Console's Interaction Model section with the latest from the repo.

Matt.

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

Re: Integration with Amazon Echo

I am confused on what steps I need to do on the developer portal do I create a lambda function first or a skill ? where do I get my app id to edit the index.js.

I am sorry I am not very versed in all of this.

Joe

Posted on
Mon Aug 10, 2015 8:14 pm
dproctor offline
Posts: 54
Joined: Apr 23, 2012

Re: Integration with Amazon Echo

I did the lambada function first. You will get a line that has "arn:aws:lambda:us-east-1:your numbers here..." You use that in the skill on the developer portal. From the skill you make on the developer portal you will get the app ID.

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

Who is online

Users browsing this forum: No registered users and 1 guest