Skip to content

ankurdave/IntervalTracker

Repository files navigation

Tracks a vehicle's location while it is running and at configurable intervals. Records location history using AWS and displays a live map.

Written for the Particle Asset Tracker 3G v2 (Particle Electron, u-blox SARA-U260 cellular modem, u-blox MAX-M8Q GPS receiver).

Live map

Recording location history using AWS

  1. Install Terraform (brew install terraform).

  2. Run terraform init and terraform apply. The latter command will prompt for your AWS access key and secret key, Particle device ID (coreid), and Google Maps API key. You can persist these values by creating a file named terraform.tfvars. See variables.tf for the configuration variable names.

  3. Note the location_history_url AWS endpoint URL printed by terraform apply. Configure Particle Cloud to send location events to AWS by creating three webhooks for the events named g, s, and cl. Each webhook should POST the following JSON to the location_history_url:

{
  "event": "{{PARTICLE_EVENT_NAME}}",
  "data": "{{PARTICLE_EVENT_VALUE}}",
  "coreid": "{{PARTICLE_DEVICE_ID}}",
  "published_at": "{{PARTICLE_PUBLISHED_AT}}"
}
  1. Open view.html (generated by terraform apply) in a browser to see the live map.

About

Vehicle location reporting for Particle Asset Tracker v2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages