Too chatty Weather365 uploader

43 views
Skip to first unread message

Jarmo Seppänen

unread,
Apr 15, 2020, 12:19:41 PM4/15/20
to weewx-user
I feel my Weather365 is too chatty outputting as below to weewx.log:
Apr 15 19:05:16 raspi3b weewx[10087]: restx: Weather365: Data uploaded to https://channel1.weather365.net/stations/index.php is: (dew2m=3.3&datum=202004151905&humidex=5.9&uvi=0.0&radi=31.0&prec_time=60&et=0.00000&alt=167.0&t2m=5.9&long=24.984&rainh=0.00&rxsignal=100&windrun=0.1&utcstamp=1586966700&wchill=5.9&txbattery=0&winddir=22&windspeed=0.4&windgust=1.3&press=998.206&relhum=83&lat=60.396&appTemp=4.2&heat=5.9&stationid=XXXXXX&raind=3.80&rainrate=0.00&cloudbase=383.2)

I have configured only failures to be logged but this uploader does not seem to behave.
log_success = False
log_failure = True

My python isn’t good enough to understand if there’s something I could do in weather365.py to silence the uploader.

Any hints I could try?

gjr80

unread,
Apr 15, 2020, 3:12:41 PM4/15/20
to weewx-user
Hi,

As you found log_success has no effect on the 'Data uploaded' line, this is clearly debug type info and should be controlled by the debug config option in weewx.conf. Unfortunately, this is not how the uploader has been coded so debug will have no effect either. I see looking at the wiki and the Weather365 uploader that the uploader was in fact provided by Weather365. The correct approach would be that you contact the author (Weather365) for support.

In the interim you can quieten the uploader by locating the following code in weather365.py (it will be in /home/weewx/bin/user or usr/share/weewx/user):

    def process_record(self, record, dbm):
        r
= self.get_record(record, dbm)
        data
= self.get_data(r)
        url
= urllib.urlencode(data)
       
if self.skip_upload:
            loginf
("skipping upload")
           
return
        req
= urllib2.Request(self.server_url, url)
        loginf
("Data uploaded to %s is: (%s)" % (self.server_url, url))
        req
.get_method = lambda: 'POST'
        req
.add_header("User-Agent", "weewx/%s" % weewx.__version__)
       
self.post_with_retries(req)
 
and changing it to (change highlighted):

    def process_record(self, record, dbm):
        r
= self.get_record(record, dbm)
        data
= self.get_data(r)
        url
= urllib.urlencode(data)
       
if self.skip_upload:
            loginf
("skipping upload")
           
return
        req
= urllib2.Request(self.server_url, url)
       
logdbg("Data uploaded to %s is: (%s)" % (self.server_url, url))
        req
.get_method = lambda: 'POST'
        req
.add_header("User-Agent", "weewx/%s" % weewx.__version__)
       
self.post_with_retries(req)

Save and restart WeeWX. The 'Data uploaded' line can now be controlled by the debug config option in weewx.conf (0 will hide it, 1 will show it). To be consistent with the other RestFUL uploaders the 'Data uploaded' line should only be shown when debug >= 2, but that involves more substantial changes to the code and I thought it best to keep it simple. If you do contact Weather365 do suggest the 'Data uploaded' line should only appear when debug >= 2.

Gary

Jarmo Seppänen

unread,
Apr 15, 2020, 5:38:45 PM4/15/20
to weewx-user
Thanks Gary! I have now contacted them.

fraban

unread,
Apr 16, 2020, 11:59:21 AM4/16/20
to weewx-user
Hi all
thank you for reporting this issue. We fixed it today. New version you can find here
https://github.com/weewx/weewx/wiki/weather365

Thank you and stay healthy
- frank - weather365

Reply all
Reply to author
Forward
0 new messages