Installation
Install build tools and libraries:
sudo apt-get install build-essential cmake libgpiod-dev
For Python bindings you also need:
sudo apt-get install python3-dev
git clone https://github.com/jimmypaputto/GnssHat.git
cd GnssHat
mkdir -p build && cd build
cmake .. -DBUILD_PYTHON=ON -DBUILD_EXAMPLES=ON
make
sudo make install
sudo ldconfig
| Flag | Description |
|---|---|
BUILD_PYTHON |
Build and install the Python CPython extension module |
BUILD_EXAMPLES |
Build all C and C++ examples. Binaries are symlinked into examples/BinariesSymlinks/ for convenience |
Both flags are optional — omit them if you only need the C++ / C shared library.
The Python module can also be built separately (requires the C++ library installed first):
cd GnssHat/python
mkdir -p build && cd build
cmake .. && make -j$(nproc)
sudo make install
Installs to ~/.local/lib/pythonX.Y/site-packages/jimmypaputto/.
The library requires libgpiod. If you get a compilation error like:
error: 'gpiod_edge_event_buffer_free' was not declared in this scope
Set the correct libgpiod version in CMakeLists.txt:
set(LIBGPIOD_VERSION 1)
# or
set(LIBGPIOD_VERSION 2)
NoteMost recent Raspberry Pi OS images ship with libgpiod version 2. Older images use version 1.
If you see:
[UART] Failed to open UART device: No such file or directory
[UART] Cannot init epoll - UART not initialized
Enable UART via raspi-config:
sudo raspi-config
Navigate to Interface Options → Serial Port and enable the serial hardware interface. A reboot is required.
NoteOnly the L1/L5 TIME HAT (NEO-F10T) and the UART channel of the L1/L5 RTK HAT (NEO-F9P) require UART. The L1 GNSS HAT (NEO-M9N) uses SPI only.