GNSS ZED-F9P Corrected GPS data output and RTK correction with NTRIP client in Arduino

Hello,

I’ve got a Sparkfun GNSS ZED-F9P with an ESP32 MicroMod and a GNSS Antenna. My goal is to get corrected GPS positions and send them via rosserial to the other parts of my robot system , which is using Ubuntu and because of that all this should be done by Arduino code.

But I’m struggling with one of the first steps in my project: Getting my Arduino code to connect to the RTK correction data stream and then output the corrected data.

I’ve got a source for a correction data stream and when I run Example10_GetHighPrecisionPositionAndAccuracy and switch on the NTRIP Client in the Windows u-center app, the Arduino output immediately drops from 0.3m accuracy to 0.014m accuracy. I assume it is reusing the last received correction data, because when I switch off the NTRIP Client, the accuracy will slowly rise over the next minutes to around 0.3m again, which is probably too good to not be corrected at all. Also the RTK led is also constantly blue without any blinking.

Since the robot system is using Ubuntu, the Arduino code will have to receive the corrected GPS data and replace the NTRIP Client in the Windows app as well. I didn’t find example code doing exactly that in the ZED-F9P examples, so I tried to combine the Example15_NTRIPClient and the Example10_GetHighPrecisionPositionAndAccuracy together, but that only gives me the 0.3m accuracy under the same circumstances, although it says “Caster responded with: ICY 200 OK Connected to opencaster.nls.fi”.

I’m not very experienced in Arduino and have now spent several days combing through the documentation and guides, so I would greatly appreciate any input on how to get the RTK correction running and then output that corrected data both with Arduino.

My Example15_NTRIPClient / Example10_GetHighPrecisionPositionAndAccuracy code is attached.

Best regards,

c_s_t

With_NTRIP_GetHighPrecisionPositionAndAccuracy.zip (4.61 KB)

Hi,

I don’t have time to go through your code in detail, but it looks like you open the connection to the caster in beginClient but then let the connection close - as soon as there is no data available? Once the code exits beginClient and enters the loop, you are not using the WiFiClient any more.

I think you need to go back and look again at Example15. In particular the way beginClient is called from inside the loop and how it keeps the connection open until the user presses a key (sends a serial character). You need to do something to replicate the “while (Serial.available() == 0)” to maintain the connection.

I hope this helps,

Paul

Thank you! Indeed, that was the issue, it works now! Your answer also made me realize that my correction source was never sending correction data after a successful connection attempt, although the same credentials worked in the u-center app and gave me 1.5cm accuracy there. I had to use another provider.