RTLDavis windRun calculation and rain records

81 views
Skip to first unread message

Andrew Roberts

unread,
Feb 20, 2022, 10:57:01 AM2/20/22
to weewx-user
Hi,
I'm after a steer as to where to look to fix/block this issue. I'm running RTLDavis with a Vantage Vue and weewx 4.6.1. The indoor temperature and pressure (BMP280) is coming through as a data service over a serial link.

When I start up weewx and use loopdata, syslog shows:

Feb 20 12:01:23 Weather-Centre weewx[12537] CRITICAL user.loopdata:     ****  Traceback (most recent call last):
Feb 20 12:01:23 Weather-Centre weewx[12537] CRITICAL user.loopdata:     ****    File "/usr/share/weewx/user/loopdata.py", line 810, in process_queue
Feb 20 12:01:23 Weather-Centre weewx[12537] CRITICAL user.loopdata:     ****      windrun_val = weewx.wxxtypes.WXXTypes.calc_windrun('windrun', pkt)
Feb 20 12:01:23 Weather-Centre weewx[12537] CRITICAL user.loopdata:     ****    File "/usr/share/weewx/weewx/wxxtypes.py", line 303, in calc_windrun
Feb 20 12:01:23 Weather-Centre weewx[12537] CRITICAL user.loopdata:     ****      raise weewx.CannotCalculate(key)
Feb 20 12:01:23 Weather-Centre weewx[12537] CRITICAL user.loopdata:     ****  weewx.CannotCalculate: windrun

1. Looking into the code it seems to be a lack of interval data. I can not find a way of sorting this in weewx.conf and close inspection of the RTLDavis DEBUG data  in Syslog (attached) doesn't have any interval data in it.

2. In spite of it raining, the console reporting rain and after tipping a cup of water into the bucket I'm not reliably getting rain data from the ISS. the DEBUG (all three debug options set to 3) log records:

DEBUG user.rtldavis:  data_pkt: {'channel': 1, 'bat_iss': 0, 'wind_speed_ec': 15, 'wind_speed_raw': 14, 'wind_dir': 273.9486166007905, 'wind_speed': 6.705583333333333, 'rain_count': 37, 'curr_cnt0': 2982, 'curr_cnt1': 0, 'curr_cnt2': 0, 'curr_cnt3': 0}
DEBUG user.rtldavis: rain=0.0 rain_count=0 last_rain_count=37
DEBUG user.rtldavis: pkt= {'windSpeed': 6.705583333333333, 'windDir': 273.9486166007905, 'txBatteryStatus': 0, 'rain': 0.0, 'dateTime': 1645353107, 'usUnits': 17}

Any suggestions as to next steps for me troubleshooting these would be welcome.

Andrew

syslog.txt

Tom Keffer

unread,
Feb 21, 2022, 7:09:10 PM2/21/22
to weewx-user
loopdata is trying to calculate windrun, which requires a value for 'interval'. You need it to multiply against velocity to get distance. Unfortunately, 'interval' is not available in loop packets because they come at irregular intervals. 

The source for loopdata could be modified to only calculate windrun if possible. For example, this patch should work (NOT TESTED):

Index: bin/user/loopdata.py
===================================================================
diff --git a/bin/user/loopdata.py b/bin/user/loopdata.py
--- a/bin/user/loopdata.py (revision 0ee9d2ba94c53888154363aa412f1d5d5002ff12)
+++ b/bin/user/loopdata.py (date 1645488401429)
@@ -807,11 +807,14 @@
                 pkt_time: int       = to_int(pkt['dateTime'])
                 pkt['interval']     = self.cfg.loop_frequency / 60.0
 
-                windrun_val = weewx.wxxtypes.WXXTypes.calc_windrun('windrun', pkt)
-                pkt['windrun'] = windrun_val[0]
-                if windrun_val[0] > 0.00 and 'windDir' in pkt and pkt['windDir'] is not None:
-                    bkt = LoopProcessor.get_windrun_bucket(pkt['windDir'])
-                    pkt['windrun_%s' % windrun_bucket_suffixes[bkt]] = windrun_val[0]
+                try:
+                    windrun_val = weewx.wxxtypes.WXXTypes.calc_windrun('windrun', pkt)
+                    pkt['windrun'] = windrun_val[0]
+                    if windrun_val[0] > 0.00 and 'windDir' in pkt and pkt['windDir'] is not None:
+                        bkt = LoopProcessor.get_windrun_bucket(pkt['windDir'])
+                        pkt['windrun_%s' % windrun_bucket_suffixes[bkt]] = windrun_val[0]
+                except weewx.CannotCalculate:
+                    pass
 
                 beaufort_val = weewx.wxxtypes.WXXTypes.calc_beaufort('beaufort', pkt)
                 pkt['beaufort'] = beaufort_val[0]


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a75644e9-5c1b-44a9-a345-70803e116d81n%40googlegroups.com.

John Kline

unread,
Feb 21, 2022, 7:42:48 PM2/21/22
to weewx...@googlegroups.com
Thanks, Tom.

I don’t think that’s the problem as I add an interval to the (copy of) the packet.  That is needed because I keep my own set of accumulators so that loopdata can write out observations on every loop packet (in its own thread) and never have to access the database.  I can add an interval because the user specifies a LoopFrequency in seconds.

Indeed, on my VantagePro2 and RainWise weewx installs, I have no problem with windrun in loopdata.

I’ve seen issues at startup when I’ve tried the WeatherLinkUDP driver and I have code not checked in to catch and ignore errors to make it pass the startup, but I worry that loopdata won’t be accurate for drivers where loop packets don’t always contain all the data.  It’s not something I am likely to tackle anytime soon.

I’m guessing this driver is one of those cases, where loops don’t contain all the observations.  If so, it’s not a good candidate to use loopdata (at least, not at this time).

To the original OP, does everything work fine without loopdata?  Furthermore, does loopdata break the operation of weewx?  I’d be surprised if this is true as the loopdata thread should just die.


On Feb 21, 2022, at 4:09 PM, Tom Keffer <tke...@gmail.com> wrote:



Andrew Roberts

unread,
Feb 22, 2022, 1:15:25 AM2/22/22
to weewx-user
Thanks  Tom & John,

Loopdata doesn't crash weewx and sits there happily chirping out it's loops (see attached syslog after a restart). It doesn't write it's json output (loop-data.txt) and the skin is devoid of data.

I'll try Tom's patch and report back.

Andrew

syslog_plus_loopdata.txt

Andrew Roberts

unread,
Feb 25, 2022, 2:13:57 AM2/25/22
to weewx-user
Tom's patch prevents this:

Feb 22 05:57:11 Weather-Centre weewx[9909] CRITICAL user.loopdata: **** Traceback (most recent call last): Feb 22 05:57:11 Weather-Centre weewx[9909] CRITICAL user.loopdata: **** File "/usr/share/weewx/user/loopdata.py", line 810, in process_queue Feb 22 05:57:11 Weather-Centre weewx[9909] CRITICAL user.loopdata: **** windrun_val = weewx.wxxtypes.WXXTypes.calc_windrun('windrun', pkt) Feb 22 05:57:11 Weather-Centre weewx[9909] CRITICAL user.loopdata: **** File "/usr/share/weewx/weewx/wxxtypes.py", line 303, in calc_windrun Feb 22 05:57:11 Weather-Centre weewx[9909] CRITICAL user.loopdata: **** raise weewx.CannotCalculate(key) Feb 22 05:57:11 Weather-Centre weewx[9909] CRITICAL user.loopdata: **** weewx.CannotCalculate: windrun
although you have to patch the beaufort_val:

                  try:

                     beaufort_val = weewx.wxxtypes.WXXTypes.calc_beaufort('beaufort', pkt)
                     pkt['beaufort'] = beaufort_val[0]
                 except weewx.CannotCalculate:
                    pass

Unfortunately the lack of interval data continues to prevent loopdata from outputting json or populating it's skin. I will keep investigating but this will take a while........

Andrew
Reply all
Reply to author
Forward
0 new messages