I am requesting via NTRIP my correction values to a server. My server point is https://igs-ip.net/.
After fetching and sending it over a broker which distributes it to my receivers. At the receiver side, I do send to and get at UART1 my bytes, but in the message view UBX->MON->MSGPP
it only shows that all bytes are UNKOWN.
This is my code to fetch the correction data. I do get the correct response for my credentials.
import base64
import socket
import time
from pyrtcm import RTCMReader
mqtt_client: MQTT = MQTT(cfg.ntrip.mqtt_config, "NTRIP_CLIENT")
mqtt_client.open()
dummyNMEA = "$GPGGA,143741.356,7839.493,S,07627.626,W,0,00,,,M,,M,,*45\r\n"
username = cfg.ntrip.get("caster_user")
password = cfg.ntrip.get("caster_password")
port = cfg.ntrip.get("caster_port")
pwd = base64.b64encode("{}:{}".format(username, password).encode("ascii"))
pwd = pwd.decode("ascii")
print("Header sending... \n")
header = (
f"GET /{cfg.ntrip.get('mountpoint')} HTTP/1.1\r\n"
+ f"Host {cfg.ntrip.get('caster_url')}\r\n"
+ "Ntrip-Version: Ntrip/2.0\r\n"
+ "User-Agent: NTRIP gopots/0.0\r\n"
+ "Connection: close\r\n"
+ "Authorization: Basic {}\r\n\r\n".format(pwd)
)
print(header)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((cfg.ntrip.get("caster_url"), int(port)))
s.send(header.encode("ascii"))
print("Waiting answer...\n")
response = s.recv(1024).decode("ascii")
print(response)
while True:
try:
s.send(dummyNMEA.encode("ascii"))
data = s.recv(1024)
print(data)
mqtt_client.send(data)
time.sleep(1)
except Exception as e:
print(e)
continue
s.close()
At the other side, I just fetch the topic and pass through the data. By using the u-center build in NTRIP Client it works flawless.