open_mower_ros icon indicating copy to clipboard operation
open_mower_ros copied to clipboard

ntrip reconnect inverval ingnored in some cases

Open fallingcats opened this issue 7 months ago • 3 comments

The ntrip client just got me banned again from rtk2go by reconnecting multiple times per second and not backing off (reconnect inverval is set to 40s)

Here's a bit of the log

[INFO] [1746981469.049015]: Connected to http://3.143.243.81:2101/AUT_VIE_27
[ERROR] [1746981469.057456]: Error while reading 1024 bytes from socket
[ERROR] [1746981469.067977]: Socket appears to be closed. Reconnecting
[INFO] [1746981469.581286]: Connected to http://3.143.243.81:2101/AUT_VIE_27
[ERROR] [1746981469.589691]: Error while reading 1024 bytes from socket
[ERROR] [1746981469.600217]: Socket appears to be closed. Reconnecting
[INFO] [1746981469.864740]: Connected to http://3.143.243.81:2101/AUT_VIE_27
[ERROR] [1746981469.870105]: Error while reading 1024 bytes from socket
[ERROR] [1746981469.875782]: Socket appears to be closed. Reconnecting
[INFO] [1746981470.520418]: Connected to http://3.143.243.81:2101/AUT_VIE_27
[ERROR] [1746981470.528105]: Error while reading 1024 bytes from socket
[ERROR] [1746981470.538038]: Socket appears to be closed. Reconnecting
[INFO] [1746981470.800705]: Connected to http://3.143.243.81:2101/AUT_VIE_27
[ERROR] [1746981470.809121]: Error while reading 1024 bytes from socket
[ERROR] [1746981470.817254]: Socket appears to be closed. Reconnecting
[INFO] [1746981471.078687]: Connected to http://3.143.243.81:2101/AUT_VIE_27
[ERROR] [1746981471.086935]: Error while reading 1024 bytes from socket
[ERROR] [1746981471.095906]: Socket appears to be closed. Reconnecting

Edit: Sorry, forgot some important details

I'm on the v1 releases-edge branch, sha-9f65b12 to be exact

fallingcats avatar May 11 '25 16:05 fallingcats

Still does it with current releases-edge

fallingcats avatar May 11 '25 17:05 fallingcats

From a quick look, it seems that it's an upstream issue. The reconnect_attempt_wait_seconds are only referenced when the connection attempt failed - your logs show that this part was successful. When the "Socket appears to be closed. Reconnecting" error occurs, a reconnect is attempted immediately, and as it seems unconditionally: https://github.com/LORD-MicroStrain/ntrip_client/blob/ca4de0dad0fae12fa6d8e9856a993eec5007ce89/src/ntrip_client/ntrip_client.py#L217-L218

rovo89 avatar May 11 '25 20:05 rovo89

But it will wait if that reconnect fails https://github.com/LORD-MicroStrain/ntrip_client/blob/ca4de0dad0fae12fa6d8e9856a993eec5007ce89/src/ntrip_client/ntrip_base.py#L54. The issue I think is that the connect succeeds but read/writing still fails afterwards

olliewalsh avatar May 12 '25 22:05 olliewalsh