-
Notifications
You must be signed in to change notification settings - Fork 711
Add TCP Connection to DGPS #737
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
base: master
Are you sure you want to change the base?
Conversation
5008d02
to
d166d54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given you are now parsing the data, maybe add status like for ntrip module where it shows counts of each pkt type?
MAVProxy/modules/mavproxy_DGPS.py
Outdated
except: | ||
print ("ERROR: Failed to connect to RTCM base over TCP, retrying in 2.5s") | ||
self.waiting = True | ||
threading.Timer(2.5,self.connect_tcp_rtcm_base(ip, port)).start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want a timer here, instead use the idle task to check for a pending connection. See the start_pending code in the mavproxy_ntrip module
MAVProxy/modules/mavproxy_DGPS.py
Outdated
try: | ||
data = self.port.recv(1024) # Attempt to read up to 1024 bytes. | ||
data = self.port.recv(1) # Attempt to read up to 1024 bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment doesn't match code, and why read one byte at a time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am copying what is done in the NTRIP library:
MAVProxy/MAVProxy/modules/lib/ntrip.py
Line 174 in 041dda2
data = self.socket.recv(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because the function
MAVProxy/MAVProxy/modules/lib/rtcm3.py
Line 60 in 041dda2
def read(self, byte): |
takes one byte at a time.
I have already added the status count for each packet, So that can be seen with the status command. |
@tridge This seems to be working pretty good now, let me know if you want me to squash the three commits into one, but I think its ready to merge. |
4b34707
to
ad18063
Compare
Squashed |
please test with both py2 and py3 |
do you have a build that I could test/run? Really interested in this feature. we have a Emlid Reach M2 we would like to automate RTK corrections with via Rpi, but having troubles rebasing this branch on master and actually testing functionality |
Emlid Reach GPS can only publish the RTCM corrections using TCP or Serial connections. This adds the ability to select between UDP and TCP and allows configuration of the IP, PORT, CONNTYPE. It adds four commands (following the ntrip modules model):
start
stop
status
set
by default it is configure the same as it was before (UDP, 127.0.0.1, 13320)
I don't have a GPS that publishes corrections via UDP to test, but it should work. I did test the TCP connection
based on:
https://github.com/antonvh/MAVProxy/tree/reach_inject
by @antonvh