GrowSpace

How to Use a UWB Tag to Read Its Position

Contents

A UWB tag works out its own position. The anchors do not compute a coordinate and hand it down to the tag, and once that direction is clear, so is the question of where to go looking for the numbers.

On the developer tag in the GrowSpace Creator Kit (Q1), they come out over serial.
Set a terminal to 115200 with CR line endings, type lep, and lines beginning POS, start flowing: X, Y and Z in meters, then a quality figure.


What does a UWB tag actually do?

It ranges, then it solves. In that order.

Ranging comes first. The tag and each anchor trade a few precisely timed signals, and the time that round trip takes, multiplied by the speed of the signal, gives the distance to that anchor.
The method is two-way ranging, or TWR. Neither device needs a clock synced to the other,
because what gets measured is elapsed round-trip time rather than an absolute moment.

Solving comes second. One distance cannot place the tag.
It only says the tag sits somewhere on a circle drawn around that anchor at exactly that radius.
Two anchors give two overlapping circles and narrow the answer to a pair of candidate points.
Three circles meet at one point. That step, turning several distances into a single coordinate, is trilateration,
and a fourth anchor is what adds height on top of it.

Three distances. One point.

For anyone writing code against this kit, the question that matters is which device runs that math.
The tag finishes it on board. A listener relays the finished coordinate to a PC over USB serial, and a gateway sends the same coordinate onward to your network over MQTT, but neither one calculates a position.
So there is no solver for you to build and no SDK to wire up.

That cuts the other way too. What comes out is a computed coordinate, not raw timestamps,
so a project whose whole point is writing a new positioning algorithm should start somewhere lower in the stack.


What has to be true before the tag reports anything

Three conditions. A tag that stays quiet is usually missing one of them.

First, at least three anchors have to be online and talking to the tag. On two, as above,
the answer stays stuck between a pair of candidate points, so nothing narrows to a single coordinate and
the tag reports no position at all.

Second, every anchor needs its installed coordinate typed in beforehand, in millimeters and with Z included.
The tag solves against those reference points, so a wrong entry there turns straight into position error.
Measure the real room with a tape or a laser rangefinder instead of copying numbers off a floor plan,
because drawings and actual mounting positions drift apart more often than people expect.

Third, every device in the group has to share one PAN ID. Anchors sitting on a different PAN ID never talk
to the tag at all, however close they happen to be mounted, and that failure looks identical to an anchor
that is simply switched off.

Check that last one with la. The tag prints the anchors it currently ranges against, each with its ID and coordinate, and a count that reads lower than you expected tells you the answer immediately.

Count the anchors first.


How do I read the position from a UWB tag?

Start on a PC before you involve a board of your own. Fewer moving parts, faster answers.

The device shows up as a virtual COM port through the CP210x driver, so install that first and confirm it in Device Manager under Ports. Then open Tera Term, pick the COM port, and set the serial line to 115200 baud, 8 data bits, no parity, 1 stop bit, no flow control. In the terminal settings, set both receive and transmit line endings to CR. That last setting is not cosmetic. A command sent without a trailing CR gets no reply at all, and the silence looks exactly like a dead device, which is why people reinstall drivers and swap cables for an hour over a line ending they never checked.

Type si first.

System info coming back means the link is good, and now you can ask for position.

CommandRuns onWhat comes back
sitag, listener, anchorPAN ID, mode, device label
nmgtag, listener, anchorrole: tn for tag, an (act,-) for anchor, an (pasv,-) for listener
lataganchors in range, with IDs and coordinates
lecdeveloper tagper-anchor distances plus the position
leptag, listenerposition only

What do the numbers in the POS line mean?

Type lep on a developer tag and lines like this start flowing.

POS,-3.41,9.54,-1.53,74
POS,-3.42,9.53,-1.53,73

