I found a solution that results in the DB and WU being updated each minute.
First, I set weewx config back to the original settings:
[StdArchive]
  archive_interval = 60
  archive_delay = 5

Then I changed the driver to output two types of loop packets:
a) if there was no data received from the data logger after 5 seconds then 
a null packet of only 'dateTime' and 'usUnits' was returned to weewx.
b) if data was received within 5 seconds then the full loop packet was 
returned to weewx.
The driver is essentially called every 5 seconds by weewx.  So 1 full loop 
packet is received each minute and this is written to the DB and WU updated.

Problem solved.

Craig


On Monday, October 2, 2023 at 10:09:52 AM UTC+13 Craig Young wrote:

> This also updates the DB and WU every minute:
> [StdArchive]
>   archive_interval = 1
>   archive_delay = 10
>
> I tried archive_interval = 0 but got a divide by zero exception.  I assume 
> that is because the software tried to calculate an average for the archive 
> record by dividing the # of loop records received in that interval by the 
> archive interval in seconds.
> Craig
>
>
> On Monday, October 2, 2023 at 4:31:18 AM UTC+13 Craig Young wrote:
>
>> The "429" error is fixed.  Thanks Karen and Tom.
>> The 2 minute update problem, I changed the driver to poll the hardware 
>> (serial port) every 15 seconds, but the database still updated every 2 
>> minutes.  After playing with several parameters in the driver and 
>> weewx.conf I finally got the database to update every 1 minute and WU to 
>> also update every minute.  To do this I had to make this change:
>> [StdArchive]
>>   archive_interval = 15
>>
>> This resulted in an error message when I started weewx (from SYSLOG):
>> WARNING weewx.engine: Archive delay (15) is unusually long
>>
>> I thought reducing it from 60 sec to 15 sec would get an error of it 
>> being too short.
>>
>> In the Database the records show an interval of 0.25 but they are now 
>> being updated every 1 minute which I assume is because the driver is 
>> sending a loop packet every 1 minute.  So the problem appears to be related 
>> to the archive record interval.  Here is what I think may be happening.  
>> Weewx gets a loop packet and processes it, control is then returned to the 
>> driver.  The driver, 1 minute later, sends another loop packet.  Weewx THEN 
>> begins a 1 minute archive interval and then processes the archive record, 
>> so two minutes later.  I did notice the error message says archive 
>> "delay".  In theory, if I set the delay to 0 then when a loop packet 
>> arrives, once every minute from the driver, then weewx would immediately 
>> write it to the DB and update WU.  Is that correct?
>>
>> Craig
>>
>> On Monday, October 2, 2023 at 1:31:06 AM UTC+13 Tom Keffer wrote:
>>
>>> First, a note on how weewxd works: the driver blocks, waiting for data 
>>> to come in. The program cannot do anything while it is blocked. Once data 
>>> comes in, then it can proceed, emit a LOOP packet, then the rest of the 
>>> program can process it.
>>>
>>> Your fileparse polling interval is 60 seconds. This means that it will 
>>> sleep for 60 seconds before reading new data from the file. Nothing will 
>>> happen until it wakes up. 
>>>
>>> Meanwhile, your archive interval is 60 seconds. This means weewxd will 
>>> take whatever data has accumulated over the previous 60 seconds and use it 
>>> to create an archive record.
>>>
>>> With such a short archive interval and long LOOP polling interval, you 
>>> can see how it's easy for the program to be sleeping, or have nothing 
>>> available at the one minute mark.
>>>
>>> Solution: if you can, have data available more frequently than once 
>>> every 60 seconds. This would allow you to shorten the fileparse polling 
>>> interval. If that's not possible, lengthen the archive interval to at least 
>>> 5 minutes.
>>>
>>> Best yet, do both.
>>>
>>> As for the "429" error, this is happening because your system is trying 
>>> to register too frequently. Almost all weewx stations do this because the 
>>> default registration interval does not work well with the station 
>>> registration. You can ignore it, or tell weewx to do the station 
>>> registration less frequently. In weewx.conf:
>>>
>>> [StdRESTful]
>>>     [[StationRegistry]]
>>>         register_this_station = false
>>>         post_interval = 86400
>>>
>>>
>>>
>>> Station registration is working fine. 
>>>
>>> -tk
>>>
>>> On Sat, Sep 30, 2023 at 8:57 PM Craig Young <[email protected]> 
>>> wrote:
>>>
>>>> After writing a new driver for my station and configuring weewx to 
>>>> support its  data stream I was able to run weewx live for a few minutes, 
>>>> then shut it down to check SYSLOG (debug=2).
>>>> There appears to be two problems (see attached syslog excerpt):
>>>>
>>>> a) The database and reports are updating on two minutes intervals.  The 
>>>> config file has this set for 1 minute intervals:
>>>> "INFO weewx.engine: Using archive interval of 60 seconds (software 
>>>> record generation)"
>>>>
>>>>  Maybe there is some other setting required?
>>>>
>>>> b) There are several HTTP ERROR 429: TOO MANY REQUESTS messages.  Not 
>>>> sure why this is happening.
>>>>
>>>> I think I am close to a fully operational system, just need to clean up 
>>>> a few things.
>>>>
>>>> Craig
>>>>
>>>> -- 
>>>> 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/b8903053-6813-45e1-a804-aa5b566d7bdan%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/weewx-user/b8903053-6813-45e1-a804-aa5b566d7bdan%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/088e8a4a-3246-42c4-8044-2355b6749729n%40googlegroups.com.

Reply via email to