Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

[REJECTED] I believe the wxnow.txt file is in the wrong format

A Forum to archive Cumulus MX development suggestions that have been rejected or solved by other means.
Locked
KB3OSP
Posts: 3
Joined: Sat 12 Feb 2022 10:48 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10

[REJECTED] I believe the wxnow.txt file is in the wrong format

Post by KB3OSP »

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.

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)]
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:

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();
			}
		}
Again not totally sure if this will work but he is using aprs32.

Thanks Jon KB3OSP
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: I believe the wxnow.txt file is in the wrong format

Post by mcrossley »

So that changes the format of the file completely from the current two line format, to a single line like the APRS data format (where MX does use UTC).

The wxnow.txt format that MX generates is the same as the original Cumulus 1 afaik. The Cumulus documentation states it is a two line format file, and the date/time is in local time.

I can find documentation on the APRS data format, but nothing on wxnow.txt.

However other programs I have found like AGWTracker use the existing Cumulus two line format with local time. So changing the file format now does not sound like a good idea to me?
KB3OSP
Posts: 3
Joined: Sat 12 Feb 2022 10:48 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10

Re: I believe the wxnow.txt file is in the wrong format

Post by KB3OSP »

mcrossley wrote: Sun 13 Feb 2022 9:00 pm I can find documentation on the APRS data format, but nothing on wxnow.txt.

However other programs I have found like AGWTracker use the existing Cumulus two line format with local time. So changing the file format now does not sound like a good idea to me?
Does AGWTracker take the local time and change it to zulu? And can it accept a raw aprs packet? What does the raw packet of the station when it reports the weather. May be a problem with aprsis32 that it does not convert to zulu or adds the wrong signifier of time.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: I believe the wxnow.txt file is in the wrong format

Post by mcrossley »

I know nothing about it other than what I am finding via searches.

But the aprsisce/32 documentation about the wxnow.txt file points directly at the Cumulus Wiki link I gave above, so you would hope it did the correct conversion to APRS UTC, or keep local time and use the "/" signifier.
User avatar
PaulMy
Posts: 3827
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: I believe the wxnow.txt file is in the wrong format

Post by PaulMy »

You have probably already found the initial request to add wxnow in Cumulus, but linking it for those that have not viewtopic.php?p=234#p234

Enjoy,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: I believe the wxnow.txt file is in the wrong format

Post by mcrossley »

Thanks Paul - 2008!
KB3OSP
Posts: 3
Joined: Sat 12 Feb 2022 10:48 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10

Re: I believe the wxnow.txt file is in the wrong format

Post by KB3OSP »

Even when you set it up it asks what timestamp do you want. He as tried both available neither work. Next, this is to try to set the computer clock to GMT :bash: Thanks for all your help
Locked