Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntrip: Added support for NTRIP Rev1 servers #1440

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

jheising
Copy link
Contributor

I ran into an issue getting the popular RTK base station system, rtkbase working with MAVProxy. Doing some deeper analysis, it looks like rtkbase uses the str2str utility provided in the popular RTKLIB project.

What I found is that the str2str NTRIP caster returns a response that looks like this:

ICY 200 OK
(rtcm-bytes)

Notice how the server response does not include any headers and just goes straight to the response body without a blank line? Because of this, the ntrip.py library will never find a blank line, and self.found_header will never equal True which means the ntrip library will always be "stuck" waiting for headers.

At first I debated whether or not this library should be updated in order to fix the "bad behavior" of an NTRIP server. But after a bit of research I found that according to this, it is actually valid and expected behavior under the NTRIP Rev1 protocol. So in a sense we're just adding support for NTRIP Rev1 with this small update.

Potential issues:
I think it is also possible for NTRIP Rev1 to optionally contain headers, so there might be a case where if the headers are over 4096 characters in length that this might falsely think the headers are finished and parsed, when they aren't. But it's not clear to me that this would cause anything bad to happen since the headers are not used in any capacity.

@yuri-rage
Copy link

This is potentially worth merging, but please squash your commits rather than including 3 that have the exact same message and only modify one file.

@jheising
Copy link
Contributor Author

jheising commented Aug 16, 2024

Apologies. I just assumed you'd squash merge into main (that's what I normally do). I will see if I can squash on my side first.

@jheising
Copy link
Contributor Author

jheising commented Aug 16, 2024

Okay squashed on my side now. Thanks again for considering a merge!

@stephendade
Copy link
Contributor

stephendade commented Aug 17, 2024

Tested with ntrip.data.gnss.ga.gov.au - no issues there. Happy to merge once the CI's green

EDIT: Could you change the commit message to "ntrip: Added support for NTRIP Rev1 servers"? We usually prefix with the subsystem that's been changed.

@jheising jheising changed the title Adding support for NTRIP Rev1 Servers ntrip: Added support for NTRIP Rev1 servers Aug 17, 2024
@jheising
Copy link
Contributor Author

Okay @stephendade, the commit has been amended. Thanks!

@stephendade
Copy link
Contributor

Thanks! merging

@stephendade stephendade merged commit 5e5f3af into ArduPilot:master Aug 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants