A few months ago I set out to solve a very physical problem with software: how do you know where your animals are, right now? Herders and small farmers lose animals that wander past a safe boundary, and by the time anyone notices, the animal — and the money it represents — is long gone.

So I built LOKA: a full-stack IoT platform that puts a low-cost GPS tracker on an animal and turns it into a live dot on a map, with an alert the moment it strays outside a safe zone. It runs end to end — custom firmware on a microcontroller, a Node.js API, and a real-time web dashboard.

This is the story of how it works and, more usefully, the parts that broke and how I fixed them.

The architecture

The whole system is three moving pieces: