CarTracker

CarTracker Used AI

3 devlogs
19h 5m
Created by Jose M.

Using a Raspberry Pi Zero W 2, some accessories, and free public Xfinity hotspots to create a cheap car tracker. No additional hardware required.

Timeline

Ship 1

1 payout of shell 196.0 shells

Jose M.

about 2 months ago

Jose M. Covers 3 devlogs and 19h 5m

In this update, I made the program much more stable and reliable by making it spawn its own wpa_supplicant process when necessary rather than depending on the system. Also, I'm using Linux's 'rfkill' utility to block the wifi card when not in use to keep power usage minimal.

For some reason, though, my program stops sending updates when there's no hotspot available but does not re-detect them when nearby.

In the next devlog, I hope to have fixed any issues and maybe remove the dependence on wpa_supplicant altogether.

In the future, I plan to integrate GoogleFindMyTools and OpenHaystack into my project to leverage Google's Find Hub and Apple's Find My for much better tracking when there's no nearby open networks. These tools work by relying on nearby iOS and Android devices for location updates, so they'll likely be more reliable and use less power.

Update attachment

I figured out that the Raspberry Pi Zero W 2 doesn't support 5Ghz Wi-Fi which means it can't connect to Xfinity and many other hotspots at all. However, thanks to the Hackmate YSWS, I was able to buy a Raspberry Pi 3 A+ which is cheaper than a Pi Zero W 2 + USB-A to microUSB + a 5Ghz Wi-Fi dongle. It's also pretty nice as it has full-size HDMI and USB ports which are great for debugging, especially when having to turn Wi-Fi on and off. Though, I'm unsure if the power consumption is low enough to last a good while on a power bank. I'll have to try disabling services, disabling the ports when unused, only turning on Wi-Fi and Bluetooth periodically for short durations, etc. Optimization is really important as a power hungry device would mean having to charge the power bank multiple times a day which is infeasible. I'm thinking maybe charging the power bank in the car or at home once a day would be a bit annoying but doable.

Anyways, I've been making the project connect to hotspots in a more stable way and I've switched to using Docker to emulate aarch64 rather than cross-compiling as it's much easier but a bit slower. Also, I've added a feature so the program caches previous locations when unable to connect to the server which will ensure that I get a continuous, complete location history.

While doing some testing, I noticed that the Google Geolocation API can get as accurate as 10 meters with nothing but a list of nearby Wi-Fi networks which is very impressive and honestly insane. I'm thinking of potentially logging nearby Bluetooth devices which would give me an idea of how many devices are nearby and how close they are which could potentially help in a theft situation, though this is just speculation. Same could be done for logging Wi-Fi clients such as mobile phones. Modern phones often use active Wi-Fi scanning rather than passive scanning, so it would be possible to detect when phones with Wi-Fi enabled are in the vicinity. There's certainly a lot of work to do going forward!

I've also done a bit of work on the web frontend and I'm learning how to use OpenStreetMap and Leaflet to display a nice map in a web UI. I'm also thinking of creating a mobile app later to receive notifications and even potentially send messages to the raspberry pi for administrative purposes. Though for now, I'm only receiving data over HTTPS from the pi.

Sorry for the rambling and I'm glad that I was able to get past the Wi-Fi issue and make some great progress so far!

Update attachment

I have made significant progress on my project. So far, I created a simple backend and a C++ daemon that runs on the raspberry pi. The daemon communicates with wpa_supplicant to scan for networks, connect to public Xfinity hotspots when possible, and sends a list of nearby networks to the backend whenever possible.

The backend itself uses Google's Geolocation API to resolve a location from a list of nearby networks. So far, this has been pretty accurate but may not work well in rural areas.

A problem I faced is that the Pi Zero 2 W does not support 5Ghz out of the box, so I'll need to purchase a 5Ghz-capable Wi-Fi adapter and a microUSB to USB-A adapter and temporarily put a hold on the project.

I'm not sure how well this is going to fare in terms of power consumption and power bank battery life. I'm hoping I can have the power consumption below 500 mA which gives 20 hours of charge on a 10,000 mAh power bank. I'm thinking I may be able to power on and off the Wi-Fi adapter in intervals to reduce the average power consumption to 250 mA for around 40 hours of battery life.

Currently, I'm slightly unhappy with the costs but I can try and compile a cheaper list of components later. Other than these issues, development has been going great!

Update attachment