As I feared, the problem is not fixed. The lag between the posting of MQTT 
records by weewx and the current time has wandered all over the place over 
the past two days.  It has gone from dead on time to 1.5 hours behind, and 
everything in between.  Last night it was doing okay, this morning it was 
80 minutes behind, and now it is 20 minutes behind.  There is no rhyme or 
reason to it.  The only constant is that weewx can't seem to post MQTT 
records on time on a consistent basis.

On Wednesday, October 28, 2020 at 9:25:32 PM UTC-7 T Reid wrote:

> Greg, I am not ready to declare victory yet, but after restarting my 
> mosquitto broker, I let weewx keep running and overnight the MQTT loop 
> records gradually caught up!  Not all at once, but over time you could see 
> the delay shrinking.  All day today, the display has been pretty much spot 
> on.  I would love to understand what caused this in the first place, and 
> why restarting the MQTT broker would fix it.  Meanwhile, I have my fingers 
> crossed that the delay does not come back.
>
> On Tuesday, October 27, 2020 at 10:19:40 PM UTC-7 T Reid wrote:
>
>> Thank you for your very thorough response, Greg.  In response to your 
>> questions and suggestions:
>>
>>    - I am publishing aggregate data. Here is the MQTT section of my 
>>    weeewx.conf:
>>
>> [[MQTT]]
>>     server_url = mqtts://user:pass...@mqtt.example.com:8883/ 
>> <http://user:passw...@mqtt.example.com:8883/>
>>     topic = weather/belmont
>>     binding = archive, loop
>>     aggregation = aggregate
>>     [[[tls]]]
>>         ca_certs = /etc/ssl/certs/ca-certificates.crt
>>
>>    - I looked at the traffic with mosquitto_sub, and the incoming 
>>    weather data right now is from 45 minutes ago.
>>    - I'm afraid that I don't know what running "netstat ... to look for 
>>    full output queues" means.
>>    - What am I looking for in the logs? I see new "INFO weewx.restx: 
>>    MQTT" entries every two seconds or so. Each entry says that it has 
>>    published a record with a time stamp from about 45 minutes ago.
>>    - What I am seeing on my weather page using the Belchertown skin are 
>>    charts built using current archive records (updated every five minutes), 
>>    but  "station observations" at the top of the page using MQTT delivered 
>>    loop records that reflect weather data from 45 minutes ago.  Earlier 
>> today, 
>>    the lag was only 30 minutes.  The lag grows over time.
>>    - I restarted the broker, and the MQTT weather data on the web page, 
>>    on mosquitto_sub, and in the weewx logs is still running 45 minutes 
>>    behind.  No change. 
>>    - I run my own broker using mosquitto running on a droplet on Digital 
>>    Ocean.  My copy of weewx is running on a raspberry pi that is hooked up 
>> to 
>>    the datalogger on my Davis Vantage Pro2 console with a USB cable.
>>
>> To my eyes, it looks like weewx is running further and further behind in 
>> publishing loop records over MQTT, which makes no sense to me.
>>
>> On Sunday, October 25, 2020 at 7:43:08 AM UTC-7 Greg Troxel wrote:
>>
>>>
>>> T Reid <trgo...@hoghill.net> writes: 
>>>
>>> > I am using the MQTT add-in to pipe real time loop entries from my 
>>> Davis 
>>> > Vantage Pro into the Belchertown skin, using the standard instructions 
>>> for 
>>> > that skin. It generally works great. But every couple of days the MQTT 
>>> > feed will fall behind, sometimes by as much as an hour or more. To fix 
>>> it, 
>>> > I have to restart weewx. Any idea what might be happening? I am 
>>> running 
>>> > weewx 4.1.1 with Belchertown 1.1. 
>>>
>>> My suggestions: 
>>>
>>> explain if you are publishing aggregate or individual data 
>>>
>>> Use mosquitto_sub (from mosquitto) on the broker to watch the traffic. 
>>>
>>> Run netstat on the weewx host to look for full output queues 
>>>
>>> read the weewx logs 
>>>
>>> explain what you are seeing more precisely than saying "fall behind". 
>>>
>>> next time it fails, restart your broker instead of weewx and see what 
>>> happens. That will cause the weewx->broker connection to get shut 
>>> down and weewx/mqtt will open a new one. 
>>>
>>> if you are using some cloud broker, run your own 
>>>
>>>

-- 
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/cfcbc844-e7b6-40aa-b25a-f62fee48789cn%40googlegroups.com.

Reply via email to