Hi All,
I decided to debug the source on this LOOP2 detection issue and I believe the code needs to be modified to cast the constant 1.90 to a float.
I ended up making this modification (DavisStation.cs Build 3050 starting line 99):
Code: Select all
01 if (connectedOK)
02 {
03 // get time of last db entry (also sets raincounter and prevraincounter)
04 //lastArchiveTimeUTC = getLastArchiveTime();
05
06 DavisFirmwareVersion = GetFirmwareVersion();
07 float FwVer = float.Parse(DavisFirmwareVersion, CultureInfo.InvariantCulture.NumberFormat); // New assignment to make debugging easier
08
09 cumulus.LogMessage("FW version = " + DavisFirmwareVersion);
10 if ((DavisFirmwareVersion == "???" || FwVer < (float)1.90) && cumulus.UseDavisLoop2) // Cast 1.90 to a float, without this the comparison < 1.90 does not work
11 {
12 cumulus.LogMessage("LOOP2 is enabled in Cumulus.ini but this firmare version does not support it. Consider disabling it in Cumulus.ini");
13 Console.WriteLine("Your console firmware version does not support LOOP2. Consider disabling it in Cumulus.ini");
14 }
As the comments allude to, I added a new variable to facilitate debugging (7th line), but essentially without the cast to float on the "1.90" (10th line) the original check for "DavisFirmwareVersion, CultureInfo.InvariantCulture.NumberFormat < 1.90" does not work.
At the end of the day, its only tidying up the logging, because for station with 1.90 firmware, LOOP2 packets do work and the error logged does not actually affect this. By adding to the cumulus.ini file
UseDavisLoop2=0 actually is a backward step for firmware's 1.90.
Caveat: I am not a professional .net programmer, so I may be up the wrong creek
Cheers
Phil