Chris Collins

Tools · sensors

GNSS and NMEA

Plug a GPS module into the browser (u-blox NEO-6M to M10, Quectel L76/LC29H, ATGM336H) or replay a log: every NMEA sentence and UBX frame decoded field by field with its checksum, a sky plot and SNR bars, the fix and DOP computed from the satellite geometry, a CEP/2DRMS scatter, the clock offset and PPS, a track map with GPX/KML/CSV export, PMTK/PAIR/PCAS/PUBX/UBX command builders, and a least-squares solver that shows how four satellites find position and time.

Added

Works with

How to use it

A GNSS receiver (GPS, GLONASS, Galileo, BeiDou and friends) talks NMEA 0183: one line of comma-separated text per message, about once a second. This page reads those lines from a module on a USB serial adapter, from your phone’s location, from a log you paste or load, or from a built-in sample, and shows what the receiver sees and what every field means. It also builds the configuration commands each chip family wants, and the How GNSS works tab solves for position and clock from pseudoranges with a small least-squares solver you can watch.

Everything runs in this browser. The only network requests are the map tiles from OpenStreetMap, and you can turn those off.

How to use it

  1. Pick a source at the top.

    • Sample log — five minutes from a synthetic four-constellation receiver: a cold start (no fix, then 2D, 3D and SBAS-corrected), two minutes standing still, then a walk around a block. It plays at 4× when the page opens; ▶/⏸, the speed menu and the slider replay it.

    • GPS module (USB) — choose the module (the preset sets its usual baud rate and command set), then Connect and pick the port, or Auto-detect baud, which tries 9600, 38400, 115200 and the other common rates and keeps the one that gives valid checksums. Needs desktop Chrome, Edge or Opera.

    • Phone location — the browser’s Geolocation API: position, accuracy, and sometimes altitude, speed and heading. No satellites, DOP or NMEA come through it.

    • Paste / load a log — NMEA text from a terminal or a logger, or a binary u-center .ubx log (NMEA and UBX mixed), replayed like the sample.

  2. Sky & DOP — the sky plot (zenith in the middle, the horizon at the edge, north up) with each satellite coloured by constellation or by signal strength; filled circles are used in the fix (from GSA or NAV-SAT). Below it, the C/N₀ bars. On the right, the satellites per constellation and the DOP: the receiver’s HDOP/VDOP/PDOP beside the values this page computes from the azimuths and elevations, and the horizontal DOP ellipse. Tap satellites to leave them out, raise the elevation mask, or include every satellite in view, and watch the DOP change.

  3. Position — a scatter of the last 30–300 fixes about their mean with CEP50, CEP95 and 2DRMS circles, σ east/north/altitude, the receiver’s own GST error estimate, and plots of altitude, speed and course over time.

  4. Track map — the track coloured by fix type on OpenStreetMap tiles (or a plain metre grid with the tiles off), the latest fix and its accuracy circle. Drag to pan, wheel or +/- to zoom. Export GPX (with time, elevation, fix, satellites and DOP per point), KML or CSV.

  5. Time — UTC from the receiver against this computer’s clock, the offset per epoch and its jitter (live connections only), an experimental PPS edge timer for adapters that bring PPS to DCD or CTS, and how GPS time, UTC and the PPS pulse relate.

  6. Sentences — the log of everything received, filtered by sentence type, text (a talker such as GL), or bad checksums only. Tap a line for the field-by-field explanation. Paste any sentence or UBX hex into the decoder. Save log writes the NMEA as a .nmea file.

  7. Commands — pick the command set and set the update rate, baud and constellations: u-blox UBX (CFG-RATE, CFG-PRT, CFG-GNSS, CFG-MSG, CFG-CFG, CFG-RST for the 6 and 8 series; CFG-VALSET keys with the RAM/BBR/flash layers for the M9 and M10), u-blox PUBX, MediaTek PMTK (Quectel L76), Airoha PAIR (LC29H) and CASIC PCAS (ATGM336H). Each command shows its bytes with the checksum, ready to copy or, while connected, to Send. The UBX decoder checks and decodes pasted frames.

  8. How GNSS works — drag satellites and a receiver in 2-D, add a clock bias and see the range circles stop meeting, then solve for x, y and the bias step by step. The 3-D solver starts at the Earth’s centre with a clock error of up to 5 ms (1 500 km of range) and synthetic satellites, and recovers the position and clock in a few iterations. Then the error budget, cold/warm/hot starts, antennas, and SBAS, DGPS and RTK.

