I never run with a phone, and I often run in the evening. My wife and my family would like to know where I am, and I would like them to. So I wanted a small board in my pocket that sends its position to a map they can open on a phone, with no app and no third-party tracking service. Trackers like this exist, of course. I like to build this kind of thing myself. It is play, and that is exactly why it is worth doing: the biggest risk in the whole project is about 50 dollars spent on hardware that may never work.
![]()
From the first firmware build to a marker on the phone took one hour. The map at loc.example.com showed the board moving around the block, a few seconds after each GPS fix.
The hardware is a LILYGO T-A7670E R2: an ESP32 with a SIMCom A7670E modem that also has GPS. A Nano SIM with data and an 18650 cell complete it.


![]()
The run above is sample data: a 5 km loop sent with the test script at a steady 5:00 min/km, not my own run. The page itself is what the phone shows, one new point every 5 seconds.
flowchart LR
B["T-A7670E board<br/>fix every 5 s"] -- "HTTPS POST<br/>batch of points" --> S["FastAPI + SQLite<br/>behind Caddy"]
S -- WebSocket --> M["Leaflet map<br/>on the phone"]
What was already there
The server was done and tested the day before: one endpoint for the board, one for the map, a WebSocket for live points, and a fake-run script to feed it without hardware. The firmware was written against LilyGO's fork of TinyGSM, because the mainline library has no A7670 GPS and no HTTPS. It had never been compiled.
The modem does the HTTPS itself. No PPP, no TLS on the ESP32, no certificates to manage on the board. The firmware builds a JSON body, calls https_post and reads the status code. Points leave a ring buffer only after the server says 200, so a dead spot loses nothing.
The hour, step by step
Three things that cost time
| Problem | What it looked like | Fix |
|---|---|---|
| Cloud firewall | Ports 80 and 443 timed out, port 22 answered | Allow HTTP and HTTPS inbound, restart Caddy |
| Modem USB socket | A "A76XX Series LTE Module" on the USB bus, no serial port | Move the cable to the USB-C socket |
| Garbage speed | One fix reported -5,143.9 m/s | Drop anything outside 0 to 15 m/s |
A port that times out is filtered, a port that nothing listens on is refused. The timeout told me the block was outside the machine before I looked at a single config file.
The speed glitch came from the modem, not from my maths. Most fixes carried a sane value, then one came back with an absurd negative number. A runner never exceeds 15 m/s, so the firmware now zeroes anything outside that range before it leaves the board:
p.spd = info.speed * 0.514444f; // knots to m/s
if (p.spd < 0.0f || p.spd > 15.0f) {
p.spd = 0.0f;
}
Without a battery the board still runs from USB, but the battery pin reads about 284 mV of noise and the map shows 0 percent. Put the cell in before you trust that number.
How long the cell lasts
An estimate, not a measurement yet. The cell in the photo says 12,000 mAh. No 18650 holds that. The best real ones reach about 3,500 mAh, and a cheap cell with a label like this usually holds 1,000 to 2,500 mAh. Only a discharge test tells you.
The firmware never sleeps, so the draw is roughly 150 to 250 mA on average:
| Part | Typical draw |
|---|---|
| ESP32 awake, no Wi-Fi | 50 to 80 mA |
| A7670E registered, idle | 20 to 40 mA |
| GPS running | 30 to 40 mA |
| LTE upload every 5 s, averaged | 30 to 80 mA |
That gives 5 to 8 hours on a 1,200 mAh cell and 14 to 22 hours on a real 3,400 mAh one. Enough for any run or a day of tracking, not for days. Deep sleep between fixes and a start and stop button are the two things that would stretch it, and both are on the list.
The cheap measurement is already there: the map shows the battery percentage from the ADC, so a few hours by the window give the real curve.
What it cost
The server runs on a droplet I already pay for, so the whole bill is the hardware:
| Item | Price |
|---|---|
| LILYGO T-A7670E R2 board with GPS | about 30 USD |
| Nano SIM with data | about 14 USD |
| 18650 cell | about 6 USD |
About 50 USD all in. If the board had never talked to the network, that would have been the loss.
What it took
The parts I feared most, the modem library and the HTTPS upload, worked without a change. The whole hour went into things around the code: a firewall I had set up myself weeks ago, a board with two USB sockets that look alike, and a GPS that needs sky. Next time I plug the board in before I write the deploy steps, and I check the firewall rules of a shared box before I blame DNS or the proxy.

Related notes
A live call transcript on my Mac, with Whisper running locally
I wanted to record client calls in OBS and read a transcript while the call is still going. The OBS transcription plugin gave me nothing, so I wrote a small Python tool on top of BlackHole and MLX Whisper. Lines appear about a second after each speaker pauses.
Logging IMU data from an M5Stack Core2 to CSV, and the two bugs that hid it
I set up an M5Stack Core2 to stream its MPU6886 accelerometer and gyroscope to a CSV file at 100 Hz. The code was fine. The log file stayed empty because of two serial port traps.

