I'm getting lost in where we are.
Let me try another suggestion. If you do not or cannot implement GETTIME on
the feather, how about writing a new driver that inherits from the old
vantage driver, but overrides getTime() and setTime()?
It would look something like this (NOT TESTED):
*File bin/user/dekay.py*
import weewx.drivers.vantage
DRIVER_NAME = 'Dekay'
DRIVER_VERSION = '0.0.1'
def loader(config_dict, engine):
return DekayService(engine, config_dict)
configurator_loader = weewx.drivers.vantage.configuration_loader
confeditor_loader = weewx.drivers.vantage.confeditor_loader
class DekayService(weewx.drivers.vantage.VantageService):
def getTime(self):
raise NotImplementedError("Method 'getTime' not implemented in
Dekay driver")
def setTime(self, ts):
raise NotImplementedError("Method 'setTime' not implemented in
Dekay driver")
To use, go into weewx.conf and change
driver = weewx.drivers.vantage
to
driver = user.dekay
I've probably forgotten a bunch of things, but this should get you started.
-tk
On Sun, Nov 27, 2016 at 10:19 AM, gustl319 <[email protected]> wrote:
> Am Sonntag, 27. November 2016 14:05:56 UTC+1 schrieb Tom Keffer:
>>
>> On Sun, Nov 27, 2016 at 3:53 AM, gustl319 <[email protected]> wrote:
>>
>>> I've done some code searching. Please tell me if I'm right:
>>>
>>> - on startup do_sync() is called
>>> - in do_sync() is a call to getTime()
>>> - getTime() returns the GETTIME answer
>>> - if the difference to system time is greater than max_drift (5sec)
>>> then a setTime() -> SETTIME sequence is started
>>>
>>> This is exactly right.
>>
>>
> Unfortunately real life is different :-(
>
> When I remove the GETTIME command everyting is fine. When GETTIME returns
> a yet unset time from the past I get hundreds and thousands of Requesting
> 200 LOOP packets
>
> I edited vantage.py to generate syslog entrys when there is a getTime()
> or a setTime().
> Nov 27 18:41:19 raspberrypi weewx[6839]: engine: Starting main packet loop.
> Nov 27 18:41:19 raspberrypi weewx[6839]: vantage: getTime(self)
>
> I think this getTime is not called from do_sync, but from
> StdArchiv.pre_loop via engine._get_console_time(). The time calculates
> end_archive_period_ts and end_archive_delay_ts. My guess is that an
> anchient timestamp triggers these loop requests, because of these
> period/delay values.
>
> So how does weewx recognize a batterie change in a vantage console and
> trigger a SETTIME?
>
> --
> 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.
>
--
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.