[Xastir] Davis, Lacrosse weather code modified, need testers.

Tom Russo russo at bogodyn.org
Tue Aug 21 10:41:43 EDT 2012


On Tue, Aug 21, 2012 at 03:35:56AM -0700, we recorded a bogon-computron collision of the <warpedspeed1 at yahoo.com> flavor, containing:
> I have had a few days of sporadic rain and few chances to observe how Xastir is reporting it.? 
> 
> Last night after I returned home, between 2300 and 0000 utc, I noticed that Xastir was showing .42 inches in Today's Rain.? This looked correct. 
> 
> I happened to look at it again a little after 0000 utc, 2000 EDT local, and Today's Rain was 0.00 . So I guess that it now re-calcs at 0000z ? 
> 
> 
> Now this AM I see that the Today's Rain number is still 0.00, even though we received another .31" overnight since 0000 utc.? When is Today's Rain (Since Midnight) filled in Xastir?? 

Ok, here's the deal.

There are 4 rain values Xastir can keep track of:

Total Rain  (this is the rain since the weather station was reset,
	     and should always be increasing)
Rain since midnight
Rain last 24 hours
Rain last hour

Before my change, Xastir expected every weather station to report Total Rain,
and it would calculate the other three.  It does this by saving Total Rain
over many time intervals, and doing subtractions of total rain now and total
rain an hour ago, at midnight, and 24 hours ago.  For this to work, 
Total Rain must be a continuously increasing value, and if the Total Rain
value were reset to zero (or decrease) during the period when Xastir is
observing it, the results would be wrong.

Davis APRS Data Logger does not report total rain, it only reports the other
three.  The code to read the Data Logger incorrectly read what the logger
reported as 24-hour rain and stored it in the Total Rain value, then let
Xastir calculate the other three, which it did wrong.  It was wrong because
the 24-hour data provided is NOT continuously increasing, it rises and falls
as appropriate.  Doing the computation by subtracting was giving grossly wrong
answers at odd times.

The Davis Meteo code (db2aprs) doesn't report total rain either, it reports
only rain last 24 hours and rain last hour.  That is because db2aprs ignores
the total rain and rain-since-midnight that are being stored in the database.
The Xastir Meteo code also incorrectly used the 24-hour rain that db2aprs
reports as if it were total rain, and so 24-hour, since-midnight, and 1-hour
were also wrong (they'd experience weird behavior, because the 24-hour
rain is not a constantly increasing number).

My last change to Xastir stops using the 24-hour rain reported by the 
two Davis options as "total rain" and uses all the data they provide directly.
That is, when the station provides a 24-hour rain number, we report that
number and don't try to recalculate it.  Same goes for rain-since-midnight
or last-hour: if the station reports it, we use it and don't recalculate it.

So when you ask:

> So I guess that it now re-calcs at 0000z ?

the answer is no.  Xastir isn't recalculating ANYTHING for Davis stations
anymore, it is using exactly what the station (through Meteo and db2aprs)
is reporting.

But db2aprs does NOT report rain since midnight.  db2aprs doesn't output
total rain either, so we do not have the information we need to *compute*
rain since midnight.  Therefore, Xastir has to leave that blank.

My next hack will have to be to modify db2aprs so that it DOES report rain 
since midnight.  There is no reason it can't, as the Davis weather station 
does report that information and Meteo *does* store it in the database.  Once
I do that, then Xastir can display rain since midnight. again.  Until I do,
Xastir will show a blank in the Own Weather Data dialog for that value, just
as it does for total rain.

Meteo stores total rain, too, so db2aprs could be modified to provide
that information to Xastir, but there is an issue.  db2aprs is trying to emit
an APRS-compatible weather report, which Xastir then parses.  There is no
slot in the APRS weather report for total rain (rain since station was reset),
so it will involve a hack to get it in and parse it.  There is no real good
reason why db2aprs has to emit an APRS-compatible weather report, as we are
not using that report as-is, we're parsing it, using the data in it, and then
reconstructing a weather report of our own.  So I *could* break the
APRS compatibility of "db2aprs" output and just add extra parsing code for it.
But that's like work, and I have a day job.

For now, you'll just have to be content with having no valid data for rain 
since midnight.  The value you were getting before was wrong anyway, as it was
improperly calculated.

It should be the case that since Xastir hasn't a value of rain-since-midnight
to display, it should also not be transmitting "P000" --- it should simply
leave that bit of data out of the transmitted weather report.  My own station,
which uses the LaCrosse version of db2aprs and the same Xastir
code as the Davis/Meteo, doesn't report this bit of data in its transmitted
weather report.  If yours *IS* transmitting incorrect data, then we have
a problem that needs to be fixed.

Working in Xastir's wx code is a nightmare, as the wx.c file is an absolute 
horror of "creeping featurism" and duplicated code.  But rewriting the entire 
thing is even scarier, since so many different weather stations have been 
wired in by so many different people and in so many different styles that 
getting a rewrite tested would be next to impossible.

It may be a week or two before I have time to modify db2aprs to emit
rain since midnight using the data from its database.  This will also require
some small modification to Xastir, because Xastir is expecting a particular 
length string from the db2aprs program, and the parsing code is a little 
fragile.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick




More information about the Xastir mailing list