Skip to content

GNSS ublox and ubx protocol support - #61

Open
bartekM-pl wants to merge 2 commits into
mainfrom
gnss-ublox-ubx
Open

bartekM-pl wants to merge 2 commits into
mainfrom
gnss-ublox-ubx

Conversation

@bartekM-pl

Copy link
Copy Markdown
Member

Add u-blox MAX-M10N (UBX, 20 Hz) support to the GNSS driver

Adds a UBX backend next to the existing NMEA/MTK (L76-L ) one. The receiver is detected automatically at start-up. GPS_init, GPS_getData and GPS_checkStatus are unchanged.

Changes

  • GNSS_driver.c is now the common layer (UART, detection, parser task, queue). The old NMEA code moved to GNSS_nmea.c. New files: GNSS_ubx.c, ubx_parser.[ch] (pure C, no ESP-IDF dependency) and GNSS_types.h.
  • Detection probes 115200 then 9600 baud with a UBX poll. A UBX reply means u-blox, NMEA text means L76-L, and no answer falls back to NMEA at 9600. A cold start takes about 1 s longer.
  • u-blox setup: 115200 baud, UBX only, NAV-PVT at 20 Hz, GPS+Galileo only (needed for 20 Hz on the M10N), airborne <4g model, HDOP at 1 Hz. Settings go to RAM only, so detection reconfigures the receiver after each power cycle.
  • gps_t grew: double lat/lon, MSL and ellipsoid altitude, full date, NED velocity, accuracy estimates, DOPs, itow_ms, rx_time_us and source.
  • BOARD_cfg.h: parser task stack 2048 to 3072, UART ring buffer 1024 to 2048.

Behaviour changes

  • NMEA altitude is now MSL. It used to be ellipsoid height, so NMEA readings are about 40 m lower in Poland.
  • NMEA fixes: speed is now in m/s, the year includes 2000, and over-long fields no longer overflow.
  • Removed nmea_parser_*, the unused event loop and the GSA/GSV arrays in gps_t. Nothing in the repo used them.

Testing

  • Parser unit tests (host): 50 checks, run with make -C components/GNSS_driver/host_test run.
  • Host simulation of the full init flow with fake u-blox and L76-L receivers: 20 Hz and 5 Hz delivered. The harness is not in this PR.
  • ESP-IDF files were only syntax-checked against stubs. Not tested on hardware.

TODO

  • Full build for the mega and mini targets.
  • A MAX-M10N reaches 20 Hz (the driver logs "Solution rate" after 5 s).
  • The L76-L receiver still gives 5 Hz.
  • The NAV-DOP and constellation key IDs came from memory. A wrong key shows as a NAK warning in the log.

🤖 Generated with Claude Code

b.moczala added 2 commits October 23, 2026 11:38
+ simpler autodetection
+ defines simplified
@bartekM-pl bartekM-pl added the enhancement New feature or request label Oct 23, 2026
@bartekM-pl bartekM-pl self-assigned this Oct 23, 2026
@bartekM-pl bartekM-pl linked an issue Oct 23, 2026 that may be closed by this pull request
@bartekM-pl bartekM-pl added this to the Release v1.0-beta milestone Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for ublox GNSS receiver

1 participant