Page 1 of 1

Unable to write data to the transport connection

Posted: Sun 28 Feb 2016 12:42 am
by Dinant
I am moving from Cumulus 1 to Cumulus MX. I connect through a Weather Envoy with TCP/IP.
The automatic upload to the Weatherlink site is on. The disconnect periode = 5 and I have added DavisIPResponseTime=1000 to the cumulus.ini
With Cumulus 1 everything was working well and very stable.
Now I have switched to Cumulus MX 3037 and I got the following error:

Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at .(TcpClient , String ) in C:\Users\steve\Documents\Visual Studio 2015\Projects\CumulusMX\CumulusMX\DavisStation.cs:line 661
at .() in C:\Users\steve\Documents\Visual Studio 2015\Projects\CumulusMX\CumulusMX\DavisStation.cs:line 552
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

What went wrong?

I have attached the MXdiags.txt file.

Re: Unable to write data to the transport connection

Posted: Sun 28 Feb 2016 1:17 am
by Dinant
I have increased the DavisIPResponseTime=2000 and turned on Logging=1 and DataLogging=1.
Now the connection is better but I got the same errror again. I have attached the MXdiags.txt file.

Re: Unable to write data to the transport connection

Posted: Sun 28 Feb 2016 8:55 am
by steve
Cumulus is apparently unable to reconnect to the logger after the periodic disconnect. It appears that the reconnect works, but the logger doesn't respond to the request for data, even after three retries, and then the logger disconnects. So perhaps the logger is still busy uploading to weatherlink.com. You could try turning off uploads to weatherlink.com and the periodic disconnect, to see if the problem goes away.

Re: Unable to write data to the transport connection

Posted: Sun 28 Feb 2016 9:46 am
by Dinant
I have turned off the updates to weatherlink.com and everything went fine last night.
Now I have reset VP2PeriodicDisconnectInterval=0 and disabled DavisIPResponseTime=2000.

For the moment it looks like the envoy was busy unloading to weatherlink.com.
In Cumulus 1 this was not a problem but with Cumulus MX it is.

Re: Unable to write data to the transport connection

Posted: Sun 28 Feb 2016 10:42 am
by steve
I'm relying on the logger accepting the connection to know that it's finished uploading, but it seems that it will sometimes accept the connection, but won't communicate. I don't know how the code in Cumulus 1 works, it is all handled by the Davis DLL, and Davis do not provide any information at all for developers about communicating with IP loggers.

I am looking at handling the TCP/IP connection being disconnected anyway (but it isn't a quick change) so that should also help in this situation.

I don't upload to weatherlink.com myself, so can'y try any of this out. The IP logger was kindly donated to me to help with Cumulus development, and I don't have the login details.

Re: Unable to write data to the transport connection

Posted: Sun 28 Feb 2016 11:32 am
by steve
I think my check on whether the connection has been re-established might be wrong. I'll look at changing it in the next build, it might help.

Re: Unable to write data to the transport connection

Posted: Sun 28 Feb 2016 12:07 pm
by Dinant
Ok, I understand. I'll keep the weatherlink.com uploading disabled.
If I can help/test anything please let me know.