Where Am I, and How Far From the Station

2026-10-08 by N8NAT builds

A field command that answers location from the node's own GPS: grid square, nearest town, and the distance and bearing back to the station. Plus the wrong-grid bug a cross-check caught.

Overview

A mesh node with GPS already knows where it is. The station can use that. Send a short command from the field and the gateway answers with your grid square, the nearest town, and how far and which direction home is.

  handheld:  "whereami"
      v
  station:   "CN84iw . Dallas, OR . home 2.4mi N (006 deg)"

No typing coordinates, no pulling out a phone. The radio already has the fix; the station does the math.

How it works

The node shares its position over the mesh. The gateway reads it and does three things: converts the latitude and longitude to a Maidenhead grid, reverse-geocodes the nearest town, and computes the distance and compass bearing from there back to the station. The answer comes back as one line, because that is all a mesh message has room for.

It is the same shared-GPS data that makes the rest of the station’s answers location aware. Ask about bands or repeaters and the reply is framed for where you actually are, not where the station sits.

The wrong grid a cross-check caught

While building this, the station kept reporting the wrong grid square near home. The coordinates computed correctly, but a hardcoded home-grid default was overriding them with the wrong square whenever the operator was close to the station. The tell was a cross-check against an outside source, which reported a different square than the station did. The station was wrong. The default got fixed to match what the coordinates actually compute to.

Small bug, but a good reminder: a value you hardcoded once and forgot is exactly the kind of thing that is quietly wrong until something independent disagrees with it.

Lessons

  • Use the radio’s GPS, not the operator’s typing. The fix is already there. Make the station do the conversion.
  • Cross-check your defaults against something independent. A hardcoded fallback is wrong until proven right, and only an outside source proves it.
  • One line is the format. Grid, town, distance, bearing. Everything a field operator needs to place themselves, in a single mesh message.