v4beta mystery element values in packets from test driver

38 views
Skip to first unread message

Vince Skahan

unread,
Feb 29, 2020, 5:02:42 PM2/29/20
to weewx-development
I'm cobbling together a driver that will ultimately seed its packets with a JSON query from the Davis WeatherLink Live hardware (mentioned in a separate thread).

I used mwall's suggestion to start with his maxbotix driver, and stripped a bunch of stuff out of it to basically have it generate a bogus _pkt set of parameters.

When I run this with --test-driver it does the expected thing, showing me the bogus packet's contents.  Cool.

root@stretch64pkg:/home/weewx/bin/user# PYTHONPATH=/home/weewx/bin python3 /home/weewx/bin/user/vincetest.py --test-driver
testing driver
('2020-02-29 21:58:39 GMT (1583013519)', {'usUnits': 1, 'outTemp': 31.23, 'dateTime': 1583013519})
('2020-02-29 21:58:42 GMT (1583013522)', {'usUnits': 1, 'outTemp': 31.23, 'dateTime': 1583013522})
('2020-02-29 21:58:44 GMT (1583013524)', {'usUnits': 1, 'outTemp': 31.23, 'dateTime': 1583013524})
 

But...when I run the driver in the foreground, check out the output...

root@stretch64pkg:/home/weewx/bin/user# /home/weewx/bin/weewxd /home/weewx/weewx.conf
LOOP:   2020-02-29 21:59:00 GMT (1583013540) dateTime: 1583013540, maxSolarRad: 525.2302552658722, outTemp: 31.23, rainRate: 0.0, usUnits: 1
LOOP:   2020-02-29 21:59:02 GMT (1583013542) dateTime: 1583013542, maxSolarRad: 525.1744219921469, outTemp: 31.23, rainRate: 0.0, usUnits: 1
LOOP:   2020-02-29 21:59:04 GMT (1583013544) dateTime: 1583013544, maxSolarRad: 525.1185872811789, outTemp: 31.23, rainRate: 0.0, usUnits: 1

 
Questions I have is : 
  • where did the  maxSolarRad and rainRate elements and values come from ?  They're not mentioned in the driver at all.
  • does weewx have some stuff under the hood that is seeding elements that don't necessarily exist in the gear a particular driver contains ?

Draft driver is attached in case anybody has ideas....


vincetest.py

gjr80

unread,
Feb 29, 2020, 6:13:42 PM2/29/20
to weewx-development
A few things to remember:

1. The console output from running WeeWX directly is not the output from the driver rather it is the resulting packet/records after all WeeWX services have been run (StdConvert, StdCaibrate, StdWXCalculate etc). Have a look at the [[Services]] stanza at the bottom of wwewx.conf, the console output comes from StdPrint so everything before StdPrint gets its go first. So StdWXCalculate has its go at augmenting the packet/record with any derived obs. When you only have temperature there is not to much it can add (eg heatindex, windchill require other obs) but maxSolarRad is solely dependent on time of day and lat/logn (and pyepehem) and rainRate takes a pretty simplistic view; if there is no rain then rainRate must be 0.

2. Refer to 1. Basically everything before StdPrint could be doing something to the packet/record.

If you want to see just the driver output code the driver to be able to be run without WeeWX (which you have). If you want to see just the driver output from WeeWX then turn off all the data and process services (you may need StdConvert, not sure on that)

Gary

Vince Skahan

unread,
Feb 29, 2020, 7:55:37 PM2/29/20
to weewx-development
On Saturday, February 29, 2020 at 3:13:42 PM UTC-8, gjr80 wrote:
A few things to remember:

1. The console output from running WeeWX directly is not the output from the driver rather it is the resulting packet/records after all WeeWX services have been run (StdConvert, StdCaibrate, StdWXCalculate etc). Have a look at the [[Services]] stanza at the bottom of wwewx.conf, the console output comes from StdPrint so everything before StdPrint gets its go first. So StdWXCalculate has its go at augmenting the packet/record with any derived obs. When you only have temperature there is not to much it can add (eg heatindex, windchill require other obs) but maxSolarRad is solely dependent on time of day and lat/logn (and pyepehem) and rainRate takes a pretty simplistic view; if there is no rain then rainRate must be 0.

 
ok - that makes sense.  I have pyephem and lat/lon so it's calculating things based on those items.  I was worried weewx was making stuff up :-)

Thanks !

gjr80

unread,
Mar 1, 2020, 1:49:14 AM3/1/20
to weewx-development
On Sunday, 1 March 2020 10:55:37 UTC+10, Vince Skahan wrote:
I was worried weewx was making stuff up :-)

Actually there is a fair bit of effort made to ensure WeeWX does not make things up (windDir = None when windSpeed == 0, culling of fields from drivers etc)

Gary
Reply all
Reply to author
Forward
0 new messages