Skip to content

gateak/mission-autonomy

Repository files navigation

AegisMap - Disaster Response Coordination System

Real-time drone telemetry visualization using AWS IoT Core, Lambda, S3, and API Gateway.

Architecture

Simulator → IoT Core → Lambda (storeTelemetry) → S3
                                                   ↓
                        Frontend ← API Gateway ← Lambda (getLatest)

Setup Instructions

1. Create S3 Bucket

aws s3 mb s3://aegismap-data

2. Run Automated Deployment

cd /workshop
./deploy.sh

This script will:

  • Create IAM role with S3 and CloudWatch permissions
  • Create S3 bucket
  • Deploy both Lambda functions
  • Configure IoT Core rule
  • Create API Gateway
  • Display your IoT endpoint and API URL

3. Run Simulator

Set environment variables:

export IOT_ENDPOINT=YOUR_IOT_ENDPOINT.iot.REGION.amazonaws.com
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
export AWS_SESSION_TOKEN=YOUR_SESSION_TOKEN  # if using temporary credentials
export AWS_REGION=us-east-1

Get IoT endpoint:

aws iot describe-endpoint --endpoint-type iot:Data-ATS

Install and run:

npm install
npm start

4. Open Frontend

  1. Edit index.html and replace YOUR_API_GATEWAY_URL with your API Gateway endpoint
  2. Open index.html in a browser
  3. Watch drones move across Nashville in real-time

Quick Console Setup (Alternative)

S3

  1. Go to S3 Console → Create bucket aegismap-data

Lambda

  1. Create two functions: aegismap-storeTelemetry and aegismap-getLatest
  2. Use Python 3.11 runtime
  3. Copy code from storeTelemetry.py and getLatest.py
  4. Add environment variable BUCKET_NAME=aegismap-data
  5. Attach IAM role with S3 read/write permissions

IoT Core

  1. Go to IoT Core → Message routing → Rules
  2. Create rule with SQL: SELECT * FROM 'aegismap/drones/telemetry'
  3. Add action: Lambda function → aegismap-storeTelemetry

API Gateway

  1. Create HTTP API
  2. Add route: GET /latest
  3. Integrate with Lambda aegismap-getLatest
  4. Enable CORS
  5. Deploy to stage (e.g., prod)

IAM Role Permissions

Lambda execution role needs:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::aegismap-data",
        "arn:aws:s3:::aegismap-data/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogGroup",
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:*:*:*"
    }
  ]
}

Demo Features

  • Real-time drone position updates
  • Battery level monitoring
  • Survivor detection alerts
  • System status dashboard
  • Nashville disaster zone visualization

Troubleshooting

Simulator not connecting:

  • Verify IoT endpoint is correct
  • Check AWS credentials are valid
  • Ensure IoT policy allows publish to aegismap/drones/telemetry

No data in frontend:

  • Check API Gateway URL is correct in index.html
  • Verify Lambda has S3 permissions
  • Check browser console for CORS errors

Lambda errors:

  • Check CloudWatch Logs for both Lambda functions
  • Verify S3 bucket name matches environment variable
  • Ensure IAM role has necessary permissions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors