Skip to main content
GNSS HAT Library Documentation
Shop GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Library Overview

The GNSS HAT library is a full-featured driver for Jimmy Paputto GNSS HATs on Raspberry Pi. It wraps the u-blox UBX binary protocol behind a high-level API available in C++, C, and Python.

Supported Hardware

The library auto-detects the HAT variant via eeprom.

HATu-blox ModuleInterfaceUSBRTKGeofencing
L1 GNSS HATNEO-M9NSPIYes-Up to 4 zones
L1/L5 GNSS RTK HATNEO-F9PSPI + UARTYesBase & RoverUp to 4 zones

How it works

The library sits between your application and the u-blox GNSS module. It turns high-level API calls into UBX traffic over SPI or UART, then parses incoming frames back into typed navigation data and events.

Simple data flow between an application, the GNSS HAT library, and the u-blox GNSS module. Simple data flow between an application, the GNSS HAT library, and the u-blox GNSS module.
The library hides UBX transport details and returns typed data back to your application.
  • Your application uses the C++, C, or Python API instead of constructing raw UBX frames.
  • The library maintains a background reader thread to parse incoming messages and keep its state synchronized with the hardware.
  • The parsed results are exposed as callbacks for events such as navigation update, geofence transitions, and jamming alerts.
  • You do not need to handle raw bytes or protocol framing yourself.

Project Structure

GnssHat/
├── src/
│   ├── GnssHat.hpp / .cpp          C++ API and implementation
│   ├── GnssHat.h / GnssHat_C.cpp   C API wrapper
│   ├── ublox/                       UBX protocol, drivers, parsers, data structures
│   ├── ntrip/                       NTRIP client, server, caster, and TLS support
│   └── common/                      GPIO, synchronization, utilities
├── python/
│   └── src/                         Python CPython extension module sources
├── examples/
│   ├── cpp/                         C++ examples
│   ├── c/                           C examples
│   ├── python/                      Python examples and config resources
│   ├── gpsd-integration/            GPSD bridge daemon example
│   ├── time-server/                 Chrony and PPS time-server setup
│   └── visualization/               Web visualization demo
├── tests/                           Library test suite
├── tools/                           CLI tools, RTK helpers, and packaged resources
├── cmake/                           CMake helper modules
├── scripts/                         Build and dependency scripts
└── ntrip-caster-pub/                Standalone public NTRIP caster application