Hardware Setup
| HAT | u-blox Module | Communication | USB Port | Key Features |
|---|---|---|---|---|
| L1 GNSS HAT | NEO-M9N | SPI | Yes | Standard positioning, geofencing |
| L1/L5 GNSS TIME HAT | NEO-F10T | UART | — | Dual-band, time base, time mark |
| L1/L5 GNSS RTK HAT | NEO-F9P | SPI + UART | Yes | Dual-band, RTK base/rover, geofencing |
The library automatically identifies which HAT is installed by reading:
/proc/device-tree/hat/product
You do not need to specify the HAT type in code — IGnssHat::create() (C++) / gnsshat.GnssHat() (Python) / jp_gnss_hat_create() (C) handles detection and returns the correct implementation.
| GPIO Pin | Function | Used By |
|---|---|---|
| GPIO 5 | Timepulse (PPS) output | All HATs — 1PPS signal from u-blox module |
| GPIO 17 | TxReady (SPI HATs) / EXTINT (TIME HAT) | L1 & RTK: data-ready interrupt. TIME: time mark input |
| PIO pin 6 | Geofence status output | L1 & RTK HATs — drives LED/relay on HAT |
NoteGPIO 5 Conflict — Kernel PPS (/dev/pps0) and the library’senableTimepulse()/timepulse()both use GPIO 5. They cannot run at the same time. Choose one or the other.
The NEO-M9N (L1 HAT) and NEO-F9P (RTK HAT) communicate over SPI. The library uses a TxReady interrupt on GPIO 17 to know when data is available — no polling.
SPI requires root privileges or membership in the spi group.
The NEO-F10T (TIME HAT) uses UART as its primary interface. The NEO-F9P (RTK HAT) uses UART as a secondary channel for RTCM3 corrections.
UART must be enabled via raspi-config (see Installation).
The L1 HAT and RTK HAT expose the u-blox module’s USB port. When connected via USB cable to the Pi, the module appears as /dev/ttyACM0 (CDC-ACM serial device). This is useful for:
- Direct gpsd access without the bridge daemon
- u-blox u-center configuration tool
- Firmware updates
NoteUSB access bypasses the library entirely. Use it for gpsd or u-center, not alongside the library’s SPI communication.
All HATs have an on-board antenna connector and support active antennas. The library reports antenna status (OK, Short, Open) and power state via the rfBlocks field in navigation data.
For best performance:
- Place the antenna with a clear view of the sky
- Use an active antenna for improved signal strength
- The module reports
AntennaStatus::Openif no antenna is detected