Do-It-Yourself GPS Tracker and Manager
Jun 9, 2020
TL;DR: DIY GPS Tracker app bundle set.
I’m somewhat of a paranoid engineer. For example, I go to great lengths to protect my valuable assets. I use two-factor authentication wherever I can, mostly hardware key / Authenticator App types, and I explicitly disable SMS-based 2FA. I use Bluetooth-based trackers (Tile and Nut) to secure expensive laptops and cars. However, Bluetooth-based trackers only work if an in-network device is in proximity to the protected assets.
Although desktop-replacement laptops are often in the range of $2500–$4000, Bluetooth trackers are small enough to easily conceal in a hard drive bay. A car can cost an order of magnitude more than that, so it deserves better protection. There are GPS trackers on the market; however, they all lock you into their own ecosystem. On top of that, older models may rely on 2G and 3G mobile networks that are being phased out.
Since I’m a Google Fi subscriber, I can order four data SIM cards without any fixed monthly fees apart from the actual data costs. GPS location reporting won’t generate much data, though. After researching, I decided to ditch the idea of a small custom device (such as an Arduino- or Raspberry Pi-based one) and simply go with a used phone. Google Fi partially supports the Motorola Moto G6, and I was able to find one in good condition and carrier-unlocked on eBay in the $30 price range. An Android phone allows me to develop both the tracker app (which runs on the Moto G6 device) and the manager app (which runs on my personal phone) with familiar tools in a familiar ecosystem. The Moto G6 runs Android 9, which is good enough.
I wanted to make both applications open source and also release them to the Google Play Store. Besides that, I wanted to avoid at all costs touching any sensitive location data that potential users might log. I chose Firestore as the applications’ database backend since it has very good Android support and offers offline capability transparently out of the box. This can be useful if the protected asset goes through an area where there’s no data connection: the Firebase layer will automatically gather the reported GPS locations until the connection is restored, at which point it syncs them up to Firestore.
But as I mentioned, I didn’t want to store the data myself; that is where the do-it-yourself nature of the application bundle comes in. The user has to have some degree of technical knowledge to set up their own Firebase project with Firestore, and they provision all their data there by themselves. This proved to be harder than I thought: every Firebase integration requires a Firebase project to be established and hard-coded. That project in our case becomes a dummy project and never receives any data; that project doesn’t even have any authentication method enabled. The user’s project and Firestore needed to be configured at runtime, and that acts as a "secondary" Firestore. The app communicates and performs operations only on this secondary project; however, that is off the beaten path, and anything like that requires jumping through extra hoops and putting in extra effort.
My goal was to provide an open-source solution where you manage and possess your own data. You could say that my solution is locked into Firebase, but you can export your data at any time. The bills you’ll receive for your Firebase project will be negligible, mostly $0 and no more than 5 cents per month.
My main intent is theft protection. All the device needs is constant power. It won’t be in an interactive setting though, so it’s important to make sure that in case of any crash or glitch, DIYGPSTracker is able to restart on its own without any user interaction. This is why I went with the Email + Password authentication method. From a security perspective, Google authentication would be better, but in case of a restart it could get stuck on a sign-in dialog.
You must analyze your use case and lock it down as much as possible. It’s beneficial to provide a fallback solution in case of any failure. For each asset I created separate Google accounts representing a child (using the manufacturing years of the cars, 2016 and 2017, as birth years). The accounts related to the protected cars are then also managed by the Google Family Link system. That could also provide an extra backup: if DIYGPSTracker were to fail, I could still request the location of the device using the Family Link manager app.
Please visit the DIYGPSTracker website for more information, links to the applications, and their source code. Feel free to test it, file any issues in the GitHub source repositories, or even better: contribute with PRs.
Here is a demo video showing the DIY GPS Tracker and DIY GPS Manager apps in action:
This browser does not support the YouTube video player. Watch on YouTube
Demo video of the DIY GPS Tracker and DIY GPS Manager application set.