diff --git a/CumulusMX/Cumulus.cs b/CumulusMX/Cumulus.cs index cceca4bc..f417b515 100644 --- a/CumulusMX/Cumulus.cs +++ b/CumulusMX/Cumulus.cs @@ -29,8 +29,8 @@ namespace CumulusMX public class Cumulus { ///////////////////////////////// - public string Version = "3.0.1"; - public string Build = "3051"; + public string Version = "3.0.2"; + public string Build = "3052"; ///////////////////////////////// private static string appGuid = "57190d2e-7e45-4efb-8c09-06a176cef3f3"; @@ -3022,10 +3022,11 @@ private void ReadIniFile() solar_logging = ini.GetValue("Station", "SolarLog", false); #if DEBUG logging = true; + DataLogging = true; #else logging = ini.GetValue("Station", "Logging", false); -#endif DataLogging = ini.GetValue("Station", "DataLogging", false); +#endif VP2ConnectionType = ini.GetValue("Station", "VP2ConnectionType", VP2SERIALCONNECTION); VP2TCPPort = ini.GetValue("Station", "VP2TCPPort", 22222); diff --git a/CumulusMX/DavisStation.cs b/CumulusMX/DavisStation.cs index 37bde632..4424f079 100644 --- a/CumulusMX/DavisStation.cs +++ b/CumulusMX/DavisStation.cs @@ -30,6 +30,7 @@ internal class DavisStation : WeatherStation private const string newline = "\n"; private DateTime lastRecepStatsTime; private int commWaitTimeMs = 1000; + private int MaxArchiveRuns = 2; private TcpClient socket; @@ -554,6 +555,7 @@ private void bw_DoStart(object sender, DoWorkEventArgs e) private void bw_DoWork(object sender, DoWorkEventArgs e) { + int archiveRun = 0; cumulus.LogDebugMessage("Lock: Station waiting for the lock"); Cumulus.syncInit.Wait(); cumulus.LogDebugMessage("Lock: Station has the lock"); @@ -562,9 +564,11 @@ private void bw_DoWork(object sender, DoWorkEventArgs e) // set this temporarily, so speed is done from average and not peak gust from logger savedUseSpeedForAvgCalc = cumulus.UseSpeedForAvgCalc; cumulus.UseSpeedForAvgCalc = true; - GetArchiveData(); - // and again, in case it took a long time and there are new entries - GetArchiveData(); + do + { + GetArchiveData(); + archiveRun++; + } while (archiveRun < MaxArchiveRuns); } catch (Exception ex) { @@ -1824,7 +1828,8 @@ private void GetArchiveData() if (tmrComm.timedout) { - cumulus.LogMessage("The station has stopped sending archive data"); + cumulus.LogMessage("The station has stopped sending archive data, ending attempts"); + Console.WriteLine(""); // flush the progress line return; } // Read the response @@ -1858,6 +1863,7 @@ private void GetArchiveData() if (responsePasses == 20) { cumulus.LogMessage("The station has stopped sending archive data"); + Console.WriteLine(""); // flush the progress line return; } @@ -2186,8 +2192,18 @@ private void GetArchiveData() { // do rollover cumulus.LogMessage("Day rollover " + timestamp.ToShortTimeString()); + // If the rollover processing takes more that ~10 seconds the station times out sending the archive data + // If this happens, add aonther run to the archive processing, so we start it again to pick up records for the next day + var watch = new System.Diagnostics.Stopwatch(); + watch.Start(); DayReset(timestamp); - + watch.Stop(); + if (watch.ElapsedMilliseconds > 10000) + { + // EOD processing took longer than 10 seconds, add another run + cumulus.LogDebugMessage("End of day processing took more than 10 seconds, adding another archive data run"); + MaxArchiveRuns++; + } rolloverdone = true; } diff --git a/CumulusMX/Properties/AssemblyInfo.cs b/CumulusMX/Properties/AssemblyInfo.cs index 46bf89ec..9128e023 100644 --- a/CumulusMX/Properties/AssemblyInfo.cs +++ b/CumulusMX/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CumulusMX")] -[assembly: AssemblyDescription("Build 3051")] +[assembly: AssemblyDescription("Build 3052")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CumulusMX")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.0.1.3051")] -[assembly: AssemblyFileVersion("3.0.1.3051")] +[assembly: AssemblyVersion("3.0.2.3052")] +[assembly: AssemblyFileVersion("3.0.2.3052")] diff --git a/Updates.txt b/Updates.txt index 017dc063..45a18c14 100644 --- a/Updates.txt +++ b/Updates.txt @@ -1,3 +1,14 @@ +3.0.2 - b3052 +============= +- Fixes Davis archive downloads from the the logger when the day rollover processing takes longer than 10 seconds. + This can happen on slow processors - Pi Zero for example - or if lengthy procedures are included + An extra archive processing run is scheduled for each day rollover that takes longer than 10 seconds + +- Updated files + \CumulusMX.exe + \CumulusMX.exe.config + \CumulusMX.pdb + 3.0.1 - b3051 =============