Questions about weewx-loopdata

295 views
Skip to first unread message

Geni

unread,
Nov 16, 2020, 5:45:20 AM11/16/20
to weewx-user

Hi john
since weewx 4.2.0 the loop-data.txt is no longer generated?
regards Geni


syslog.txt

John Kline

unread,
Nov 16, 2020, 10:05:21 AM11/16/20
to weewx...@googlegroups.com
I can duplicate this problem and will issue a fix.

In the meantime, you can add:
rainyear.outTemp.max
to the fields clause in the LoopData section of weewx.conf?

That will stop this problem.  If you get similar errors for other periods where you have no fields listed, you’ll have to temporarily add a field for those periods also.

I should have a fix shortly.  I don’t know that this is related to WeeWX 4.2, not that that really matters. 

On Nov 16, 2020, at 2:45 AM, Geni <eugen.a...@gmail.com> wrote:



Hi john
since weewx 4.2.0 the loop-data.txt is no longer generated?
regards Geni


--
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/3f89791f-c06b-43d1-beac-0afa58df59d6n%40googlegroups.com.
<syslog.txt>

Geni

unread,
Nov 16, 2020, 12:04:47 PM11/16/20
to weewx-user
Ok, works
Thank you

John Kline

unread,
Nov 16, 2020, 5:57:13 PM11/16/20
to weewx...@googlegroups.com
A fix is released (v2.7.2).  There is no hurry to install the new release; but once you’ve installed it, you can remove the field I asked you to add to weewx.conf.

On Nov 16, 2020, at 9:04 AM, Geni <eugen.a...@gmail.com> wrote:

Ok, works

geoffs...@gmail.com

unread,
Nov 24, 2020, 11:54:49 PM11/24/20
to weewx-user
Hi John,

This is a great extension. I'm wondering if there is a way to be able to include sending data that is null  or none for a particular key? I'm using a davis vantage pro2, weewx 4.2. I'd like to use this to make a JSON output that can be ingested into a home automation system. So far it works great as long as the data is available to be sent, but I have not figured out how to send a key with a Null or none value. It looks like a key with a null or none value gets cleaved off the JSON output. If a battery dies on a sensor and it just disappears from the JSON output, that is much harder for the HA system to handle than a null, none or zero value. 

John Kline

unread,
Nov 25, 2020, 9:45:44 AM11/25/20
to weewx...@googlegroups.com
In the general case, including keys in the loop packet for non-existent data is not a good idea.  This would break existing code (e.g., JavaScript code I use in my skins).

You could easily fork the extension and add in what you need.  At line 736, right before write_packet_to_file is called, simply check for the keys you need to exist, and add them if they are not there. The following should work.  Just replace the keys I’ve listed with the ones you need in the packet.

must_have_keys = [ 'current.outTemp', 'current.outHumidity' ]
    for must_have_key in must_have_keys:
        if must_have_key not in loopdata_pkt:
            loopdata_pkt[must_have_key] = None

If you don’t want to hard code the keys, you’ll have a bigger task; but you could just copy the code used to process the ‘fields’ entry in the LoopData section of weewx.conf.

Cheers,
John

On Nov 24, 2020, at 8:54 PM, geoffs...@gmail.com <geoffs...@gmail.com> wrote:

Hi John,

geoffs...@gmail.com

unread,
Nov 25, 2020, 10:06:46 AM11/25/20
to weewx-user
Awesome! This is sort of what I suspected that most use cases, NULL is a problem. I can just hard code the entire Davis loop which will work for my needs.

Thanks you,

Geoff

geoffs...@gmail.com

unread,
Nov 26, 2020, 10:32:53 AM11/26/20
to weewx-user
Hi John,

Works great. Here is what I added to the loop-data.py

Line 735     self.ten_min_packets, self.cfg.ten_min_obstypes)
                # Added to allow specific null keys if no data available in loop packet
                must_have_keys = [ 'current.dateTime', 'current.extraTemp1.raw', 'current.extraTemp2.raw', 'current.extraTemp3.raw', 'current.extraHumid1.raw', 'current.extraHumid2.raw', 'current.extraHumid3.raw' ]
                for must_have_key in must_have_keys:
                    if must_have_key not in loopdata_pkt:
                        loopdata_pkt[must_have_key] = None

Thanks!

John Kline

unread,
Nov 26, 2020, 11:46:10 AM11/26/20
to weewx...@googlegroups.com
Thanks for letting me know.

Δημήτρης Βήχος

unread,
Jan 26, 2021, 9:02:25 AM1/26/21
to weewx-user
i was easily installed the loop-data extension yesterday. i use weewx 4.3 with wh1080 weather station, but data refresh every 5 minutes, with the rest skins of weewx

John Kline

unread,
Jan 26, 2021, 10:07:58 AM1/26/21
to weewx...@googlegroups.com
but data refresh every 5 minutes, with the rest skins of weewx

Exactly what data are you talking about that refreshes every five minutes?

On Jan 26, 2021, at 6:02 AM, Δημήτρης Βήχος <hobbyl...@gmail.com> wrote:

i was easily installed the loop-data extension yesterday. i use weewx 4.3 with wh1080 weather station, but data refresh every 5 minutes, with the rest skins of weewx

Δημήτρης Βήχος

unread,
Jan 26, 2021, 10:15:32 AM1/26/21
to weewx-user

John Kline

unread,
Jan 26, 2021, 10:19:17 AM1/26/21
to weewx...@googlegroups.com
How often does your driver write loop records?
Would you please check the actual loop-data.txt file, rather than the skin’s report, to see if that file is being updated on every loop record?

