matwerber1 / aws-alexa-smart-home-demo Goto Github PK
View Code? Open in Web Editor NEWEnd-to-end demo of Alexa Smart Home Skill, including AWS IoT Core and physical ESP32 acting as a thermostat
End-to-end demo of Alexa Smart Home Skill, including AWS IoT Core and physical ESP32 acting as a thermostat
I reached the device testing stage after successfully overcoming all the issues faced so far(node.js version issue, etc) and now Alexa discovered the smart thing but is not responding. The lambda skill function log shows the below:
_/aws/lambda/alexa-smart-home-demo-AlexaSkillFunction-98vrkYoGBTOz
2024-01-18T07:06:27.853Z e56c9868-5ceb-4410-8bbf-aca68026ceb9 INFO Stack:
Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34)
at TLSSocket.emit (node:events:513:28)
at TLSSocket.emit (node:domain:489:12)
at TLSSocket._finishInit (node:_tls_wrap:953:8)
at TLSWrap.ssl.onhandshakedone (node:tls_wrap:734:12)
Actually there are more errors pointing to "unable to get local issuer certificate". Please help.
Hello,
Thank you for the detailed guide!. I was not able to see the device on the Alexa app even after Mapping our Skill's User ID (from Cognito) to AWS IoT Thing. Any hints on where I am doing wrong?.
i don't understand i saw on previous issue that this error was resolved but i still get it .
Error: Unable to upload artifact ../../lambda/layers/cfn-response referenced by ContentUri parameter of CloudFormationResponseLayer resource.
Unable to locate credentials
Deploying with following values
===============================
Stack name : alexa-smart-home-demo
Region : None
Confirm changeset : False
Deployment s3 bucket : None
Capabilities : ["CAPABILITY_IAM"]
Parameter overrides : {'AlexaSkillId': 'amzn1.ask.skill.27f4eb97- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'AlexaVendorId': 'xxxxxxxxxxxx'}
Error: Failed to package template: /home/pi/alexa/aws-alexa-smart-home-demo-mast er/.aws-sam/build/packaged.yaml.
[Errno 2] No such file or directory: '/home/pi/alexa/aws-alexa-smart-home-demo- master/.aws-sam/build/packaged.yaml'
i checked the /.aws-sam/build/VerifyCognitoTokenFunction/packege.json file
{
"name": "cfprovider-uuid",
"version": "1.0.0",
"dependencies": {
"https": "^1.0.0",
"node-jose": "^1.1.3"
}
}
Hi,
Sam Build seems to have a problem at UuidProvider (though tbh may not be the problem ! - just don't know - tried building in AWS CloudFormation by pressing Create Stack and putting in values manually - after pointing it in direction of template.yml file - didn't go down too well either)
Here's the message after putting in --verbose on sam build.
NODEJS installing in: G:\Dropbox\Projects\Alexa\aws-alexa-smart-home-demo-master.aws-sam\build\UuidProvider
executing NPM: ['npm.cmd', 'install', '-q', '--no-audit', '--no-save', '--production']
NodejsNpmBuilder:NpmInstall failed
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\nodejs_npm\actions.py", line 108, in execute
["install", "-q", "--no-audit", "--no-save", "--production"], cwd=self.artifacts_dir
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\nodejs_npm\npm.py", line 85, in run
raise NpmExecutionError(message=err.decode("utf8").strip())
aws_lambda_builders.workflows.nodejs_npm.npm.NpmExecutionError: NPM Failed: npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license fie
Not too familiar with node.js - can't seem to load any of the previous files manually using npm either. Hope this is an easy fix !
Thanks
Hi matwerber1
I solved all problems! Changed in the "Template.yaml" from "Nodejs10.x" to "Nodejs14.x"; I configured "AWS configure" to us-east-1 and the bucket s3 to "us-east-1" too, and I generated the "packaged.yaml" in the folder ".aws-sam\build", anyway, everything worked, the stack was generated. Now I have a new problem: when a try to activate the skill in alexa app, I never receive the sms with the activation code. I use several cellphones, including an american number, and don´t work.
Thank you!!
How to trigger Alex to say some thing based on data sent form ESP32?
Like "Motion was detected" or make it makes an alarm sound
While deploying, Many logs come up with the following error. Please help.
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'aws-sdk'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/index.mjs",
so far, i have implemented the system which uses the aws iot core connected to esp32 and lambda for skill triggers.
It is working fine when a skill triggers a cmd and alexa(lambda) changes the desired state of the shadow in the aws iot core and the esp32 recieves delta process it and updates the reported of the shadow.
The problem is when the esp32 is down or not connected , how do i report that to the user? so far now alexa responds okay for the cmd issued since aws iot core is updated. How do i use the EndpointHealth interface and report an error to the user ?
I tried in many places to figure out but couldnt find it.
Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 12. Resource with id [AlexaSkillFunction] is invalid. 'CodeUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [AssociateThingToUserFunction] is invalid. 'CodeUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [CloudFormationResponseLayer86b5683fdf] is invalid. 'ContentUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [CognitoClientConfigurationProvider] is invalid. 'CodeUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [CognitoClientSecretProvider] is invalid. 'CodeUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [CognitoDomainProvider] is invalid. 'CodeUri' is not
I have a problem related to this.
The project is a test, for study.
On Lambda (cloud) I publish the state of desired as per the request, and on the physical device (esp32) I publish the statdi of reported.
But, in the tests in the ADC, it always gives FAILED. From the tests I've done, if the Device Shadow metadata is DIFFERENT, the test fails. If it is the same, the test passes.
{
"metadata": {
"desired": {
"state": {
"timestamp": 1651346494
},
"speed": {
"timestamp": 1651346494
},
"potency": {
"timestamp": 1651346494
}
},
"reported": {
"state": {
"timestamp": 1651346495
},
"speed": {
"timestamp": 1651346495
},
"potency": {
"timestamp": 1651346495
},
"value": {
"timestamp": 1650712182
}
}
}
}
This test above failed because the desired timestamp differs from the reported one.
Do you know how I can fix this?
Mathew, not sure how to contact you so I'm doing it through here.
We have a small start up company that needs to do this for a large number of ESP32s, looking to hire someone for a quick job.
How can we best contact you?
Good morning @matwerber1 , one more time, thank you very much.
As I said, I managed to run about 85% of the initial part of the project, but I'm not managing to generate the stack. Here are some screenshots that clarify what's going on:
you could work with us... would be amazing
Hi matwerber1,
As Cognito was not sending any SMS to mobile for verification,
So i would like to change phone number to email verification , Can you please suggest where can we change ?
Thanks in advance
(base) Area51:aws-alexa-smart-home-demo warmachine$ ./deploy.sh
Error: Unable to upload artifact lambda/layers/cfn-response/ referenced by ContentUri parameter of CloudFormationResponseLayer resource.
Parameter ContentUri of resource CloudFormationResponseLayer refers to a file or folder that does not exist /home/warmachine/Desktop/aws-alexa-smart-home-demo/lambda/layers/cfn-response
Deploying with following values
===============================
Stack name : alexa-smart-home-demo
Region : None
Confirm changeset : False
Deployment s3 bucket : None
Capabilities : ["CAPABILITY_IAM"]
Parameter overrides : {'AlexaSkillId': 'amzn1.ask.skill.d98267db-a796-4696-869a-060c3ab3c6e7', 'AlexaVendorId': 'M25E7FDW2I3AZR'}
Error: Failed to package template: /home/warmachine/Desktop/aws-alexa-smart-home-demo/packaged.yaml.
[Errno 2] No such file or directory: '/home/warmachine/Desktop/aws-alexa-smart-home-demo/packaged.yaml'
(base) Area51:aws-alexa-smart-home-demo warmachine$
@matwerber1
The command line stalls once it reaches "CREATE_COMPLETE AWS::IAM::Role AlexaSkillFunctionRole "in UBUNTU. AWS Cloudformation console shows "create in progress". Please help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.