Skip to content

Raspberry Pi Setup

  1. Set jumper to position B (UART mode)

  2. Enable serial port

    Terminal window
    sudo raspi-config
    # Interface Options → Serial Port → Yes
    # Interface Options → I2C → Yes (optional)
  3. Connect antenna — attach the L1/L5 antenna to the IPEX socket and place with clear sky view

  4. Verify the serial device

    Terminal window
    ls -la /dev/ttyS0
  5. Install lc29h CLI

    Terminal window
    uv tool install lc29h
  6. Test communication

    Terminal window
    lc29h --port /dev/ttyS0 info
  1. Set jumper to position A (USB mode)

  2. Connect via USB-C cable

  3. The CP210x driver is included in modern Linux kernels

    Terminal window
    ls -la /dev/ttyUSB0
    lc29h --port /dev/ttyUSB0 info

For applications using gpsd:

Terminal window
sudo apt-get update
sudo apt-get install gpsd gpsd-clients

Edit /etc/default/gpsd:

USBAUTO="false"
DEVICES="/dev/ttyS0"
GPSD_OPTIONS="-n"
Terminal window
sudo systemctl restart gpsd
gpsmon
Terminal window
wget https://files.waveshare.com/wiki/LC29H(XX)-GPS-RTK-HAT/Lc29h_gps_rtk_hat_code.zip
unzip Lc29h_gps_rtk_hat_code.zip
Terminal window
cd lc29h_gps_rtk_hat_code/python/rtk_rover/
python3 main.py -u psi_user -p psi landsd-gncaster.realtime.data.gov.hk 2101 T430_32
Terminal window
cd lc29h_gps_rtk_hat_code/python/coordinate_converter/
python3 main.py

Prints positioning results in WGS84, GCJ02, and BD09 every 10 seconds.

Permission denied on serial port:

Terminal window
sudo usermod -aG dialout $USER
# Log out and back in

No data from module:

  • Check jumper position matches your connection method
  • Verify baud rate (factory default 9600, HAT sample code sets 115200)
  • Try lc29h --port /dev/ttyS0 --baud 9600 info if 115200 doesn’t respond

Wrong serial device:

  • Pi 4B uses /dev/ttyS0 (mini UART) for GPIO serial
  • Pi 5 uses /dev/ttyAMA0 (PL011 UART) for GPIO serial
  • USB mode always uses /dev/ttyUSB0