Skip to content

Commit

Permalink
Merge pull request #131 from mcrossley/master
Browse files Browse the repository at this point in the history
Build 3154
  • Loading branch information
mcrossley authored Nov 9, 2021
2 parents 9297480 + a1f510e commit e6177ac
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
20 changes: 16 additions & 4 deletions CumulusMX/GW1000Station.cs
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,18 @@ private void GetLiveData()
{
if (null != data && data.Length > 16)
{
/*
* debugging code with example data
*
var hex = "FFFF27004601009D06220821A509270D02001707490A00B40B002F0C0069150001F07C16006317012A00324D00341900AA0E0000100000110000120000009D130000072C0D0000F8";
int NumberChars = hex.Length;
byte[] bytes = new byte[NumberChars / 2];
for (int i = 0; i < NumberChars; i += 2)
bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
data = bytes;
*/

// now decode it
Int16 tempInt16;
UInt16 tempUint16;
Expand Down Expand Up @@ -993,7 +1005,7 @@ private void GetLiveData()
idx += 2;
break;
case 0x0D: //Rain Event (mm)
StormRain = ConvertRainMMToUser(ConvertBigEndianUInt32(data, idx) / 10.0);
StormRain = ConvertRainMMToUser(ConvertBigEndianUInt16(data, idx) / 10.0);
idx += 2;
break;
case 0x0E: //Rain Rate (mm/h)
Expand All @@ -1020,7 +1032,7 @@ private void GetLiveData()
idx += 4;
break;
case 0x15: //Light (lux)
// Save the Lux value
// Save the Lux value
LightValue = ConvertBigEndianUInt32(data, idx) / 10.0;
// convert Lux to W/m² - approximately!
DoSolarRad((int)(LightValue * cumulus.LuxToWM2), dateTime);
Expand Down Expand Up @@ -1080,7 +1092,7 @@ private void GetLiveData()
case 0x45: //Soil Temperature14 (℃)
case 0x47: //Soil Temperature15 (℃)
case 0x49: //Soil Temperature16 (℃)
// figure out the channel number
// figure out the channel number
chan = data[idx - 1] - 0x2B + 2; // -> 2,4,6,8...
chan /= 2; // -> 1,2,3,4...
tempInt16 = ConvertBigEndianInt16(data, idx);
Expand All @@ -1103,7 +1115,7 @@ private void GetLiveData()
case 0x46: //Soil Moisture14 (%)
case 0x48: //Soil Moisture15 (%)
case 0x4A: //Soil Moisture16 (%)
// figure out the channel number
// figure out the channel number
chan = data[idx - 1] - 0x2C + 2; // -> 2,4,6,8...
chan /= 2; // -> 1,2,3,4...
DoSoilMoisture(data[idx], chan);
Expand Down
6 changes: 3 additions & 3 deletions CumulusMX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cumulus MX")]
[assembly: AssemblyDescription("Version 3.13.7 - Build 3153")]
[assembly: AssemblyDescription("Version 3.13.8 - Build 3154")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Cumulus MX")]
Expand All @@ -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.13.7.3153")]
[assembly: AssemblyFileVersion("3.13.7.3153")]
[assembly: AssemblyVersion("3.13.8.3154")]
[assembly: AssemblyFileVersion("3.13.8.3154")]
8 changes: 4 additions & 4 deletions CumulusMX/WeatherStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3781,23 +3781,23 @@ public void DoOutdoorDewpoint(double dp, DateTime timestamp)

public void DoExtraHum(double hum, int channel)
{
if ((channel > 0) && (channel < 11))
if ((channel > 0) && (channel < ExtraHum.Length - 1))
{
ExtraHum[channel] = (int)hum;
}
}

public void DoExtraTemp(double temp, int channel)
{
if ((channel > 0) && (channel < 11))
if ((channel > 0) && (channel < ExtraTemp.Length - 1))
{
ExtraTemp[channel] = temp;
}
}

public void DoUserTemp(double temp, int channel)
{
if ((channel > 0) && (channel < 11))
if ((channel > 0) && (channel < UserTemp.Length - 1))
{
UserTemp[channel] = temp;
}
Expand All @@ -3806,7 +3806,7 @@ public void DoUserTemp(double temp, int channel)

public void DoExtraDP(double dp, int channel)
{
if ((channel > 0) && (channel < 11))
if ((channel > 0) && (channel < ExtraDewPoint.Length - 1))
{
ExtraDewPoint[channel] = dp;
}
Expand Down
5 changes: 5 additions & 0 deletions Updates.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.13.8 - b3154
——————————————
- Fix: Error in GW1000 LiveData decoding


3.13.7 - b3153
——————————————
- Fix: Davis stations not retrieving 10 min Gust values from LOOP2 packets
Expand Down

0 comments on commit e6177ac

Please sign in to comment.