Charmed Quark Systems, Ltd. - Support Forums and Community
New Amazon Echo Support - Printable Version

+- Charmed Quark Systems, Ltd. - Support Forums and Community (https://www.charmedquark.com/vb_forums)
+-- Forum: General Discussion (https://www.charmedquark.com/vb_forums/forumdisplay.php?fid=3)
+--- Forum: CQC Support (https://www.charmedquark.com/vb_forums/forumdisplay.php?fid=9)
+--- Thread: New Amazon Echo Support (/showthread.php?tid=9423)



New Amazon Echo Support - zra - 09-12-2016

Dean Roddey Wrote:That should be correct. However, it could be that you have the wrong files in the right places. What type of file did you drop into Personal/Certificates? In my examples it's a pfx file, which is more than a certificate. It's both the private key and public certificate in one file. I'm not sure how you deal with it if you have separate files only for those.

I used a different method.

I redid it generating a pfx file via internet explorer. I'm just about finished reinstalling everything to test.


New Amazon Echo Support - Dean Roddey - 09-12-2016

How do you generated a pfx via IE? You don't mean you used some web site to do it or something do you? If so, they probably just kept the info and will be using it to hack you.


New Amazon Echo Support - zra - 09-12-2016

Dean Roddey Wrote:How do you generated a pfx via IE? You don't mean you used some web site to do it or something do you? If so, they probably just kept the info and will be using it to hack you.


StartSSL gives it as an option. It doesn't take me to a separate website or anything like that, it just generates it into the browser and then from there I exported it out into a pfx file.

At any rate. Some progress. I now have a secure connection to view the testimage. The certificate looks good there.

Still can't get Echo to work, though.


New Amazon Echo Support - Dean Roddey - 09-12-2016

If you run a test on the lamba site, what are you seeing over there? And what is showing up in the CQC logs now?


New Amazon Echo Support - Dean Roddey - 09-12-2016

On, and on the secure connection from the browser, does that include going through your public DNS name as well, or only locally?


New Amazon Echo Support - zra - 09-13-2016

Finally success.

Here is what I think transpired:

First, I obviously screwed up the creation of the certificate. On StartSSL they give you the option to create the certificate two different ways(layman here, so I might be off on this process). One via using IE and an then via exporting it and you can choose PFX. The other uses an application that probably does the same thing, but I didn't do it right.

At any rate, doing it via IE and exporting it worked.

The second thing that I needed to do, and you should address this or note it for future users is:

In the Lambda handler code, at the bottom, there is this code:

var http = require('https');
var req = http.request(options, function(res)
{
res.setEncoding('utf8');
var repData = "";

// Just accumulate data till the end
res.on('data', function (chunk)
{
repData += chunk;
});

// We have all the data so process it
res.on('end', function()
{
/* Get out any reply text */
var repJSON = JSON.parse(repData);

// We get the Reply value to send back as the response
var sessAttrs = {};
context.succeed
(
buildResponse
(
sessAttrs,
buildSpeechletResponse
(
runType
, repJSON.Reply
, repromptText
, true
)
)
);
});
});

This line:

var http = require('http');

Needs to be changed to:

var http = require('https');



Once I did that, I was up and running.


New Amazon Echo Support - Dean Roddey - 09-13-2016

Oh, OK. I mentioned that back at the very start, but it probably got lost in the back and forth:

Quote:Oh, and also make sure the javascript is using the https prefix as well, since by default it's using the http prefix, which won't work. There is I think a thing at the top of the javascript file, but make sure it's getting used. If it's not, then it's probably just doing an HTTP connection.



New Amazon Echo Support - zra - 09-13-2016

Dean Roddey Wrote:Oh, OK. I mentioned that back at the very start, but it probably got lost in the back and forth:

Ok.

Cool. Everything is running great now.


New Amazon Echo Support - EST - 09-15-2016

How can I get this to understand number values? I want to say 50 or 50% and I keep getting the number word passing in param3. I want to pass param3 as the variable in the FieldWrite value for my UPB lighting. I want to say "Set the Hall light to 50%" then pass the 50 as the value variable.


New Amazon Echo Support - Dean Roddey - 09-15-2016

I did a macro called Num2Num that will take a spelled out number and convert it to an actual number. If you are on 5.x, then import the attached macro pack.

You'd invoke it something like this:

Code:
If MacroEng::RunMacro(/User/Num2Num, "one twenty five" LVar:Val, LVar:ErrMsg)
   // It worked, so use the value
Else
   // It failed, so log the error message
EndIf


So it's the text to convert, a variable to put the converted value into, and a variable to put an error message into if it fails. In the above example LVar:Val would get set to 125. Normally of course you'd end up with the text to convert in a variable in which case it would be:

Code:
If MacroEng::RunMacro(/User/Num2Num, "%(LVar:NumText)" LVar:Val, LVar:ErrMsg)
   // It worked, so use the value
Else
   // It failed, so log the error message
EndIf

Be sure to quote the text because it's going to be multiple words, and you need them to show up to the macro as a single parameter. So, even if expanding from a variable, quote it.