Open qgoehrig opened 6 years ago
There is something missing that someone else identified as being required for this to work. Prior to uploading the .zip file created in step 3 to Lambda, edit the /src/MirrorMirror.js file and add a new line under region: "us-east-1",
(~line 16) and add host: "YOURID.iot.us-east-1.amazonaws.com",
so the entire section looks like this:
app.setup = function() {
app.device = awsIot.device({
keyPath: __dirname + "/certs/MagicMirror.private.key",
certPath: __dirname + "/certs/MagicMirror.cert.pem",
caPath: __dirname + "/certs/root-CA.crt",
clientId: "MirrorMirror" + (new Date().getTime()),
region: "us-east-1",
host: "YOURID.iot.us-east-1.amazonaws.com",
});
You need to get your IOT endpoint created at the beginning for that line - to do that, go to AWS > IoT > Settings and copy the value under Custom Endpoint. Credit to torresfm
After making that addition, save the MirrorMirror.js file and then create your zip for upload.
Having the same problem, the solution from @XerqJon doesn't working for me
This is a copy of an Issue I created on the MirrorMirrorOnTheWallSkill Github page.
It seems that there are a few other issues addressing this issue that don't have fixes, so I'd figure I'd post my issue with as a detailed report. The Lambda Response from the service simulator in the Skill test returns the following error.
The remote endpoint could not be called, or the response it returned was invalid.
My lambda request is as follows with a few fields omitted:
Diving further into the Invocation Logs in AWS lambda (as seen through CloudWatch), I get the following error stack trace:
module initialization error: Error at new DeviceClient (/var/task/node_modules/aws-iot-device-sdk/device/index.js:445:13) at Object.DeviceClient [as device] (/var/task/node_modules/aws-iot-device-sdk/device/index.js:216:14) at Object.app.setup (/var/task/MirrorMirror.js:11:23) at Object. (/var/task/index.js:21:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
On the last bit of the exception in /node_modules/aws-iot-device-sdk/device/index.js, the error that is being throw is from
Perhaps this can offer some insight as to where I'm going wrong here.
I feel that there are many users here like myself who are still struggling to get past this point, so any help is greatly appreciated!