Wiring a module

Use a 3.3 V USB–serial adapter (CP2102, CH340, FT232) or the module’s own USB port. Module TX to adapter RX, module RX to adapter TX (only needed to send commands), ground to ground, and power as the breakout board says — most have a regulator and take 3.3–5 V. Put the antenna where it can see the sky; the first fix from cold takes about 30 s outdoors.

Module Default baud Notes

u-blox NEO-6M

9600

GPS only (+ SBAS), NMEA 2.3; up to 5 Hz. UBX CFG messages; no NAV-PVT.

u-blox NEO-M8N

9600

GPS + GLONASS by default (or BeiDou; Galileo on firmware 3.01+), 10 Hz; CFG-GNSS picks the constellations.

u-blox NEO-M9N

38400

four constellations at once, up to 25 Hz; configured with CFG-VALSET keys.

u-blox MAX-M10S

9600

low power, four constellations; CFG-VALSET.

Quectel L76

9600

MediaTek MT3333; PMTK commands.

Quectel LC29H

115200

dual-band L1 + L5 (Airoha AG3335); PAIR commands; the (DA)/(EA) variants do RTK.

ATGM336H

9600

AT6558, GPS + BeiDou; CASIC PCAS commands.

How it works

NMEA

A sentence is $ + a five-letter address + comma-separated fields + + a checksum + CR LF. The first two letters are the talker: GP GPS, GL GLONASS, GA Galileo, GB (or BD) BeiDou, GQ QZSS, GI NavIC, and GN for a solution that combines several. Proprietary sentences start with P and a maker code (PUBX, PMTK, PAIR, PCAS). The checksum is the exclusive-OR of every character between $ and , as two hex digits. Positions are ddmm.mmmm — degrees and decimal minutes, not decimal degrees, a common source of 30 km mistakes.

The parsers cover GGA, RMC, GSA, GSV, VTG, GLL, ZDA, GNS, GST and TXT, including the NMEA 4.10 additions: the system ID at the end of GSA (so a GNGSA per constellation can be told apart), the signal ID at the end of GSV (L1 C/A, L5, E1, B1I…), and the navigational status in RMC and GNS. Without a system ID, satellites are assigned from their numbers (GLONASS 65–96, SBAS 33–64 and 120–158, and the 3xx/4xx u-blox extended numbering for Galileo and BeiDou). The receiver model groups sentences into epochs by their time field, collects a GSV cycle before replacing a constellation’s satellites, and takes the satellites used in the fix from the GSA sentences of the same epoch.

The tests check each parser against the example sentences printed in the common references — Dale DePriest’s NMEA data pages, the NovAtel OEM7 and Trimble NMEA references, the u-blox receiver description and the MediaTek PMTK manual — and every command builder against published strings such as $PMTK220,100*2F (10 Hz), $PMTK251,115200*1F and u-blox’s $PUBX,41,1,0007,0003,19200,0*25.

UBX

