Thanks for the info.

James

On Friday, February 18, 2022 at 10:24:21 PM UTC gjr80 wrote:

> No problems James. 
>
> Regards the services, think of the [[Services]] stanza as a matrix. When 
> an event occurs (for example the arrival of a new archive record) WeeWX 
> works it way down each 'row' (ie each xxxx_services option) in turn 
> checking each 'column' (ie each service defined in that row) to see if that 
> service was bound to the event in question. If it is bound WeeWX executes 
> the designated code (method) for that service, if it's not bound WeeWX 
> moves on to the next 'column'/service. The services are loosely grouped by 
> type, but there is really no great difference between service types. Order 
> matters, typically services towards the top of the list (eg data) will be 
> doing things to the incoming data to maybe add observations, eg you may 
> have a service that reads air quality data from a separate sensor suite and 
> adds it to loop packets and archive records (such a service would likely be 
> bound to the new archive record and new loop packet events). You would not 
> put such a service after StdArchive as the data would not be saved to the 
> archive. Services that process the incoming data and perhaps change the 
> archive record (eg StdWxCalculate) need to be 'placed' after all of the 
> incoming data has been assembled but before StdArchive writes the archive 
> record to database.
>
> In your case some careful placement of your service in the processing 
> chain has solved the problem.
>
> Gary
>
> On Friday, 18 February 2022 at 19:42:43 UTC+10 James Taylor wrote:
>
>> Sorry Gary
>>
>> Yes I was also annoyed when I caught the extension and remembered why it 
>> was there :-(   I did learn a lot more about the code setup.  I had been 
>> running the debug at 2 and still missed it so therefore renamed it to 
>> windDir so it matches the same case at least!
>>
>> I'm still trying to fully understand the 'services' implementation, but 
>> yes I've moved it from data_services to the end of process_services, and 
>> also before weewx.engine.StdArchive and in both cases it continued to 
>> operate as expected.
>>
>> I will update Belchertown users in case they are using Pat's service.
>>
>> Thanks again and sorry for the long winded way of getting there.
>>
>> James
>>
>> On Friday, February 18, 2022 at 1:56:39 AM UTC gjr80 wrote:
>>
>>> So if I understand your post correctly you are running Pat's service to 
>>> delete windDir from archive records? If so that sort of info would have 
>>> been nice to know from the outset; that is why we ask for a startup log 
>>> with debug=1 - it gives us key WeeWX config info so we know what 
>>> services are being run and what aren't.
>>>
>>> Again if you are running Pat's service then the solution should be 
>>> fairly straightforward; instead of running the service as a data service, 
>>> run it as a process service but list it after StdWxCalculate. This way 
>>> StdWxCalculate can do whatever to the archive record and then Pat's 
>>> service will come along and delete windDir. When StdArchive steps in it 
>>> will extract windDir from the accumulator as before (assuming windDir 
>>> is in loop packets) and add it to the archive record before it is saved to 
>>> database. Making Pat's service an archive service would probably work as 
>>> well, as long as it was listed in archive_services in weewx.conf before 
>>> StdArchive.
>>>
>>> Gary
>>>
>>> On Thursday, 17 February 2022 at 23:49:56 UTC+10 James Taylor wrote:
>>>
>>>> Hello
>>>>
>>>> So this was broken by commit ec958a0 (
>>>> https://github.com/weewx/weewx/commit/ec958a0658612ef3bce90ab5c6e825ef0d329e8e
>>>> ).
>>>>
>>>> To give the history, to allow Belchertown to output / graph rxCheckPercent 
>>>> as discussed here 
>>>> https://www.mail-archive.com/weewx...@googlegroups.com/msg21816.html 
>>>> <https://www.mail-archive.com/weewx-user@googlegroups.com/msg21816.html>, 
>>>> it meant we delete windDir from the Vantage archive record which means we 
>>>> then process the loop packets as an accumulator
>>>>
>>>> I'm guessing this will need the brains / knowledge of Tom to comment???
>>>>
>>>> James
>>>> On Wednesday, February 16, 2022 at 10:55:01 PM UTC James Taylor wrote:
>>>>
>>>>> Tonight's debug....
>>>>>
>>>>> So I've detected that I'm not getting windDir on the archive record 
>>>>> from the Vantage Pro 2 on the records coming every 5 mins, compared to 
>>>>> any 
>>>>> archive records received after a restart, so possibly a hardware issue.
>>>>>
>>>>> PRESENT -
>>>>> Feb 16 21:41:02 pi weewx[5179] DEBUG weewx.drivers.vantage: Getting 
>>>>> archive packets since 2022-02-16 21:25:00 GMT (1645046700)
>>>>> Feb 16 21:41:02 pi weewx[5179] DEBUG weewx.drivers.vantage: Gentle 
>>>>> wake up of console successful
>>>>> Feb 16 21:41:02 pi weewx[5179] DEBUG weewx.drivers.vantage: Retrieving 
>>>>> 1 page(s); starting index= 0
>>>>> Feb 16 21:41:02 pi weewx[5179] DEBUG weewx.engine: REC:  2022-02-16 
>>>>> 21:40:00 GMT (1645047600) 'barometer': '29.472', 'consBatteryVoltage': 
>>>>> 'None', 'dateTime': '1645047600', 'ET': '0.0', 'forecastRule': '192', 
>>>>> 'highOutTemp': '53.5', 'highRadiation': '0.0', 'highUV': '0.0', 
>>>>> 'inHumidity': '53.0', 'inTemp': '72.5', 'interval': '5', 'lowOutTemp': 
>>>>> '53.4', 'outHumidity': '86.0', 'outTemp': '53.5', 'radiation': '0.0', 
>>>>> 'rain': '0.0', 'rainRate': '0.0', 'rxCheckPercent': '19.645833333333332', 
>>>>> 'txBatteryStatus': 'None', 'usUnits': '1', 'UV': '0.0', 'wind_samples': 
>>>>> '23.0', 'windDir': '270.0', 'windGust': '13.0', 'windGustDir': '247.5', 
>>>>> 'windSpeed': '7.0'
>>>>> Feb 16 21:41:02 pi weewx[5179] INFO weewx.wxxtypes: Type beaufort has 
>>>>> been deprecated. Use unit beaufort instead.
>>>>>
>>>>> MISSING -
>>>>> Feb 16 22:30:15 pi weewx[5796] DEBUG weewx.engine: REC:  2022-02-16 
>>>>> 22:30:00 GMT (1645050600) 'barometer': '29.511', 'consBatteryVoltage': 
>>>>> '4.66', 'dateTime': '1645050600', 'ET': '0.0', 'forecastRule': '122', 
>>>>> 'highOutTemp': '52.1', 'highRadiation': '0.0', 'highUV': '0.0', 
>>>>> 'inHumidity': '50.0', 'inTemp': '75.6', 'interval': '5', 'lowOutTemp': 
>>>>> '51.9', 'outHumidity': '78.0', 'outTemp': '51.9', 'radiation': '0.0', 
>>>>> 'rain': '0.0', 'rainRate': '0.0', 'rxCheckPercent': '99.9375', 
>>>>> 'txBatteryStatus': '0', 'usUnits': '1', 'UV': '0.0', 'wind_samples': 
>>>>> '117.0', 'windGust': '14.0', 'windGustDir': '247.5', 'windSpeed': '8.0'
>>>>>
>>>>> I've also worked out that, I appear to be getting caught up with 
>>>>> getting a weewx.CannotCalculate (hence a None) from calc_windDir in 
>>>>> wxxtypes.py, because the default calculation is software for windDir 
>>>>> under 
>>>>> wxservices.py
>>>>>
>>>>> If I set it to windDir = hardware, then it uses the loop entries and 
>>>>> creates the averages!
>>>>>
>>>>> James
>>>>> On Wednesday, February 16, 2022 at 12:26:51 PM UTC James Taylor wrote:
>>>>>
>>>>>> Thanks Gary
>>>>>>
>>>>>> Yes - I forgot about the 12.5 multiples thing so yes gives me a 
>>>>>> possible idea on what is going to work out what has changed in behavior 
>>>>>> as 
>>>>>> the weewx.conf hasn't changed (apart from the version details)
>>>>>>
>>>>>> James
>>>>>>
>>>>>> On Wednesday, February 16, 2022 at 1:30:05 AM UTC gjr80 wrote:
>>>>>>
>>>>>>> The 4.5.1 archive record looks very much like a software generated 
>>>>>>> archive record, you can tell by the windDir value. The windDir 
>>>>>>> value in a hardware generated archive record from a VP2 appears in 
>>>>>>> multiples of 12.5 degrees - that is fixed and a limitation of the 
>>>>>>> archive 
>>>>>>> record format emitted from the console/logger. In a WeeWX VP2 hardware 
>>>>>>> generated archive record the wind direction values will be multiples of 
>>>>>>> 12.5 or None. Software generated archive records contain an average of 
>>>>>>> the 
>>>>>>> loop packet windDir values. windDir in a VP2 loop packet is in 
>>>>>>> whole degrees and not subject to the '12.5 degree multiple' effect. So 
>>>>>>> in a 
>>>>>>> software generated archive record windDir will be a float, usually with 
>>>>>>> a 
>>>>>>> number of decimal places and certainly (almost always) not a multiple 
>>>>>>> of 
>>>>>>> 12.5. I also see THSW in the archive records, THSW is only present in 
>>>>>>> the 
>>>>>>> LOOP2 archive packet so I am guessing you are using LOOP2 instead of 
>>>>>>> the 
>>>>>>> normal LOOP1 packet. Should not be a problem but it's something out of 
>>>>>>> the 
>>>>>>> ordinary.
>>>>>>>
>>>>>>> Might help to see the WeeWX startup for each case and weewx.conf to 
>>>>>>> understand your configuration. You say record generation is set to 
>>>>>>> hardware 
>>>>>>> in weewx.conf, that is great but not necessarily what is used by WeeWX. 
>>>>>>> WeeWX will try hardware and if for some reason it doesn't work/isn't 
>>>>>>> available WeeWX will drop back to software record generation. Always 
>>>>>>> best 
>>>>>>> to check what is in the log.
>>>>>>>
>>>>>>> I would also look at the loop packets, what wind direction values do 
>>>>>>> you see in loop packets? What appears in the subsequent archive record? 
>>>>>>> No 
>>>>>>> need to modify WeeWX, just run WeeWX directly 
>>>>>>> <http://weewx.com/docs/usersguide.htm#Running_directly> and you 
>>>>>>> will see loop packets and archive records direct to console.
>>>>>>>
>>>>>>> Gary
>>>>>>> On Wednesday, 16 February 2022 at 03:02:54 UTC+10 James Taylor wrote:
>>>>>>>
>>>>>>>> Hello
>>>>>>>>
>>>>>>>> I've upgraded to weewx 4.6.2 and found out that my vantage Pro2 REC 
>>>>>>>> is giving a different output for windDir 
>>>>>>>>
>>>>>>>> record_generation is set to hardware in weewx.conf 
>>>>>>>>
>>>>>>>> I amended StdPrint to output new_archive_record to stdout and 
>>>>>>>> log.debug and I can see a difference
>>>>>>>>
>>>>>>>> 4.6.2 - 
>>>>>>>> Feb 15 16:30:15 pi weewx[21988] DEBUG weewx.engine: REC:   
>>>>>>>> 2022-02-15 16:30:00 GMT (1644942600) 'altimeter': 
>>>>>>>> '29.664795850933803', 
>>>>>>>> 'appTemp': '44.26912313212261', 'bar_calibration': 
>>>>>>>> '-0.0020000000000000013', 'bar_offset': '-0.010000000000000005', 
>>>>>>>> 'bar_reduction': '0.0020000000000000013', 'barometer': '29.673', 
>>>>>>>> 'beaufort': '2', 'cloudbase': '794.2252812978254', 
>>>>>>>> 'consBatteryVoltage': 
>>>>>>>> '4.65', 'dateTime': '1644942600', 'dayET': '0.013', 'dayRain': 
>>>>>>>> '0.13385826690000002', 'dewpoint': '46.75340876228957', 'ET': '0.0', 
>>>>>>>> 'extraAlarm1': '0.0', 'extraAlarm2': '0.0', 'extraAlarm3': '0.0', 
>>>>>>>> 'extraAlarm4': '0.0', 'extraAlarm5': '0.0', 'extraAlarm6': '0.0', 
>>>>>>>> 'extraAlarm7': '0.0', 'extraAlarm8': '0.0', 'forecastIcon': '3.0', 
>>>>>>>> 'forecastRule': '158', 'heatindex': '47.358000000000004', 
>>>>>>>> 'highOutTemp': 
>>>>>>>> '48.5', 'highRadiation': '11.0', 'highUV': '0.0', 'hourRain': 
>>>>>>>> '0.0078740157', 'humidex': '49.280997613295085', 'inDewpoint': 
>>>>>>>> '50.40086122975667', 'inHumidity': '48.0', 'insideAlarm': '0.0', 
>>>>>>>> 'inTemp': 
>>>>>>>> '71.1', 'interval': '5', 'leafWet4': '0.0', 'lowOutTemp': '48.4', 
>>>>>>>> 'maxSolarRad': '46.94974186677293', 'monthET': '0.52', 'monthRain': 
>>>>>>>> '1.0787401509', 'outHumidity': '94.0', 'outsideAlarm1': '0.0', 
>>>>>>>> 'outsideAlarm2': '0.0', 'outTemp': '48.4', 'pressure': 
>>>>>>>> '29.21395918348061', 
>>>>>>>> 'pressure_raw': '29.224799999999995', 'radiation': 
>>>>>>>> '5.3999999999999995', 
>>>>>>>> 'rain': '0.0', 'rain15': '0.0', 'rain24': '0.13385826690000002', 
>>>>>>>> 'rainAlarm': '0.0', 'rainRate': '0.0', 'rxCheckPercent': '97.375', 
>>>>>>>> 'soilLeafAlarm1': '0.0', 'soilLeafAlarm2': '0.0', 'soilLeafAlarm3': 
>>>>>>>> '0.0', 
>>>>>>>> 'soilLeafAlarm4': '0.0', 'stormRain': '0.13385826690000002', 
>>>>>>>> 'stormStart': 
>>>>>>>> '1644883200.0', 'sunrise': '1644912960.0', 'sunset': '1644949080.0', 
>>>>>>>> 'sunshineDuration': '0.0', 'THSW': '45.0', 'trendIcon': '-20.0', 
>>>>>>>> 'txBatteryStatus': '0', 'usUnits': '1', 'UV': '0.0', 'wind_samples': 
>>>>>>>> '114.0', 'windchill': '45.762013144176095', 'windDir': 'None', 
>>>>>>>> 'windGust': 
>>>>>>>> '10.0', 'windGust10': '10.0', 'windGustDir': '247.5', 'windGustDir10': 
>>>>>>>> '247.0', 'windrun': '0.5', 'windSpeed': '6.0', 'windSpeed2': '5.7', 
>>>>>>>> 'windSpeed10': '5.0', 'yearET': '1.13', 'yearRain': 
>>>>>>>> '1.5275590458000001'
>>>>>>>>
>>>>>>>> Back to 4.5.1 and everything is good ( windDir: 237.52965750482582).
>>>>>>>>
>>>>>>>> Feb 15 16:50:15 pi weewx[22480] DEBUG weewx.engine: REC: 
>>>>>>>>  2022-02-15 16:50:00 GMT (1644943800) altimeter: 29.656827096532094, 
>>>>>>>> appTemp: 45.77889412649187, bar_calibration: -0.0020000000000000013, 
>>>>>>>> bar_offset: -0.010000000000000005, barometer: 29.665, bar_reduction: 
>>>>>>>> 0.0020000000000000013, beaufort: 1, cloudbase: 730.1419634508915, 
>>>>>>>> consBatteryVoltage: 4.65, dateTime: 1644943800, dayET: 0.013, dayRain: 
>>>>>>>> 0.13385826690000002, dewpoint: 46.83537536081608, ET: 0.0, 
>>>>>>>> extraAlarm1: 
>>>>>>>> 0.0, extraAlarm2: 0.0, extraAlarm3: 0.0, extraAlarm4: 0.0, 
>>>>>>>> extraAlarm5: 
>>>>>>>> 0.0, extraAlarm6: 0.0, extraAlarm7: 0.0, extraAlarm8: 0.0, 
>>>>>>>> forecastIcon: 
>>>>>>>> 3.0, forecastRule: 158, heatindex: 47.185, highOutTemp: 48.2, 
>>>>>>>> highRadiation: 7.0, highUV: 0.0, hourRain: 0.0, humidex: 
>>>>>>>> 49.11495517097403, 
>>>>>>>> inDewpoint: 50.309529357501425, inHumidity: 48.0, insideAlarm: 0.0, 
>>>>>>>> inTemp: 
>>>>>>>> 71.0, interval: 5, leafWet4: 0.0, lowOutTemp: 48.1, maxSolarRad: 0.0, 
>>>>>>>> monthET: 0.52, monthRain: 1.0787401509, outHumidity: 95.0, 
>>>>>>>> outsideAlarm1: 
>>>>>>>> 0.0, outsideAlarm2: 0.0, outTemp: 48.2, pressure: 29.206088977429996, 
>>>>>>>> pressure_raw: 29.21954545454549, radiation: 4.2, rain: 0.0, rain15: 
>>>>>>>> 0.0, 
>>>>>>>> rain24: 0.13385826690000002, rainAlarm: 0.0, rainRate: 0.0, 
>>>>>>>> rxCheckPercent: 
>>>>>>>> 98.22916666666666, soilLeafAlarm1: 0.0, soilLeafAlarm2: 0.0, 
>>>>>>>> soilLeafAlarm3: 0.0, soilLeafAlarm4: 0.0, stormRain: 
>>>>>>>> 0.13385826690000002, 
>>>>>>>> stormStart: 1644883200.0, sunrise: 1644912960.0, sunset: 1644949080.0, 
>>>>>>>> sunshineDuration: 0.0, THSW: 45.666666666666664, trendIcon: -20.0, 
>>>>>>>> txBatteryStatus: 0, usUnits: 1, UV: 0.0, windchill: 48.2, windDir: 
>>>>>>>> 237.52965750482582, windGust: 6.0, windGust10: 0.7, windGustDir: 
>>>>>>>> 225.0, 
>>>>>>>> windGustDir10: 225.0, windrun: 0.25, wind_samples: 115.0, windSpeed: 
>>>>>>>> 3.0, 
>>>>>>>> windSpeed10: 3.0, windSpeed2: 3.2, yearET: 1.13, yearRain: 
>>>>>>>> 1.52755904580000
>>>>>>>>
>>>>>>>> I've issued a clear-memory just in case it was corrupted, but I'm 
>>>>>>>> now thinking something else is going on.  The Loop data is fine and 
>>>>>>>> mqtt is 
>>>>>>>> working as expected.
>>>>>>>>
>>>>>>>> Any idea on how to debug this some more?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> James
>>>>>>>>
>>>>>>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/854d28f0-e92e-4e56-96c2-f90747734f0en%40googlegroups.com.

Reply via email to