On Jan 26, 2021, at 7:15 AM, Δημήτρης Βήχος <hobbyl...@gmail.com> wrote:

the loop-data.txt 

Δημήτρης Βήχος

unread,
Jan 26, 2021, 10:36:57 AM1/26/21
to weewx-user
loop-data.txt updates every 5 minutes in web page. but in log see loop-data.txt every 60 secs

John Kline

unread,
Jan 26, 2021, 10:45:32 AM1/26/21
to weewx...@googlegroups.com
Again, how often does your driver write loop records?

loop-data.txt is not written in reporting cycles.  I am asking you to look at the actual loop-data.txt file that is written to the .../loopdata directory.  How often does the contents of that file change.

Also, please show what entries you are seeing in the log every one minute.

On Jan 26, 2021, at 7:37 AM, Δημήτρης Βήχος <hobbyl...@gmail.com> wrote:

loop-data.txt updates every 5 minutes in web page. but in log see loop-data.txt every 60 secs

Δημήτρης Βήχος

unread,
Jan 26, 2021, 10:57:38 AM1/26/21
to weewx-user
well the actuall  /loopdata   localhost/weewx/loopdata  , refreshing every 60 seconds its ok. but in weather page  refreshing every 5 minutes

John Kline

unread,
Jan 26, 2021, 11:20:42 AM1/26/21
to weewx-user
OK, the behavior we are seeing leads me to believe your web server is on a remote machine; i.e., not on the same machine as weewx.  Is that correct?  If so, you’ll need to use rsync by filling out and enabling it under:

[LoopData]
    [[RsyncSpec]]


Δημήτρης Βήχος

unread,
Jan 26, 2021, 1:34:39 PM1/26/21
to weewx-user
its correct i have remote server. in remote server uploading the loop-data.txt but uploadind every 5 minutes . 

John Kline

unread,
Jan 26, 2021, 2:12:55 PM1/26/21
to weewx...@googlegroups.com
As the README states:
  • If you need the loop-data.txt file pushed to a remote webserver, you will also need to fill in the RsyncSpec fields; but one can fill that in later, after LoopData is up and running.

It appears loopdata is up and running and working on the local machine.  Have you set up rsync for loopdata?

Please see the following sections of the README:





On Jan 26, 2021, at 10:34 AM, Δημήτρης Βήχος <hobbyl...@gmail.com> wrote:

its correct i have remote server. in remote server uploading the loop-data.txt but uploadind every 5 minutes . 

Δημήτρης Βήχος

unread,
Jan 26, 2021, 3:00:34 PM1/26/21
to weewx-user
i have setup for loopdata

[LoopData]
    [[FileSpec]]
        loop_data_dir = .
        filename = loop-data.txt
    [[Formatting]]
        target_report = LoopDataReport
    [[LoopFrequency]]
        seconds = 30
    [[RsyncSpec]]
        enable = true
        remote_server = ftpupload.net
        remote_user = epiz_27298028
        remote_dir = /htdocs/test
        compress = true
        log_success = true
        ssh_options = -o ConnectTimeout=1
        timeout = 1
        skip_if_older_than = 3
    [[Include]]
        fields = trend.outTemp, trend.barometer.desc, current.barometer, current.dateTime.raw, current.dewpoint, current.dewpoint.formatted, current.heatindex, current.outHumidity, current.outTemp, current.outTemp.formatted, current.rain, current.rainRate, current.rainRate.formatted, current.windchill, current.windDir.ordinal_compass, current.windSpeed, current.windSpeed.formatted, current.windSpeed.raw, 10m.outTemp.max.formatted, 10m.outTemp.min.formatted, 10m.rain.sum.formatted, 10m.wind.rms.formatted, 10m.windGust.max, 10m.windGust.max.formatted, day.outTemp.max.formatted, day.outTemp.min.formatted, day.rain.sum, day.rain.sum.formatted, day.wind.rms.formatted, day.windGust.max, day.windGust.max.formatted, week.outTemp.max.formatted, week.outTemp.min.formatted, week.rain.sum.formatted, week.wind.rms.formatted, week.windGust.max.formatted, month.outTemp.max.formatted, month.outTemp.min.formatted, month.rain.sum.formatted, month.wind.rms.formatted, month.windGust.max.formatted, year.outTemp.max.formatted, year.outTemp.min.formatted, year.rain.sum.formatted, year.wind.rms.formatted, year.windGust.max.formatted, rainyear.outTemp.max.formatted, rainyear.outTemp.min.formatted, rainyear.rain.sum.formatted, rainyear.wind.rms.formatted, rainyear.windGust.max.formatted
    [[BarometerTrendDescriptions]]
        RISING_VERY_RAPIDLY = Rising Very Rapidly
        RISING_QUICKLY = Rising Quickly
        RISING = Rising
        RISING_SLOWLY = Rising Slowly
        STEADY = Steady
        FALLING_SLOWLY = Falling Slowly
        FALLING = Falling
        FALLING_QUICKLY = Falling Quickly
        FALLING_VERY_RAPIDLY = Falling Very Rapidly

John Kline

unread,
Jan 26, 2021, 3:10:42 PM1/26/21
to weewx...@googlegroups.com
remote_server = ftpupload.net
I would expect the remote server to be kairos.moudania.com
It looks like you are trying to use an ftp server.  If so, that simply won’t work.
If you don’t have ssh access to your server, such that you can get rsync to work, you will not be able to use the loopdata extension.

On Jan 26, 2021, at 12:00 PM, Δημήτρης Βήχος <hobbyl...@gmail.com> wrote:

i have setup for loopdata
Reply all
Reply to author
Forward
0 new messages