Example Code for Raspberry Pi-UART Tutorial

Read GNSS data from the GNSS-RTK kit using the UART protocol with Raspberry Pi.

Hardware Preparation

Software Preparation

Wiring Diagram

Other Preparation Work

  • Switch to UART Mode by modifying the get_gnss.py file.
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?

TOP