Skip to content

A smart home visitor welcome system that can recognize visitors in the system and activate cooresponding IoT suite (lighting, voice messgage, music, etc.). Demo link: https://www.youtube.com/watch?v=IFgquaeec74

License

Notifications You must be signed in to change notification settings

Rob0b0/home-visitor-welcome-system

Repository files navigation

Home Visitor Welcome System

Author: Robert (Yunbo) Chen

Intro

I made a home visitor management solution for homeowners to design IoT suite (lighting, photo gallery, music combination) for specific visitors. The system is implemented with AWS services. Paper is listed in the repo.

Demo:

https://www.youtube.com/watch?v=IFgquaeec74

System Architecture:

workflow.jpg

Setup:

There is only one Lambda function needed for actual code. But you need to set up different AWS services which I will walk you through.

Headsup:

  • I used an AWS DeepLens as the greegrass device. But any Raspberry Pi or Arduino is feasible for this.
  • Use us-east-1 as the region since for some of my code I may directly used "us-east-1" as the region.
  1. Set up S3

    1. Create a bucket called "home-visitor-tracker" to sync with the name in the code.
  2. Set up Rekognition

    1. Download and install AWS-CLI, and do aws configure to configure your aws-cli.
    2. Create a Rekognition collection by doing
      aws rekognition create-collection \
      --collection-id "collectionname"
      
    3. Upload your desired known faces images onto specific S3 bucket.
    4. index faces by doing
      aws rekognition index-faces \
      --image '{"S3Object":{"Bucket":"bucket-name","Name":"file-name"}}' \
      --collection-id "collection-id" \
      --max-faces 1 \
      --quality-filter "AUTO" \
      --detection-attributes "ALL" \
       --external-image-id "example-image.jpg" 
      
      on each face image.
  3. Set up your lighting scene

    1. I am using LIFX lighting, it can be done by creating different scenes on the mobile app.
    2. Get your authentication token by setting up your LIFX account online.
    3. On the terminal do
      curl"https://api.lifx.com/v1/scenes"      -H "Authorization: Bearer your_authenitcation_token"
      
      to retrieve your sceneIDs.
  4. Set up DynamoDB

    1. Create a table with primary key of faceID
    2. populate your table with the faceID, full name, and sceneID
  5. Set up SES

    1. Really easy, just have the two email addresses verified.
  6. Set up Lambda

    1. Create the lambda function with the name "gghelloworld"

    2. Set the Python environment to be 3.6 or 3.7

    3. Set the handler name to be gghelloworld.function_handler.

    4. Click the "action" tab on the top and click "export the function" to download the function as a zip file.

    5. Extract the zip file to get the root function folder.

    6. Replace the original gghelloworld.py with the file in the CloudCode folder.

    7. Change the email address with your own emails set previously.

    8. Change the authentication token to the own your got from LIFX.

    9. Change the sceneID to the visitor sceneID you set on the mobile phone.

    10. Then open the terminal, at the file folder, set up a virtual environment.

    11. Then in the environment, do

      mkdir package
      pip install face-recognition --target .
      

      then wait for it to complete and propagate the folder with required packages.

    12. Then put the rest of the greengrass package folders into the package folder.

    13. In the package folder, do zip -r9 ../function.zip .

    14. Go to the root folder, do zip -g function.zip function.py

    15. Upload the zip file to the lambda function, you may need to use S3 to upload it.

    16. Set the timeout interval to be 6 seconds.

    17. Set the environment variable AWS_IOT_THING_NAME with your iot thing id of the greegrass device

    18. For the trigger, use AWS IoT, and in the configuration part, select IoT Button and then configure your IoT button to register it on the cloud.

  7. Set up greengrass core.

    1. Create a greegrass group.
    2. Add the lambda function gghelloworld to the lambda tab.
    3. Add a subscription from IoT Cloud to the lambda function, with the topic of your IoT Button topic.
    4. Deploy the greengrass function to your device.
  8. Now you should be able to use the IoT button to trigger your lambda function deployed on the greengrass core with a camera, and see the light turns to your desired scene and receive an notification email.

About

A smart home visitor welcome system that can recognize visitors in the system and activate cooresponding IoT suite (lighting, voice messgage, music, etc.). Demo link: https://www.youtube.com/watch?v=IFgquaeec74

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages