RTK over NTRIP mit dem Raspberry Pi

EinEinfach

Well-known member
Hallo zusammen,

da ich einen Raspberry Pi sowieso mitspazieren fahre und dieser noch lange nicht an seinen Grenzen ist, dachte ich mir welche Aufgabe könnte er noch so mit übernehmen.

Mich stört schon seit Anfang an, dass mein Rover drei IP Adressen nutzt. 1. ESP32 2. Raspberry Pi 3. Xbee ESP32.

Warum nicht alles über Raspberry Pi laufen zu lassen, während für Punkt 1 ich noch einige Zeit brauche, habe ich den xBee ESP32 mittlerweile rausgeschmissen. Und es ging super einfach. Somit hier eine kleine Einleitung wie das geht, einerseits für euch zum nachmachen, andererseits für mich zum Nachlesen, wenn ich es wieder brauche.

1. ESP32 xBee von der UBlox Platine entfernen, denn brauchen wir nicht mehr
2. Raspberry Pi USB Port mit dem USB Port der UBblox Platine verbinden (wir brauchen einen USB A zu USB Micro Kabel, bitte den usb ublox Anschluss verwenden nicht den xBee.
3. Raspberry Pi auf den neusten Stand bringen:
Code:
sudo apt update
sudo apt upgrade
4. Ins Homeverzeichnis wechseln
Code:
cd
5. Einen neuen Ordner anlegen und dahin wechseln
Code:
mkdir rtklib
cd rtklib
6. Mit git folgende Repository clonen:
Code:
git clone https://github.com/rtklibexplorer/RTKLIB.git
7. Ins gcc Verzeichnis wechseln und Software bauen
Code:
cd RTKLIB/app/consapp/str2str/gcc
Code:
make
8. Anwendung in den usr Ordner kopieren, damit wir es von überall starten können
Code:
sudo cp str2str /usr/local/bin/str2str
9. Testen ob die Daten von der ublox Platine kommen
Code:
str2str -in serial://ttyACM0
Achtung der Port kann bei euch anders heissen. Wenn ganz viel Buchstabensalat kommt, dann ist alles bis jetzt richtig.
10. Nun müssen wir nur noch unsere NTRIP Daten an die Ublox Platine schieben, damit diese RTK generieren kann. Das machen wir mit:
Code:
str2str -in ntrip://user:passwort@www.openservice-sapos.niedersachsen.de:2101/VRS_3_4G_NI -p 5X.XXXXX 1X.XXXXX XX -n 1 -out serial://ttyACM0
Hier für SAPOS Niedersachsen. User und passwort durch eure Daten ersetzen. Port und Mountpoint natürlich auch anpassen. 5X.XXX und 1X.XXX eure Referenzposition, Ihr könnt die aus der Sunray App nehmen, danach XX ist die Höhe über dem Meeresspiegel, ich denke Ihr wisst das für euren Standort.

Befehl absetzen und sich über Fix freuen! Keine Anpassunngen im UCenter oder in der Sunray FW notwendig.

Es gibt noch die Möglichkeit, eigene Position aus den aktuellen GPS Daten extrahieren und an den NTRIP Provider weiter zu geben, bei mir führte der Befehl ins timeout, trotzdem vollständigkeitshalber würde dieser so heissen:
Code:
str2str -in ntrip://user:passwort@www.openservice-sapos.niedersachsen.de:2101/VRS_3_4G_NI -b 1 -out serial://ttyACM0

Das ganze muss natürlich als daemon Dienst eingerichtet werden, damit die Verbindung mit jedem hochfahren des Raspberry mitgestartet werden kann. Hierzu gibt es genug Anleitungen im internet

Viel Spaß beim Nachbauen.

P.S.: Ich habe einen ESP32 XBee abzugeben :)
 
coole Sache. Wie stellst du denn unterbrechungsfreies WLAN mit dem Raspi sicher? Hast du da einen leistungsfähigen WLAN-Stick mit externer Antenne verbaut?
 
Ja, was heißt ein Leistungsfähiger Stick, das billigste vom billigsten aus der Bucht mit einem externen Antennenanschluss, aber immer noch besser als eingeätzte Leiterbahn auf dem XBee. Gefüllt ist der Empfang vom Raspberry auch besser geworden seit dem der Xbee raus ist. Wahrscheinlich haben die sich gegenseitig gestört… ist aber nur gefüllt, ohne nachgemessen zu haben.
 
ok, wenn der XBee keine externe Antenne hat, ist der Fall klar. Die long-range-Dinger haben ja alle eine externe Antenne und damit hast du super Empfang, was aus meiner Sicht für RTK auch extrem wichtig ist.
 
Ich hoffe, meine Frage passt hier hin: Wie RTK GPS Daten nach Sunray senden?

Ich habe 2 GPS Receiver (beide ohne USB).
Der eine ist als Rover konfiguriert, der andere als Base.
Die Base sendet nun via SIK/LoRa die GPS-Korrekturdaten an das Rover-Modul.
Das Rover-Modul generiert RTK und sendet dies via NMEA Protokoll über UART-TX Pin an meinen PI5.
Der PI5 empfängt die NMEA Daten, das kann ich mit minicom monitoren.
In der config.h habe ich GPS_SKYTRAQ (Zeile ~342) aktiviert und dem GPS (Zeile ~514) "/dev/ttyAMA3" zugewiesen (den UART-Port, der die Daten vom Rover-Modul empfängt).
An dem Konstrukt muss irgendetws falsch sein, denn Sunray empfängt keine GPS Daten. 😭

Ich hoffe ihr könnt mir weiterhelfen.

(Ich nutze das Sunray Repo und das Platine-Schema mit Pico von @EinEinfach)

--english version starts here--

I hope my question fits here: How do I send RTK GPS data to Sunray?

I have two GPS receivers (both without USB).
One is configured as rover, the other one as base.
The base now sends the GPS correction data to the rover module via SIK/LoRa.
The rover module generates RTK and sends it to my PI5 via NMEA protocol using UART-TX pin.
The PI5 receives the NMEA data, which I can monitor with minicom.
In config.h, I enabled GPS_SKYTRAQ (line ~342) and assigned the GPS (line ~512) to "/dev/ttyAMA3" (the UART port that receives the data from the rover module).
There must be something wrong with my configuration because Sunray isn't receiving any GPS data. 😭

Hope you can help to get this running.

(I'm using the Sunray repo and the board schematic with Pico from @EinEinfach)
 
Maybe you can take a look at skytrack.cpp line 237 i have not the same data that initial code.
Also line 15 you can activate the debug.
and line 243 / 244 uncomment.

You need to add
#include "../../config.h"
at the beginning to use console.


1759589909798.png


I have upload the code into my git repo ,it's here.
Code is made for Teensy4.1 with LC29HEA Gps module and use NMEA protocol.
It's here
BRANCH LC29HEA and not main
 
If you uncomment line 243 and 244 you can see nmea message into console.
I fail to use LORA to send correction data from Base to Rover, Can you explain how did you do this over SIK/LORA and share the code ??
 
Unfortunately, after I have uncommented line 243 and 244 and compiled, there is no NMEA message at the console.
debug = true & "../../config.h" was already there

I am using these EOL SiK Telemetry Radio V3 - no code needed.
They are connected to UART.
You still can get them here or here.
 
Zuletzt bearbeitet:
Wer hat denn noch (die Sunray Version von @EinEinfach und) eine GPS-Modul über UART (nicht USB) angeschlossen und kann mir bei meinem Problem helfen, dass die GPS Messages nicht in Sunray ankommen?
 
Hi @bernard,
I managed to get the messages by uncommenting some other lines below 243/244 starting with "console.print ..." under "-- NMEA parser callback --".
Can you work with this and tell me what is going wrong/what I have to do to get GPS working?

These are the messages, received by UART3 periodically (I know there is no "RTK fix" etc., because the GPS antenna is in the house for testing and not outside)
$GNGGA,213340.000,XXXX.0342200,N,0YYYY.5652340,E,1,53,0.46,347.981,M,47.747,M,,*7C
$GNGLL,XXXX.0342200,N,YYYY.5652340,E,213340.000,A,A*4A
$GNGSA,A,3,29,26,31,18,28,25,05,16,21,04,,,0.80,0.46,0.65,1*04
$GNGSA,A,3,88,78,79,81,87,77,,,,,,,0.80,0.46,0.65,2*0C
$GNGSA,A,3,31,23,26,33,13,05,09,21,,,,,0.80,0.46,0.65,3*00
$GNGSA,A,3,37,43,23,11,08,13,38,34,27,28,,,0.80,0.46,0.65,4*06
$GPGSV,4,1,13,29,62,065,50,26,53,293,38,31,51,254,30,18,43,174,38,1*6A
$GPGSV,4,2,13,28,41,211,27,25,26,123,32,49,25,140,26,05,20,077,31,1*64
$GPGSV,4,3,13,16,15,296,20,21,14,044,16,04,11,312,29,09,04,348,17,1*67
$GPGSV,4,4,13,11,02,034,18,1*5A
$GPGSV,2,1,06,26,53,293,35,18,43,174,32,28,41,211,16,25,26,123,31,8*62
$GPGSV,2,2,06,21,14,044,19,04,11,312,20,8*63
$GLGSV,2,1,07,88,83,117,48,78,74,145,47,79,48,317,34,81,32,210,25,1*7F
$GLGSV,2,2,07,87,23,037,36,77,15,139,34,71,09,021,34,1*43
$GAGSV,3,1,10,31,63,295,31,23,62,111,49,26,55,092,46,33,38,169,37,7*7E
$GAGSV,3,2,10,13,21,039,31,05,14,315,30,09,13,264,18,21,10,112,24,7*7A
$GAGSV,3,3,10,24,10,293,21,06,06,242,20,7*78
$GAGSV,2,1,07,31,63,295,37,23,62,111,42,26,55,092,43,33,38,169,38,1*78
$GAGSV,2,2,07,13,21,039,29,05,14,315,24,21,10,112,26,1*47
$GBGSV,5,1,17,37,65,273,25,31,61,070,19,43,61,070,49,28,51,213,,1*7C
$GBGSV,5,2,17,23,48,163,46,11,34,054,37,08,26,071,25,13,25,084,33,1*7A
$GBGSV,5,3,17,38,25,056,31,57,21,053,,46,16,312,,34,11,053,26,1*7C
$GBGSV,5,4,17,27,10,224,28,22,04,000,,25,03,145,26,21,02,046,14,1*79
$GBGSV,5,5,17,10,02,078,,1*4C
$GBGSV,2,1,08,37,65,273,38,43,61,070,45,28,51,213,31,23,48,163,41,4*74
$GBGSV,2,2,08,38,25,056,33,34,11,053,22,27,10,224,23,25,03,145,27,4*75
$GNRMC,213340.000,A,5055.0342200,N,00759.5652340,E,0.00,15.88,061025,,,A,V*33
$GNVTG,15.88,T,,M,0.00,N,0.00,K,A*17
$GNZDA,213340.000,06,10,2025,,*4D
$PAIRMSG,90,213340.000,1*5E
$PAIRMSG,91,213340.000,1,0*43

.. and this is the first message interpreted by Sunray
Time:21:36:29.00
Latitude:XXXX
Longitude:YYYY.99275390,YYYY.99275390
Altitude:395.73
Qualit Mode:1
Number Of Sv:50
HDOP:0.48
PDOP:0.83
VDOP:0.68
Navigation Mode:2
Date:2025/10/6
Course:15.88

.. and these are the folowing ones
Time:21:36:31.00
Altitude:395.73
PDOP:0.83
VDOP:0.68
 
what I have to do to get GPS working?
What do you mean by GPS working ?
Sunray can only work on float or fix rtk , so without fix or float sunray App show you a GPS invalid and mower can only move in manual.

Also are you sure that you are in Position Mode ABSOLUTE and have set your base location ?

1759813815676.png

Now into main menu you need to see GPS location .
Num sat share with base is 0 and delay between 2 transmission are not valid , but it's not an issue.
Its' Quectel LC29 HEA GPS , Mower is inside garage , so i have GPS Float after 90 seconds and Fix is OK only outdoor


1759813885404.png

Try to reduce the message number, Only GNGGA,GNRMC,GNGLL are used in my case.
 
I send them via PM
Can you check again the position relative or absolute .
You need absolute and enter the base location
Num of satellite at 50 show that Uart data are coming
 
Oben