Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 19-02-2020, 02:18   #1
Registered User

Join Date: Apr 2013
Location: Brisbane, Australia
Posts: 6
Images: 1
Setting TCP timeout before a new connection is created

Hopefully someone can help me with this. I've notice that OpenCPN closes the TCP port and opens a new one if it does not see any NMEA sentences within about 30 seconds. Is there anywhere I can configure that timeout and increase it to what I need. This behavour is causing some of the NMEA feed devices I use to fall over because too many sockets have been opened. TIA.
Kipper1258 is offline   Reply With Quote
Old 19-02-2020, 05:33   #2
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: Setting TCP timeout before a new connection is created

Quote:
Originally Posted by Kipper1258 View Post
Hopefully someone can help me with this. I've notice that OpenCPN closes the TCP port and opens a new one if it does not see any NMEA sentences within about 30 seconds. Is there anywhere I can configure that timeout and increase it to what I need. This behavour is causing some of the NMEA feed devices I use to fall over because too many sockets have been opened. TIA.
It is a hard coded 5 second timer. If no data is received for 1 second then a counter is decremented. It starts at 5 and when the counter hits zero then O closes the socket and waits about 5 seconds and tries to reopen the connection.

It would not be hard to make both of these values a setting in the configuration file. Submit a flyspray enhancement request and try to describe in detail what you need and why it is important.

But really, these other devices you describe are technically "broken". They should also have timeouts on their connections and close them so the sockets can be reused. So it appears you are asking for a bandaid and perhaps the best medicine is to get these other devices to behave properly.
transmitterdan is offline   Reply With Quote
Old 19-02-2020, 14:47   #3
Registered User

Join Date: Apr 2013
Location: Brisbane, Australia
Posts: 6
Images: 1
Re: Setting TCP timeout before a new connection is created

Thanks for this. Is the 1-5 seconds for any form of data on the port, or only useful NMEA sent? I do need to check how the NMEA server on board is configured as it is the first time we have sailed the boat with an NMEA feed from a 2004 Silva-Nexus server.
Kipper1258 is offline   Reply With Quote
Old 19-02-2020, 20:56   #4
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: Setting TCP timeout before a new connection is created

It does not check for a full and proper NMEA message. The watch dog starts again after receiving a chunk of data over the TCP connection.
transmitterdan is offline   Reply With Quote
Old 20-02-2020, 01:49   #5
Registered User

Join Date: Apr 2013
Location: Brisbane, Australia
Posts: 6
Images: 1
Re: Setting TCP timeout before a new connection is created

Quote:
Originally Posted by transmitterdan View Post
The watch dog starts again after receiving a chunk of data over the TCP connection.
Excellent! I'm using a USR-W600 to convert the serial signal into WiFi. It has a heartbeat function where I can configure the data sent and frequency. My backup if I cannot sort out the Nexus server calibration. Thanks once again for your help.
Kipper1258 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming connection ports in setting? Franziska OpenCPN 4 13-09-2016 05:35
GPS timeout value? Andreas29 OpenCPN 6 24-05-2016 09:55
TCP Connection via WIFI for Raymarine HybridTouch Dockhead Marine Electronics 3 20-03-2016 17:51
Making a TCP/IP Connection Glen96 OpenCPN 7 18-11-2014 19:10

Advertise Here


All times are GMT -7. The time now is 09:37.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.