Hi all,

I set post_interval in my configuration file for the WOW plugin.  This worked 
prior
to v3.7.0.  In 3.7.0 I get the following error:
Mar 11 18:25:03 host weewx[12696]: engine: Caught unrecoverable exception in 
engine:
Mar 11 18:25:03 host weewx[12696]:     ****  type object got multiple values for
keyword argument 'post_interval'
Mar 11 18:25:03 host weewx[12696]:     ****  Traceback (most recent call last):
Mar 11 18:25:03 host weewx[12696]:     ****    File
"/usr/share/weewx/weewx/engine.py", line 874, in main
Mar 11 18:25:03 host weewx[12696]:     ****      engine = 
engine_class(config_dict)
Mar 11 18:25:03 host weewx[12696]:     ****    File
"/usr/share/weewx/weewx/engine.py", line 77, in __init__
Mar 11 18:25:03 host weewx[12696]:     ****      self.loadServices(config_dict)
Mar 11 18:25:03 host weewx[12696]:     ****    File
"/usr/share/weewx/weewx/engine.py", line 141, in loadServices
Mar 11 18:25:03 host weewx[12696]:     ****     
self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Mar 11 18:25:03 host weewx[12696]:     ****    File
"/usr/share/weewx/weewx/restx.py", line 756, in __init__
Mar 11 18:25:03 host weewx[12696]:     ****      **_ambient_dict)
Mar 11 18:25:03 host weewx[12696]:     ****  TypeError: type object got multiple
values for keyword argument 'post_interval'
Mar 11 18:25:03 host weewx[12696]:     ****  Exiting.

(The line numbers may be off given that I have some local changes elsewhere in 
the
file.)

However I think the problem is in this diff:
git show 7dec60374
commit 7dec6037447fa10d68d7e8910015d733ba109b51
Author: Alf Høgemark <[email protected]>
Date:   Thu Dec 15 19:01:13 2016 +0100

    Let weewx.restx.StdWOW use post_interval=900

    The WOW API documentation says
    "
    Frequency of submitting observations

    It is recommended that the interval between automatic observations from 
your AWS
is at least 15 minutes.
    "
    Respect this by using a post_interval of 900.
    Without the post_interval, we get a HTTP status 429: Too frequent 
observations.
    And the log gets the following entries
    Dec 15 18:54:25 weather1 weewx[2400]: restx: WOW: Failed upload attempt 1: 
HTTP
Error 429: Too frequent observations.
    Dec 15 18:54:30 weather1 weewx[2400]: restx: WOW: Failed upload attempt 2: 
HTTP
Error 429: Too frequent observations.
    Dec 15 18:54:35 weather1 weewx[2400]: restx: WOW: Failed upload attempt 3: 
HTTP
Error 429: Too frequent observations.

diff --git a/bin/weewx/restx.py b/bin/weewx/restx.py
index 098d72e1..881e2e1f 100644
--- a/bin/weewx/restx.py
+++ b/bin/weewx/restx.py
@@ -683,7 +683,8 @@ class StdWOW(StdRESTful):
         _ambient_dict.setdefault('server_url', StdWOW.archive_url)
         self.archive_queue = Queue.Queue()
         self.archive_thread = WOWThread(self.archive_queue, _manager_dict,
-                                        protocol_name="WOW",
+                                        protocol_name="WOW",
+                                        post_interval=900,
                                         **_ambient_dict)
         self.archive_thread.start()
         self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)

I think this should be altered as follows to have the desired change (to set the
default to 900, but allow the user to override it in the configuration file:

diff --git a/bin/weewx/restx.py b/bin/weewx/restx.py
index 00d6c63a..3de5e72f 100644
--- a/bin/weewx/restx.py
+++ b/bin/weewx/restx.py
@@ -749,10 +749,10 @@ class StdWOW(StdRESTful):
             config_dict, 'wx_binding')

         _ambient_dict.setdefault('server_url', StdWOW.archive_url)
+        _ambient_dict.setdefault('post_interval', 900)
         self.archive_queue = Queue.Queue()
         self.archive_thread = WOWThread(self.archive_queue, _manager_dict,
                                         protocol_name="WOW",
-                                        post_interval=900,
                                         **_ambient_dict)
         self.archive_thread.start()
         self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
-- Ken


-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to