This is a device tracking implementation of Particle.io 's Asset Tracker for tracking drone movement. It uses the physical Asset Tracker hardware when using the particle electron and uses a standalone Adafruit Ultimate GPS when run on the Photon. The goal of this project is to be able to use the same code base for both hardware platforms. This code is written to run the Particle hardware and can be compiled on a new project at build.particle.io. You do not need to own any hardware to compile this code on the particle ide but you will not be able to run it.
The include section in the trackertwo.cpp are setup for local compiling which is looking for a lib folder in the root. If you are compiling on Particle the web IDE you should comment out this whole include block and add: AssetTracker, Steaming, and HTTPClient when using the web IDE. Click on the Bookmark icon in the left panel to add libraries.
- The http request.body in line 72 - 76 is repeated in the gpsPublish() function on line 129-134, break this out into a separate function
- The function create above should take in key value pairs and generate the json payload as a string. We will frequently be adding more data here so we will need an easy way to build this payload.
- The current code base updates the location (request.put) every delayMinutes which is fine for the photon but will get expensive for the electron. The goal would be to store the previous lat/lon every time we call the gpsPublish(), compare with the new lat/lon, calcualte the distance. If the distance is greater than distThreshold then do the update put.
Photon pin | GPS Pin | Photon pin | GPS Pin |
---|---|---|---|
VIN | - | 3v3 | VIN |
GND | - | RST | - |
Tx | Rx | VBAT | - |
Rx | Tx | GND | - |
WKP | - | D7 | - |
DAC | - | D6 | - |
A5 | - | D5 | - |
A4 | - | D4 | - |
A3 | - | D3 | - |
A2 | - | D2 | - |
A1 | - | D1 | - |
A0 | - | D0 | - |
Uses the Asset shield. Not this shield has the LIS3DH 3 axis accelerometer built in. This is not built into the GPS itself so when using the Photon the accelerometer is not available.