Trailer tracker on a NodeMCU: map card says no rows with valid coordinates
Building a cheap tracker for the trailers in our yard. NodeMCU (ESP8266) + NEO-6M, TinyGPSPlus on SoftwareSerial at 9600, publishes to v1/telemetry with PubSubClient every 5 s while moving. Telemetry tab on the device shows values arriving. But the map card on our yard board stays empty and says “No rows with valid coordinates.”
Card source is Latest values of the trailer devices. I’ve left the column settings alone. Also the markers that do show up on a test board (I typed coordinates by hand) are fine, so the card itself works.
Any idea what I’m doing wrong? Happy to post code.
Is the GPS getting a fix? Indoors the NEO-6M can sit for minutes with 0 sats and TinyGPS will give you 0.0.
Fix is fine, serial monitor shows 9 sats and sensible coordinates. Here’s what goes out:
{"lat":"-43.53","lon":"172.63","spd_kmh":0.0,"sats":9}
Those are strings, and two decimals. Is that on purpose?
Three things in that payload, I tripped on two of them with forklift trackers.
The map card’s Longitude column defaults to lng, Latitude to lat. You send lon, so every row has no longitude and gets skipped. Either rename the key on the device or set Longitude column to lon in the card. I’d rename on the device so every future board just works.
You’re sending the numbers as strings because you built the JSON with String(). Number-like text often works in comparisons, but send real numbers anyway. And String(float) gives two decimals by default, which is about a kilometre. Your trailers would all sit in the same spot.
And don’t publish when the fix isn’t valid or you’ll get trailers parked at 0,0 off Africa every time one boots in a shed.
if (gps.location.isValid() && gps.location.age() < 3000) {
char buf[96];
snprintf(buf, sizeof(buf), "{"lat":%.6f,"lng":%.6f,"spd_kmh":%.1f}",
gps.location.lat(), gps.location.lng(), gps.speed.kmph());
client.publish("v1/telemetry", buf);
}
snprintf with %f works on the ESP8266 core, unlike on an Uno. Card settings are on Map cards.
Does the map keep a trail of where it’s been or only the latest point?
Before you worry about trails, watch the message count. One message every 5 s is about 518,000 a month per device. Starter is 1,150,000 for the whole organisation. We send every 30 s while moving and once every 10 min parked.
Renamed lon to lng and switched to snprintf, markers showed up straight away and in the right bays, not stacked in one spot. Also took Tyler’s advice, 5 s was me being lazy, now 30 s moving / 10 min parked with a speed check. Kevin, I’m only showing latest positions for now.
- You must be logged in to reply to this topic.
Join the conversation
Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

