Giter Site home page Giter Site logo

aws-iotlocationfleet-sample's Introduction

AWS IoT Location Fleet Tracker Sample code

This example application creates an IoT Thing, AWS IoT policy and certificate, Amazon EventBridge rule and Lambda function. The SAM template accepts the following parameters and creates the components: ARN of Geofence Collection ID ARN of Location Tracker ARN of the AWS IoT certificate Email ID to send notification to

The sample python program will simulate the gps location updates being sent to IoT core which are directed to Amazon Location services which triggers an EventBridge notification based on the geo event of the asset entering a geofenced location around the warehouse.

Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the AWS Pricing page for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.

.
├── README.MD                  <-- This instructions file
├── LambdaFunction             <-- Source code for a lambda function
│   └── lambda_function.py     <-- Main Lambda handler
│   └── requirements.txt       <-- Requirements file
├── template.yaml              <-- SAM template
├── LocationIoT.py             <-- Python client program to generate IoT events

Requirements

Installation Instructions

  1. Create an AWS account if you do not already have one and login.

  2. Install Git and install the AWS Serverless Application Model CLI on your local machine.

  3. Create a geofence collection, location tracker and AWS IoT certificate.

  4. Create a new directory, navigate to that directory in a terminal and using command line clone the repository: git clone https://github.com/aws-samples/aws-iotlocationfleet-sample.

  5. From the command line, run:

cd ./aws-iotlocationfleet-sample
sam deploy --guided

Choose a stack name, input the parameter values, and allow SAM to create the resources.

How it works

It has 3 parts: i) template.yaml - This is the SAM template which creates the resources - IoT Thing IoT Policy IoT Certificate Amazon EventBridge rule IoT topic

ii) Lambda function code - this is used by the above SAM template to create the Lambda function which gets invoked by IoT rule and will pipe data from IoT to location services

iii) LocationIoT.py - This is a python code that will run on the users laptop and uses AWS IoT Python SDK to send location coordinates to IoT Core. This mimics an IoT device attached to an asset which sends location coordinates as it navigates.

The sample python program will simulate the gps location updates being sent to IoT core which are directed to Amazon Location services which triggers an EventBridge notification based on the geo event of the asset entering a geofenced location around the target.

==============================================

Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: MIT-0

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-iotlocationfleet-sample's People

Contributors

amazon-auto avatar gogitkrish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.