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).
-
Install Terraform (
brew install terraform). -
Run
terraform initandterraform 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 namedterraform.tfvars. Seevariables.tffor the configuration variable names. -
Note the
location_history_urlAWS endpoint URL printed byterraform apply. Configure Particle Cloud to send location events to AWS by creating three webhooks for the events namedg,s, andcl. Each webhook should POST the following JSON to thelocation_history_url:
{
"event": "{{PARTICLE_EVENT_NAME}}",
"data": "{{PARTICLE_EVENT_VALUE}}",
"coreid": "{{PARTICLE_DEVICE_ID}}",
"published_at": "{{PARTICLE_PUBLISHED_AT}}"
}- Open
view.html(generated byterraform apply) in a browser to see the live map.