"First Light", working, but with some problems

115 views
Skip to first unread message

Craig Young

unread,
Sep 30, 2023, 11:57:10 PM9/30/23
to weewx-user
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
Weewx Log Oct 1 1618.txt

Karen K

unread,
Oct 1, 2023, 3:56:45 AM10/1/23
to weewx-user
b) Your should look which service creates those messages. According to your log it ist "StationRegistry". So, what is "post_interval" saying in your weewx.conf? Besides that, if I remember it correctly, station registry is not working actually. Try setting "register_this_station" to "false".

Tom Keffer

unread,
Oct 1, 2023, 8:31:06 AM10/1/23
to weewx...@googlegroups.com
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

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b8903053-6813-45e1-a804-aa5b566d7bdan%40googlegroups.com.

Craig Young

unread,
Oct 1, 2023, 11:31:18 AM10/1/23
to weewx-user
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

Craig Young

unread,
Oct 1, 2023, 5:09:52 PM10/1/23
to weewx-user
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

Craig Young

unread,
Oct 1, 2023, 11:48:57 PM10/1/23
to weewx-user
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
Reply all
Reply to author
Forward
0 new messages