ZED-F9P/RaspberryPi RTK GPS Rover setup

I would like to use high resolution gps for autonomous scale car (rc) racing using the DonkeyCar framework (https://www.donkeycar.com). I have a SparkFun GPS-RTK-SMA Breakout - ZED-F9P (Qwiic) and an L1/L2 active antenna. I am hoping I can achieve high precision gps coordinates without needing to purchase a second F9P board to use as a base station. My RC car has a RaspberryPi with Wifi connectivity, so it is capable of connecting to an NTRIP server (we have good wifi at the track); I have several UNAVCO stations near me. I can get a fix using my Windows PC and u-center sofware, so I know my UNAVCO credentials are working. I would like to use RTKLIB console tools running on the RaspberryPi to take the NTRIP feed from UNAVCO and create high precision NMEA which I would consume using python code running on the RaspberryPi, reading from a serial port. I can access the Sparkfun F9P using USB and/or serial uarts on the gpio pins. Hardware hookup is no problem, but I have no idea how to setup the RTKLIB console apps; the hookup guide mentions RTKLIB but does not give any detail. The RTKLIB documentation is not helpful. This forum discussion https://forum.sparkfun.com/viewtopic.ph … IB#p203362 provides a few hints, but still vague and the configuration file link can no longer be accessed. This forum discussion is very close to what I want to do, but the answer is so vague it is not useful https://forum.sparkfun.com/viewtopic.ph … IB#p232824. Any help or experience you could provide would be greatly appreciated. Thank you in advance.

The link worked for me https://pastebin.com/sk2t23ba - try that? Let me know if it still doesn’t work and I can copy/paste the whole thing

Yes, that worked. I’m not sure why it was not working yesterday; it was actually giving a 503, so probably an issue with pastebin. Thanks.

So any advice o how to setup a rover with just the NTRIP server?

Here is what I have done:

Connections

FP9-UART2 is the corrections port on the Sparkfun GPS-RTK-SMA Breakout ZED-F9P

  • This port is setup to input UBX, NMEA and RCTM3

  • This port is setup to output RCTM3

FP9-USB port

  • This port is setup to input and output UBX, NMEA and RTCM3

GPIO is the 40 GPIO bus on the SBC (RaspberryPi or Jetson Nano)

  • Board pin 6 is GND

  • Board pin 8 is TX for UART-2, which is serial port /dev/ttyTHS1

  • Board pin 10 is RX for UART-2


RPi FP9 

------------------------

Pin-6 <---> GND

Pin-8 <---> UART2-RX

Pin-10 <---> UART2-TX

USB <---> USB

Software setup

  • Use u-center to set the FP9 UART-2 to 230400 baud

  • Set the RPi/Jetson Nano serial port to 230400 baud

sudo stty -F /dev/ttyTHS1 clocal raw speed 230400

  • Run str2str on the RPi to get corrections from UNAVCO and send them to the FP9 via UART2

./str2str -in ntrip://USERNAME:PASSWORD[@rtgpsout.unavco.org](mailto:<EMAIL email="9tK87DEb@rtgpsout.unavco.org">9tK87DEb@rtgpsout.unavco.org</EMAIL>):2101/P200_RTCM3 -out serial://ttyTHS1:230800:8:n:1

  • Read NMEA messages on USB serial port, /dev/ttyACM0

With this setup I never get to float mode on the FP9; the led says solidly lit. Perhaps the pin connections in this setup are not correct or I need to change the messages that go in and out on F9P UART-2.

If I change this up a bit and stream the corrections to the F9P USB serial port instead of UART-2, I can float, but it never goes to fixed.

As mention before, I can quickly get to float then fixed on my Windows PC if I connect the F9P to USB and I run u-center and setup the NTrip client settings to use UNAVCO. This is with the same antenna in the same exact position.

Am I using str2str correctly? Is there any particular messages or message types I have to setup? Is there any additional settings, like base position, that I have to pass? Does the stream between UNAVCO and F9P need to be bidirectional?

There is a typo in the str2str command, it should be:

  • Run str2str on the RPi to get corrections from UNAVCO and send them to the FP9 via UART2

./str2str -in ntrip://USERNAME:<EMAIL email="PASSWORD@rtgpsout.unavco.org">PASSWORD@rtgpsout.unavco.org</EMAIL>:2101/P200_RTCM3 -out serial://ttyTHS1:230800:8:n:1

The mailto crap was not supposed to be there.

Update: I got a fix on the Jetson Nano by streaming RTCM3 to the USB serial port and reading the NMEA from UART2. In 100 samples I got range of 2.5 cm. So there is some issue with how UART2 is setup on the F9P module; if I use that to send the RTCM3 to the module then I never even get to float; but I can read NMEA from it fine. Well, I have a solution for now; I can do some tests later to figure out the UART2/RTCM3 issues. This is what worked;

./str2str -in ntrip://USERNAME:PASSWORD@rtgpsout.unavco.org:2101/P200_RTCM3 -out serial://ttyACM0:230400:8:n:1

Then read NMEA messages from /dev/ttyTHS1

See this discussion in the RTKLIB issues https://github.com/tomojitakasu/RTKLIB/issues/659

Hi Ezward,

You might want to check what protocols are enabled on UART2, In and Out. They default is: In: RTCM3 + SPARTN; Out: RTCM3 (only). (See attached image.)

If you are outputting NMEA on UART2, check that you still have RTCM3 enabled for input and haven’t accidentally disabled it.

Best wishes,

Paul

Screenshot 2022-05-11 204408.jpg

Basically I found that the serial port exposed on the jetson nano GPIO bus is unreliable with input from str2str. Same issue on a RaspberryPi. However, I did get it to work reliably after mapping another hardware UART (5 available on Rpi-4) to the GPIO bus and using that as the input. See here https://github.com/tomojitakasu/RTKLIB/issues/659