How to use RTK without a desktop app?

I’m using a ZED-F9P.

Below is the Python script I’ve made for printing the Latitude and Longitude without correction data, but now I’d like to try and get more accurate with RTK.

I’ve got familiar with desktop applications for applying RTCM like PyGPSClient (https://github.com/semuconsulting/PyGPSClient) and u-center but I’d like to be able to achieve RTK fix within a python script.

I say this because my goal is to achieve RTK on an Arduino or similar portable device, then send that to the cloud where I can compare it to an identical device in another location (i.e. get the distance between the two).

I thought perhaps I could use parts of the source code for PyGPSClient? I’m not sure where to start. Any advice would be appreciated. Thanks!

import serial

gps = serial.Serial('com5', baudrate=9600)

while True:
    ser_bytes = gps.readline()
    decoded_bytes = ser_bytes.decode("utf-8")
    data = decoded_bytes.split(",")
    if data[0] == '$GNRMC':
        lat_nmea = (data[3],data[4])
        lat_degrees = float(lat_nmea[0][0:2])
        lat_minutes = float(lat_nmea[0][2:])
        lat = lat_degrees + (lat_minutes/60)
        lon_nmea = (data[5],data[6])
        lon_degrees = float(lon_nmea[0][:3])
        lon_minutes = float(lon_nmea[0][3:])
        lon = lon_degrees + (lon_minutes/60)
        if lat_nmea[1] == 'S':
            lat = -lat
        if lon_nmea[1] == 'W':
            lon = -lon
        print("%0.8f" %lat,',' "%0.8f" %lon)

Hi @UnsolicitedEmails,

We have an NTRIP RTK example for the ZED-F9P in our u-blox GNSS Arduino Library:

https://github.com/sparkfun/SparkFun_u- … Client.ino

The full list of ZED-specific examples is here:

https://github.com/sparkfun/SparkFun_u- … es/ZED-F9P

Best wishes,

Paul

Wow, thanks! I’ll check Sparkfun for examples first, next time :slight_smile:

I’m using an ESP32 Thing Plus connected to a ZED-F9P via Qwiic cable, exactly as the //comments say, but I’m getting this message:

“u-blox GPS not detected at default I2C address. Please check wiring. Freezing.”

Any ideas? Perhaps I need to configure the ZED-F9P in some way?

Hi,

Please check you are using the correct Arduino board definition for the Thing Plus (vs. Thing Plus C).

Also, please check your Espressif ESP32 board definitions are up to date. 2.0.5 is the latest. There was an issue with a previous version that stopped Qwiic (I2C) from working.

You may also need to factory-reset your GNSS board if you have had it configured differently for Python. Connect with u-center via USB; open the View \ Messages View; navigate to UBX-CFG-CFG; click the “Revert to default configuration” radio button; click “Send” at the bottom of the window; click “Save current configuration” then click “Send”. That will ensure UBX is enabled on the I2C port.

You can also reset using PyGPSClient. Connect via USB and open the UBX Configuration window. There are preset configuration commands for RESTORE_FACTORY_DEFAULTS and SAVE_CURRENT_CONFIGURATION.

Thanks for the link to PyGPSClient BTW. It’s a really nice piece of work…

I hope this gets you going,

Paul

Thanks Paul,

Working fine now. Really appreciate your help.

Until next time,

Jacob