Replies: 3 comments 1 reply
-
Hi @leoheck I'm going to need a little more information. You mention 'RTCM parser' and 'client/socket' - are you referring to an NTRIP client of some kind? If you can provide a complete copy of the code/command line you're running and samples of any output or error traceback, I may be able to advise. |
Beta Was this translation helpful? Give feedback.
-
Hi @semuadmin. I apologize for the lack of details. At that time, I didn't have the time or a clear understanding of my issue to explain it better. I am using the following socket configuration. while true:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect_ex((self.caster, port))
s.settimeout(5)
rtr = RTCMReader(s, validate=1, quitonerror=0, bufsize=4096)
for raw_data, parsed_data in rtr:
# ... do some stuff
s.shutdown(socket.SHUT_RDWR)
s.close() I am currently monitoring 40 casters with this client. I want to keep my client running forever. However, the connection does not remain running for much time. Usually, it works 30min to 1h30min. I don't know why yet. But it looks like my GNSS Receivers, NTRIP Server and the Caster itself are working fine most of the time. However, my client continues experiencing the connection being terminated very often. The issue does not seem to be my local network since I've tested it on other networks as well. Then I added a timeout since it looks like that sometimes the socket is empty and the connection stops receiving data. So I am investigating if this is related to the setup of my client. Maybe I should reset or clean something to reconnect to the Caster. By any chance, do you have any possible idea what could I try to improve my use case? |
Beta Was this translation helpful? Give feedback.
-
Hi @leoheck , The socket handling example in the README, which you've adopted in your code sample, is only intended to provide a very simple illustration of the library's capabilities. Production socket handlers would typically be more complicated and may include, for example, 'keep-alive' or 'auto-reconnect' provisions. Such functionality is outside the scope of the pyrtcm parsing library itself - you'd need to examine the Python socket documentation. You may want to take a look at GNSSNTRIPClient implementation in pygnssutils, though this is also only really intended for testing and diagnostic purposes. Without seeing detailed connection logs, I can't really advise why the socket connection would be dropping after a certain period, but there may be any number of reasons why a given NTRIP caster would stop sending data - you'd need to investigate this with the relevant casters. What's your ultimate objective here? What are you looking to achieve by monitoring 40 NTRIP casters for hours at a time? PS by the way, when you using a context manager ( |
Beta Was this translation helpful? Give feedback.
-
Hi, I am using the RTCM parser to make a simple command line client. Using it for some months I could see the client/socket disconnects very often. Is this a normal thing that we should expect or I may have issues in the connection? What I doing is to reconnect the client as soon as it ends/break to continue receiving data. But I feel it should work longer.
Beta Was this translation helpful? Give feedback.
All reactions