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.
| HAT | u-blox Module | Interface | USB | RTK | Geofencing |
|---|---|---|---|---|---|
| L1 GNSS HAT | NEO-M9N | SPI | Yes | - | Up to 4 zones |
| L1/L5 GNSS RTK HAT | NEO-F9P | SPI + UART | Yes | Base & Rover | Up 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.
- 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