-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues I found attempting to follow along #7
Comments
@brianwestfall1971 Many thanks for your feedback! It's much appreciated! I've fixed # 1 and # 2. # 3 is also fixable, but I wonder if one really needs to specify the region when instantiating AWS Helper classes. I see also that I don't always specify the version, which could cause problems if a later version of the AWS Helper classes change the API behavior. In any case I'll look into this and update the code accordingly. Once again many thanks for your feedback! |
I have now set the Region to that of the calling Lambda Function using a process variable. I'll also specified all the API Versions when instantiating the AWS Helper Classes. |
Hi Mark, I've never used AWS before and got myself completely lost, despite the detail and level of care in your instructions. So far, I have made the Pi run the script to upload an image to my S3 bucket... The rest of it I have no clue! I've read the notes for Lambda, and tried some examples but must be missing something!! Is there any help you can offer? |
@NickSutton I have limited time, but will try to help you as much as I can. First off, will you be creating NodeJS or Java based AWS Lambda Functions? If you don't have a preference, have no programming experience, or no Java experience, then I would suggest going the NodeJS direction, as it requires less tools. Once you have decided, try following the following instructions to create your first Lambda Function: This Lambda Function will take an image on S3 and send it to AWS Rekognition for analysis. Try to get as far as you can by googling / using the AWS Documentation. If you get stuck, create a new issue on GitHub and explain your problem. |
Thanks very much, I'll take another look tonight. I was surprised at how easy it was to get the image in to the S3 bucket, and then I was stumped! Hopefully better luck tonight. |
Hello Nick, Caution I just racked up 44 US$ Rekognition charges for October alone... Oops. |
@NickSutton Mattias' version is a lot quicker and easier to implement if you are looking for a quick fix :) @MatthiasGemelli Have you tried tweaking Motions parameters to generate less pics? |
@markwest1972 - nope, I just learned about the REKO bill yesterday, luckily it was on my corporate LAB account (not my personal one). Tweaking Motion config is top on my todo list. |
Thanks Gents, I'll have a go at the simplified version, but - since I might be paying for it - I'd like to understand the full capabilities of AWS, and how it can benefit projects like this! Cheers |
Hi, So I found the following link in Matthias' page really helpful and explains a lot: https://aws.amazon.com/de/blogs/ai/capture-and-analyze-customer-demographic-data-using-amazon-rekognition-amazon-athena/ As it stands, it's doing something... But I've got a bit of a mix of scripts that's probably going to cause a problem somewhere.... Mark's script is correctly uploading images from my pi to a bucket album called 'upload' It looks like it is timing out, I'm not sure why. Do all my services need to be using the same region? |
@NickSutton - yes, most Code assumes that Lambda and S3 are in the same Region.
|
Holy shit. It works!! Thanks very much guys |
Hi Mark, So I took a few hours and finally made sense of AWS, and carefully followed your instructions. I'm getting a 'succeeded' message in Step Functions, but the log is showing a Lamba fail message on the Nodemailer-send-notification function. On investigation the CloudWatch logs give me the following:
I did have a few warnings during The error handler is correctly sending an email but it only says that an unknown error occurred and Lambda didn't return an error type. Thanks for your continued help with this! |
My guess is that the function fails when it tries to attach the image to your email. This is probably because the image address is incorrect (404 means "not found"). Try printing out the following:
To see if the URL is being correctly created. Perhaps the URL prefix is being incorrectly specified? |
Thanks, found a missing '/' and got rid of the 404, but getting a 403 now instead... |
@NickSutton Good! I'm sure we can fix the 403 error. This is because the lambda function isn't allowed to access the URL. What you can try is to replace this code (line 47 of nodemailer-send-notification/index.js): With this code: Hopefully this will help! |
Between that and correctly setting AWS_Region variable - which I'd hard coded. It now works! Some tidying up to do with the archiving function, but pleased with the progress! Image comparison functions next! |
Marvellous! Just remember that you only get 5000 free Rekognition calls a month under the free their. After that I think it's $1 per 1000 calls, which isn't expensive but adds up over time. |
Yes, thanks again Mark. Do you have any plans to implement Rekognition comparison, to further reduce alerts when, say, a member of your family or even yourself triggers the camera? |
I am no longer actively working on this project and have no plans for further development. But this kind of enhancement is possible with Rekognition, as long as the pictures contain a good enough facial image. |
First let me say thank you for this! I found this extremely helpful to get started using AWS for a project similar to yours. I would like to give back a little by making it easier for others to implement this by highlighting the following issues I encountered.
Suggested Implementation Plan - Step 5 - Hyperlink for aws-lambda-functions incorrectly maps to aws-step-function.
s3-trigger-image-processing instructions, upload to AWS section - Step 2. Instead of "/upload" it needs to be "upload". The "/" prevents the trigger from working.
You have hardcoded your AWS region into index.js files for both nodemailer-send-notification and nodemailer-error-handler. The description doesn't indicate that this needs to be changed. Maybe using another Environment Variable to hold the region?
Thanks again...
The text was updated successfully, but these errors were encountered: