I wasn't sure which way to tackle this - in the end I decided that the
console should track rxCheckPercent, and it would be easier to have weewx
calculate wind direction. This is because different models of Vantage have
different ways to calculate the rxCheckPercent. Seemed too complicated to
replicate.
Thanks to Tom's help with this one, this was easier than I thought. When
the archive runs, weewx downloads the archive off the console. Then this
extension deletes the wind data from that archive. By way of how weewx
works, the weewx wind direction gets re-inserted into the archive from the
accumulator. Easier than I thought!
If weewx is offline for a certain period of time, it will download the
archive off the console as a catchup. In this case then the windDir from
the console will be used. Once a loop is established then the extension
will use weewx's method of calculating windDir.
I did add a quick check in the extension to make sure the [Station] -->
station_type = Vantage because in my testing I was bouncing back and forth
between drivers. This also makes sure you're not deleting wind direction
from another driver. If you want to run this on a system that isn't running
Vantage, then you can remove the check within the extension easily.
I've been testing it for a few days and it seems pretty good.
1. Have a backup of anything and everything. Your database, your weewx
folder, your extensions, everything! I'm don't want to be responsible if
something goes sideways.
2. Add the attached extension to your bin/user folder.
3. Set your [StdArchive] --> record_generation setting back to hardware
4. Update the data_services setting here: [Engine] --> [[Services]]
--> data_services = user.deleteVantageWindDir.DeleteWindDir
5. Restart weewx
On Sunday, October 27, 2019 at 6:30:55 PM UTC-4, Pat wrote:
>
> I recently picked up a 2nd hand Weatherlink IP for my Davis VP2 console
> and have been running it on a test weewx instance. I'm now facing this same
> challenge where I don't like the way Davis archives wind direction, but I
> lose rxCheckPercent when switching to software record generation.
>
> I agree with you that it would be nice to be able to choose where each
> datum comes from (like windDir = [hardware|software|prefer_hardware]),
> but since that's not possible I'll look into forking the vantage driver and
> adding in the rxCheckPercent method from the Meteostick driver and see if
> that helps bridge the gap in this specific use case.
>
>
> On Wednesday, September 25, 2019 at 10:02:27 PM UTC-4, Thomas Keffer wrote:
>>
>> Looking through the Meteostick driver, it seems to emit rxCheckPercent
>> data on a running basis in its LOOP packets (not archive packets). These
>> would then get stored in the WeeWX accumulators, then extracted as part of
>> the software record generation.
>>
>> That is certainly a reasonable approach: modify the Vantage driver to
>> keep track of dropped packets, and emit the results in the LOOP packets.
>>
>> I'm not going to do it, but, as always, pull requests are welcome! :-)
>>
>> -tk
>>
>>
>>
>> On Wed, Sep 25, 2019 at 6:49 PM Pat <[email protected]> wrote:
>>
>>> I'm not sure how the Davis driver works, but with the Meteostick driver
>>> it's able to calculate rxCheckPercent
>>> <https://github.com/matthewwall/weewx-meteostick/blob/master/bin/user/meteostick.py#L404-L413>
>>>
>>> based on number of RF packets received over a known interval
>>> <https://github.com/matthewwall/weewx-meteostick/blob/master/bin/user/meteostick.py#L356-L373>
>>>
>>> and doing that math. Since I use the Meteostick driver for my Davis
>>> station, I'm set to software generation and I get the rxCheckPercent. I
>>> wonder if there's a way to incorporate this bit of code into a Davis driver
>>> fork?
>>>
>>> Could be a large project (which I'm not volunteering for) but thought
>>> I'd at least mention it and link to the code.
>>>
>>>
>>> On Monday, September 23, 2019 at 5:47:02 PM UTC-4, Thomas Keffer wrote:
>>>>
>>>> Sorry, but the value of rxCheckPercent comes only from the console, and
>>>> then only in archive records (not LOOP packets). If you disable hardware
>>>> record generation, you lose it.
>>>>
>>>> It would be a nice feature to be able to pick and chose where each
>>>> datum in the archive record comes from, but, unfortunately, that's not the
>>>> way WeeWX works now.
>>>>
>>>> -tk
>>>>
>>>> On Mon, Sep 23, 2019 at 9:46 AM Erick Dorsett <[email protected]>
>>>> wrote:
>>>>
>>>>> I recently installed weewx on a Pi to use with my ancient Davis
>>>>> Vantage Pro. In order to get the winds to report actual degrees instead
>>>>> of
>>>>> quantized to the cardinals, I had to set "record_generation = software"
>>>>> in
>>>>> the weewx.conf file. However, after I did that, the data point for
>>>>> signal
>>>>> quality (rxCheckPercent) is no longer archived in weewx.sdb.
>>>>>
>>>>> I use rxCheckPercent data for a bunch of reasons. How do I get it
>>>>> back?
>>>>>
>>>>>
>>>>> --
>>>>> 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/e564d660-ec57-4887-a74b-a28969ebf374%40googlegroups.com
>>>>>
>>>>> <https://groups.google.com/d/msgid/weewx-user/e564d660-ec57-4887-a74b-a28969ebf374%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/09aa1d9c-1e40-4dbd-bcb0-9e4184ecd255%40googlegroups.com
>>>
>>> <https://groups.google.com/d/msgid/weewx-user/09aa1d9c-1e40-4dbd-bcb0-9e4184ecd255%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/65a9c603-9584-452f-8577-b2f517192118%40googlegroups.com.
"""This extension takes the windDir from hardware archives
and deletes it. This will replace the windDir reading
with weewx's software method. This was created because
Davis outputs dominant windDir and I like weewx's windDir
calculations a bit better.
This method also keeps everything else the hardware archive
offers, such as console voltage and rxCheckPercent.
To install, place this file in your bin/user folder, then modify
weewx.conf data_services to include the below.
[StdArchive]
record_generation = hardware
[Engine]
[[Services]]
data_services = user.deleteWindDir.DeleteWindDir
Restart weewx.
"""
import weewx
from weewx.wxengine import StdService
VERSION = "0.01"
try:
# Test for new-style weewx logging by trying to import weeutil.logger
import weeutil.logger
import logging
log = logging.getLogger(__name__)
def logdbg(msg):
log.debug(msg)
def loginf(msg):
log.info(msg)
def logerr(msg):
log.error(msg)
except ImportError:
# Old-style weewx logging
import syslog
def logmsg(level, msg):
syslog.syslog(level, 'DeleteWindDir: %s:' % msg)
def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)
def loginf(msg):
logmsg(syslog.LOG_INFO, msg)
def logerr(msg):
logmsg(syslog.LOG_ERR, msg)
class DeleteWindDir(StdService):
def __init__(self, engine, config_dict):
# Initialize my superclass:
super(DeleteWindDir, self).__init__(engine, config_dict)
if config_dict["Station"]["station_type"].lower() == "vantage":
self.bind(weewx.NEW_LOOP_PACKET, self.new_loop_packet)
self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
self.first_run = True
def new_loop_packet(self, event):
# The loop is active which means we have an accumulator. Clear the first_run flag.
if self.first_run:
self.first_run = False
def new_archive_record(self, event):
# Only delete windDir from the archive record if we have an accumulator setup from a loop.
# If we don't have a loop and this is called then it's weewx downloading archive off the
# hardware and we keep that windDir record in place.
if not self.first_run:
try:
del event.record['windDir']
except KeyError:
pass