Raspberry Pi Setup
UART Setup (Recommended)
Section titled “UART Setup (Recommended)”-
Set jumper to position B (UART mode)
-
Enable serial port
Terminal window sudo raspi-config# Interface Options → Serial Port → Yes# Interface Options → I2C → Yes (optional) -
Connect antenna — attach the L1/L5 antenna to the IPEX socket and place with clear sky view
-
Verify the serial device
Terminal window ls -la /dev/ttyS0Terminal window ls -la /dev/ttyAMA0 -
Install lc29h CLI
Terminal window uv tool install lc29h -
Test communication
Terminal window lc29h --port /dev/ttyS0 infoTerminal window lc29h --port /dev/ttyAMA0 info
USB Setup (Alternative)
Section titled “USB Setup (Alternative)”-
Set jumper to position A (USB mode)
-
Connect via USB-C cable
-
The CP210x driver is included in modern Linux kernels
Terminal window ls -la /dev/ttyUSB0lc29h --port /dev/ttyUSB0 info
gpsd Configuration
Section titled “gpsd Configuration”For applications using gpsd:
sudo apt-get updatesudo apt-get install gpsd gpsd-clientsEdit /etc/default/gpsd:
USBAUTO="false"DEVICES="/dev/ttyS0"GPSD_OPTIONS="-n"sudo systemctl restart gpsdgpsmonWaveshare Demo Code
Section titled “Waveshare Demo Code”wget https://files.waveshare.com/wiki/LC29H(XX)-GPS-RTK-HAT/Lc29h_gps_rtk_hat_code.zipunzip Lc29h_gps_rtk_hat_code.zipRTK Rover Test
Section titled “RTK Rover Test”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_32Coordinate Converter
Section titled “Coordinate Converter”cd lc29h_gps_rtk_hat_code/python/coordinate_converter/python3 main.pyPrints positioning results in WGS84, GCJ02, and BD09 every 10 seconds.
Troubleshooting
Section titled “Troubleshooting”Permission denied on serial port:
sudo usermod -aG dialout $USER# Log out and back inNo 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 infoif 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