On Wednesday, February 10, 2021 at 7:30:27 AM UTC+1 gjr80 wrote:

> It might be worth revising the operation of genLoopPackets() and 
> genArchiveRecords(), in particular when running under hardware and 
> software record generation.
>

<Snip very useful information how weewx works> thanks!
 

> Back to your situation. When you have genArchiveRecords() enabled you say 
> that "*The driver sees the data and according to some logging it passes 
> it to weewx just fine, but for some reason weewx seems to be silently 
> ignoring the data, it is never added to the database with no indication why 
> in the logfile.*" What do you mean by this, or what are you expecting to 
> see? If you are using hardware record generation (you must be if 
> genArchiveRecords() is being called) then WeeWX will never save the loop 
> packet data to the archive table in the database, it saves the archive 
> record emitted by genArchiveRecords() to the archive table in the 
> database. WeeWX only uses the loop packet data to update the daily summary 
> tables.
>

OK, so that makes more sense now. And it actually worked like this as well, 
the version on github now has code to NOT return records in 
genArchiveRecords() that have been fetched from loop data because I noticed 
it was using the archive versions of that data and it was those that ended 
up in the database.

This is not something I want as the data coming from the REST interface is 
rounded and make some of the graphs look very blocky (I've notified 
WeatherFlow of that and they said they will look into that, but I don't 
know when). That might not be a very good reason (at least in the long run) 
to prefer the loop data, but nonetheless that is the main reason why I want 
that data to be based on the loop data.
 

> Did you look at the daily summary tables, are the highs and lows and 
> timestamps being updated with loop data?
>

No, I have not looked at those, sorry.

When you disable genArchiveRecords(), even though you have hardware record 
> generation set, the call to genArchiveRecords() fails and WeeWX 
> automatically falls back to software record generation where WeeWX 
> synthesises an archive record and saves that archive record to the archive 
> table in the database.
>

How do I disable genArchiveRecords()? Returning no records apparently 
doesn't do the trick. Should I cast an exception or something?

>
> From your description above it is quite possible that WeeWX and your 
> driver is working exactly as intended, it might not be, but I think you 
> will need to look at bit deeper to show this.
>

Yes, I think you might be right. My problem (as mentioned above) is that 
I'd rather not use the archive data as the loop data is of higher quality.

Is the loop data being fetched in a separate thread? Another approach might 
be to in the loop-data method create the record but don't return it (or 
actually return it as well, doesn't seem to matter...), but store it in the 
driver. When the genArchiveRecords() is called, return that data. But that 
does feel like a hackey solution. And if the loop data is being fetched 
from another thread, I might have to learn a bit more about thread-safety 
stuff in Python (total newby when it comes to Python...)

Thanks for your detailed answers, much appreciated!

Cheers,
Jan-Jaap

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" 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-development/42ae3564-e9b9-4210-8df6-5752d71654e8n%40googlegroups.com.

Reply via email to