u-blox’s binary protocol frames a message as B5 62, a class, an ID, a little-endian 16-bit length, the payload, and two checksum bytes: for each byte from the class to the end of the payload, CK_A += byte and CK_B += CK_A (an 8-bit Fletcher checksum). CFG-RATE for 10 Hz is B5 62 06 08 06 00 64 00 01 00 01 00 7A 12. NAV-PVT (class 01, ID 07, 92 bytes) carries the time, fix type and flags (including the RTK carrier solution), latitude and longitude in 10⁻⁷ degrees, heights in millimetres, accuracy estimates, velocity and PDOP. NAV-SAT lists each satellite’s constellation, number, C/N₀, elevation, azimuth and whether it is used. The M9 and M10 replaced most CFG messages with key/value pairs: CFG-VALSET writes 32-bit keys whose size is encoded in bits 28–30 of the key (0x30210001 CFG-RATE-MEAS is two bytes, 0x40520001 CFG-UART1-BAUDRATE four) to RAM, battery-backed RAM and/or flash. Key IDs and message layouts are from the u-blox M8, M9 and M10 interface descriptions.

DOP from the geometry

Each satellite in use gives a row of the geometry matrix G: the unit vector from the satellite towards you in east/north/up, −(cos el sin az, cos el cos az, sin el), and a 1 for the receiver clock. Q = (GTG)−1, and the DOPs are square roots of sums of its diagonal: HDOP = √(qEE + qNN), VDOP = √qUU, PDOP = √(qEE + qNN + qUU), TDOP = √qtt, GDOP all four. The tests check it against the case that can be done by hand: one satellite overhead and three on the horizon 120° apart give HDOP = VDOP = √(4/3) ≈ 1.155, PDOP = √(8/3) ≈ 1.633 and GDOP = √3. The east/north block of Q is drawn as the DOP ellipse. Receivers usually weight satellites by elevation or C/N₀, so their figures differ a little from the unweighted values here.

Position from pseudoranges

A pseudorange is ρi = |si − r| + c·Δ_t_: the true range plus the receiver clock error expressed as a distance, the same for every satellite. With four or more satellites the solver linearises about a guess — row i of G is the unit vector from satellite to guess plus a 1 — solves GTG Δ = GT(ρ − ρ̂), steps, and repeats (Gauss–Newton). From the Earth’s centre it converges in four to six steps, and the tests show it recovering a known position to under a millimetre and a 1.2 ms clock error exactly. The demonstration satellites are circular orbits at the real constellations' radii and inclinations (GPS 26 560 km, 55°; GLONASS 25 508 km, 64.8°; Galileo 29 600 km, 56°; BeiDou MEO 27 906 km, 55°) rotated into the Earth-fixed frame — realistic geometry, not real ephemerides. WGS-84 conversions use Bowring’s iteration.

Accuracy statistics

The scatter is taken about the samples' mean in local metres. CEP50 and CEP95 are the median and 95th percentile of the radial errors (with linear interpolation between ranks); DRMS = √(σE² + σN²) and 2DRMS twice that (95–98 % of fixes, depending on the ellipse’s shape); 0.59(σE + σN) is the textbook approximation to CEP50. For a circular normal distribution CEP50 = 1.1774 σ and CEP95 = 2.4477 σ per axis, which the tests check on 20 000 simulated fixes.

Sources and limits

  • NMEA 0183 v4.11 (the standard itself is sold by the NMEA); u-blox M8 / M9 / M10 Interface Description (UBX-13003221, UBX-19035940, UBX-21035062); MediaTek PMTK command packet; Quectel LC29H series GNSS protocol specification; Zhongke Microelectronics CASIC protocol manual.

  • Kaplan & Hegarty, Understanding GPS/GNSS: Principles and Applications, 3rd ed. (DOP, the error budget, TTFF); GPS SPS Performance Standard, 5th ed. (2020).

  • The PAIR and PCAS commands differ between firmware versions; check your module’s own specification before writing to flash. Commands sent from here change the module, and some (baud, constellations, restarts) take effect at once.

  • The browser clock offset includes the module’s output latency, so it shows a clock that is wrong by seconds, not milliseconds. The PPS timer polls the modem lines every 4 ms.

  • Map tiles come from tile.openstreetmap.org under the OSMF tile usage policy (light use, with attribution). Untick OpenStreetMap tiles to make no requests at all.

Runs entirely in your browser — network requests go only to the services named on this page.