Read them as X, Y, Z in meters, then QF. That last field is a quality figure from 0 to 100, and it is the fastest read you have on whether to trust the three numbers in front of it. Anything from roughly 60 to 80 upward is comfortable. When it sags, treat the fix as soft rather than wrong, and look at what changed around the tag. A tag parked at the edge of coverage, or one that just slid behind a steel rack, tends to drop its score before anything else in the log looks visibly broken, which makes that single trailing number a decent early warning about geometry you have not fixed yet.

Run lep on a listener instead and the line carries two extra fields at the front.

POS,0,365D,-3.41,9.54,-1.53,74

The 0 is a slot index and 365D is the tag ID. A listener reports on tags it hears, so it has to say which tag each coordinate belongs to. A tag only ever reports one position, its own, and needs no such label. Parse for the format you are actually connected to.

That mismatch eats an hour if you assume.

When a position looks wrong rather than absent, switch to lec. It prints the distance to each anchor before the position line, so a missing anchor or one bad range shows up directly instead of hiding inside a coordinate that merely looks off.

You can also change how often the numbers arrive. aurs sets the transmit interval in units of 100 ms, with separate values for moving and stationary, and aurg reads back what is set. Faster updates mean quicker response. They also cost more air time.


Reading the tag from your own board

Once the coordinates look right on a PC, moving them onto a microcontroller is mostly wiring.

Mostly wiring.

The developer tag has a serial connector on each side, and the two are not interchangeable. Left runs at 3.3 V. Right runs at 5 V.

This is where people trip. A Raspberry Pi and an Arduino both carry 3.3 V and 5 V pins on the header, so either side looks like it should work, but the header is not what decides it. The voltage the board’s UART actually talks at is.

Raspberry Pi GPIO accepts 3.3 V only, and an ESP32 runs at 3.3 V as well, so both go on the left connector. An Arduino Uno or Mega is a 5 V device and goes on the right. Putting a 3.3 V board on the 5 V port can damage its UART. Check the marking before anything is powered.

Cross TX and RX. Tag TX goes to board RX, tag RX goes to board TX. People lose whole evenings to this one. Then keep the same two rules the PC side used: 115200 baud, and a \r appended to every command you send. Our Raspberry Pi integration guide walks the whole path from wiring to a parsed coordinate.


Nothing comes out. What now?

Work the list in order, because the cheap checks catch most of it.

No response at all points at the serial layer. Check four things: baud rate, missing CR, TX and RX wired straight through instead of crossed, or a driver that never installed. Characters arriving as garbage almost always means the baud rate is off. A clean si reply with no position after lep moves the problem upstream to the anchors, so count how many are online, confirm each coordinate went in as millimeters rather than meters, and check that Z is actually present instead of sitting at zero on a setup that is supposed to report height. A tag sitting outside the area the anchors surround drifts fast and sometimes reports nothing usable at all. Bring it inside the ring and try again.


FAQ

Do I need an SDK to read a UWB tag?

No. The tag sends plain CSV text over serial, and a gateway publishes the same position as MQTT JSON. Any language that can open a serial port or subscribe to a topic works.

Can I get raw ranging data and run my own positioning algorithm?

Not on this kit. lec shows the distance to each anchor for debugging, but the position itself is computed on the tag and the algorithm is not open for replacement.

How accurate is the position, and how fast does it update?

Expect roughly 10 to 30 cm with clear line of sight, updating up to 10 times per second, with a link that reaches about 25 m in the open. Metal, blocked sightlines and anchor placement all move those numbers.

What is the difference between a listener and a gateway?

Both carry out coordinates the tag has already calculated. Only the route differs. The listener relays them straight to a PC over USB serial, while the gateway sends the same coordinates to a broker over MQTT. Pick between them on whether you need an MQTT connection, not on how far along the build is.


Get a coordinate on screen today

A tag, three anchors with their coordinates entered, and a terminal at 115200 are enough to see real X and Y the same afternoon.

Everything after that, more anchors, height, a dashboard, builds on the same line of text.

See the Creator Kit (Q1) for what ships in the box, and follow the setup guide when your hardware lands.

Share this post