Catch-up to Lookout V1 alpha1: running on real devices
See the announcement for context, but TLDR: this is a catch-up devblog-style post on where I am with Lookout, which is currently at V1 alpha1. Today we'll focus on how I got real GPS samples from a train.
I go to Germany every year, and had been planning to visit a few places in the area around Mannheim, so this was a good opportunity to get a sense of what real experience on a train would look like. One of the very first things I did was to start recording real GPS traces. This was done via a website running on iPad/iPhone using local sensors → saving to an online Redis queue (landing) → draining into bronze for later analysis (note, see further below for landing/bronze explanation).
The GPS data from my phone wasn't too surprising: I know from using other Apps that it can vary a lot in accuracy. However, I know an iPhone does some fairly clever stuff behind the scenes, so what would it be like on other types of devices?
I'd already been playing around with some M5 devices, and so had some to develop on. As a way to keep this real, and not coupled to Apple devices, I adopted a requirement that anything I build must be able to run on an M5 device with an attached GPS sensor, as well as on a website on an iPhone.
The ultimate V1 App should still be able to do "opportunistic enrichment", if extra capabilities are available, but the core features should always work on an M5 device where the only connectivity it has is passive GPS.
It is totally ok, however, to do a bunch of processing offline ahead of time. This is where I adopted the "Medallion Pattern", instantiated here roughly as:
landing: device recordings, and other raw data, typically in a non-parquet native format, focussed on being easy to capture and not kept long-term,- →
bronze: similar data as landing, but in parquet format and persisted + also snapshots of external datasets, - →
silver: normalised and processed derived data, based on what's in bronze, - →
gold: distilled and minimised versions of silver data, targeted for deployment on the devices themselves.
(We'll return to this processing pipeline in future posts.)
Getting things working on the M5 wasn't simple, as there is a lot to discover about device setup. This was actually where using Claude was super-useful as I am far less of an expert in ESP32 device stuff than in everything else I've mentioned so far. The user-friendliness of the M5 stack also came in handy: it was super-easy to get it powered-up and talking serial over the USB cable. So, this made for quite a fruitful and tight dev loop, particularly when I could test the GPS whilst on a live train.
Having to test outside in my garden was somewhat colder and less comfortable.
Where does this get us? It gets us to a dataset which I've subsequently used repeatedly to ground various decisions in actual recorded data, and proof that the GPS data can be gotten on multiple device types.
Next up: Water Crossings
Related development detail if interested:
- mike is on a train getting data
- improve train-based recording accuracy / reliability
- Spikes on Device Support
- Device
- Telemetry
- Medallion