[REJECTED] I believe the wxnow.txt file is in the wrong format
Posted: Sat 12 Feb 2022 11:12 pm
Hello all,
I just finished setting up my own weather station using a raspberry pi weewx and aprx for amateur radio.
I was comparing my wxnow file with a friend of mine that has been getting errors with his wxnow.txt file. After further inspection, I realized that the wxnow file is being formed incorrectly with the local time instead of zulu (GMT) time.My interpretation of C# is mildly rusty but I believe that this would be the solution to the problem as I have just fixed it here in python example: https://github.com/p4ck377r4c3r/weewx-cwxn. This also adds the position with the wxnow file. In the WeatherStation.cs starting at line 2659 changes have been shown in with tag // change above the change:
Again not totally sure if this will work but he is using aprs32.
Thanks Jon KB3OSP
I just finished setting up my own weather station using a raspberry pi weewx and aprx for amateur radio.
I was comparing my wxnow file with a friend of mine that has been getting errors with his wxnow.txt file. After further inspection, I realized that the wxnow file is being formed incorrectly with the local time instead of zulu (GMT) time.
Code: Select all
2022-02-12 16:35:28 EST: KB3KBR-1>APWW11,TCPIP*,qAC,T2NALA:;KB3KBR-WX*121635z4124.48N/07942.59W_303/002g008t025r000p020P001h75b10165 [Delayed or out-of-order packet (timestamp)]
Code: Select all
private void CreateWxnowFile()
{
// Jun 01 2003 08:07
// 272/000g006t069r010p030P020h61b10150
// 272 - wind direction - 272 degrees
// 010 - wind speed - 10 mph
// g015 - wind gust - 15 mph
// t069 - temperature - 69 degrees F
// r010 - rain in last hour in hundredths of an inch - 0.1 inches
// p030 - rain in last 24 hours in hundredths of an inch - 0.3 inches
// P020 - rain since midnight in hundredths of an inch - 0.2 inches
// h61 - humidity 61% (00 = 100%)
// b10153 - barometric pressure in tenths of a millibar - 1015.3 millibars
var filename = cumulus.AppDir + cumulus.WxnowFile;
//change
string timestamp = DateTime.Now.ToUniversalTime().ToString("ddHHmm");
int mphwind = Convert.ToInt32(ConvertUserWindToMPH(WindAverage));
int mphgust = Convert.ToInt32(ConvertUserWindToMPH(RecentMaxGust));
// ftemp = trunc(TempF(OutsideTemp));
string ftempstr = APRStemp(OutdoorTemperature);
int in100rainlasthour = Convert.ToInt32(ConvertUserRainToIn(RainLastHour) * 100);
int in100rainlast24hours = Convert.ToInt32(ConvertUserRainToIn(RainLast24Hour) * 100);
int in100raintoday;
if (cumulus.RolloverHour == 0)
// use today's rain for safety
in100raintoday = Convert.ToInt32(ConvertUserRainToIn(RainToday) * 100);
else
// 0900 day, use midnight calculation
in100raintoday = Convert.ToInt32(ConvertUserRainToIn(RainSinceMidnight) * 100);
int mb10press = Convert.ToInt32(ConvertUserPressToMB(AltimeterPressure) * 10);
// For 100% humidity, send zero. For zero humidity, send 1
int hum;
if (OutdoorHumidity == 0)
hum = 1;
else if (OutdoorHumidity == 100)
hum = 0;
else
hum = OutdoorHumidity;
//change
string data = String.Format("@{timestamp}z{APRSLat(cumulus)}/{APRSLon(cumulus)}_{0:000}/{1:000}g{2:000}t{3}r{4:000}p{5:000}P{6:000}h{7:00}b{8:00000}", AvgBearing, mphwind, mphgust, ftempstr, in100rainlasthour,
in100rainlast24hours, in100raintoday, hum, mb10press);
if (cumulus.APRS.SendSolar)
{
data += APRSsolarradStr(SolarRad);
}
using (StreamWriter file = new StreamWriter(filename, false))
{
//change
file.WriteLine(data);
file.Close();
}
}
Thanks Jon KB3OSP