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]


On Sun, Feb 20, 2022 at 7:57 AM Andrew Roberts <[email protected]>
wrote:

> Hi,
> I'm after a steer as to where to look to fix/block this issue. I'm running
> RTLDavis <https://github.com/lheijst/weewx-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
> <https://github.com/chaunceygardiner/weewx-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
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/a75644e9-5c1b-44a9-a345-70803e116d81n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/a75644e9-5c1b-44a9-a345-70803e116d81n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECnoccFApyQW3fG3%2BOUYh-e8%3DOL567%2BdgqViXM3_2jKZA%40mail.gmail.com.

Reply via email to