Skip to content
NewA realistic 3D head for a free swim cap editor
Nov 12, 2026·5 MIN READ
An LTE GPS tracker on a live map in one hour

An LTE GPS tracker on a live map in one hour

A LILYGO T-A7670E board, a FastAPI server and a Leaflet page. The firmware built on the first try. The hour went into the wrong USB socket, a cloud firewall and one garbage speed value.

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 T-A7670E board on a laptop keyboard with the LTE antenna on the left and the GPS patch antenna below
The board with both antennas. The red LEDs are the modem's status lights.
Close-up of the SIMCom A7670E modem on the board, with the identifiers blurred
The A7670E does LTE, GPS and the HTTPS itself. Serial number and IMEI blurred.

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

1. First build
PlatformIO built the firmware clean on the first try. 308 KB flash, 39 KB RAM.
2. Server on a shared droplet
Docker Compose with Caddy on the small box that already runs a home bot. Caddy fetches the Let's Encrypt certificate by itself.
3. Cloud firewall
Ports 80 and 443 timed out from outside. The droplet firewall allowed SSH only. Two rules later the certificate arrived in seconds.
4. The wrong USB socket
The Mac saw a SIMCom LTE modem, not an ESP32. The Micro USB socket belongs to the modem. The USB-C one programs the chip.
5. First fix by the window
Indoors: no fix for minutes. By the window: a fix, an upload, a marker on the phone.

Three things that cost time

ProblemWhat it looked likeFix
Cloud firewallPorts 80 and 443 timed out, port 22 answeredAllow HTTP and HTTPS inbound, restart Caddy
Modem USB socketA "A76XX Series LTE Module" on the USB bus, no serial portMove the cable to the USB-C socket
Garbage speedOne fix reported -5,143.9 m/sDrop 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:

firmware/src/main.cpp
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:

PartTypical draw
ESP32 awake, no Wi-Fi50 to 80 mA
A7670E registered, idle20 to 40 mA
GPS running30 to 40 mA
LTE upload every 5 s, averaged30 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:

ItemPrice
LILYGO T-A7670E R2 board with GPSabout 30 USD
Nano SIM with dataabout 14 USD
18650 cellabout 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.

Share
Mariusz Smenżyk
Written by

Mariusz Smenżyk

Builder for sport. Make. Test. Launch.

Related notes