Example Code for Raspberry Pi-UART Tutorial
Read GNSS data from the GNSS-RTK kit using the UART protocol with Raspberry Pi.
Hardware Preparation
- Raspberry Pi 4B × 1
- DFR0566 Raspberry Pi 4B/3B+ IO Expansion Board × 1
- GNSS-RTK High-Precision Positioning Kit × 1
Software Preparation
Wiring Diagram

Other Preparation Work
- Switch to UART Mode by modifying the
get_gnss.pyfile.
cd ~
cd Desktop
mkdir df
cd df
git clone https://github.com/DFRobot/DFRobot_RTK_LoRa
cd DFRobot_RTK_LoRa/python/raspberrypi/examples
sudo vi get_gnss.py ##Select the program to run and modify it to UART mode
Modify the code to use UART:

- Set hardware DIP switch to UART and reboot.
Sample Code
sudo python3 get_gnss.py
Result
The script outputs GNSS data (latitude, longitude, altitude, etc.) to the terminal.
Was this article helpful?
