I have just created a python script that can detect that the clock has 
changed, which can be used stop WeeWX and clean the Vantage memory, when 
daylight savings happens then 1 hour later restart WeeWX

I think this code will do what I want, but can only test it twice a year, 
would appreciate someone checking my logic, and you may need to use 
something other than UTC for North America.

Also if someone has the Python commands for starting and stopping WeeWX 
that would also help

*import* pytz

*import* datetime


gmt = pytz.utc

bst = pytz.timezone("Europe/London")


gmtStartTime = datetime.datetime.now(gmt).time().replace(microsecond=0)

bstStartTime = datetime.datetime.now(bst).time().replace(microsecond=0)


*for* utc_transition_time *in* bst._utc_transition_times:

  *if* datetime.date.today() == utc_transition_time.date():

    *if* utc_transition_time.time() <= gmtStartTime <= (utc_transition_time 
+ datetime.timedelta(minutes=65)).time():

      *if* gmtStartTime < (utc_transition_time + 
datetime.timedelta(minutes=5)).time():

        print('Stop WeeWX')


      *if* gmtStartTime > (utc_transition_time + 
datetime.timedelta(hours=1)).time():

        print('Start WeeWX')


    print(datetime.date.today(), ' == ', utc_transition_time.date())

    print('  ', utc_transition_time.time(), ' <= ', gmtStartTime, ' <= ', 
(utc_transition_time + datetime.timedelta(minutes=65)).time())

    print('    ', gmtStartTime, ' <  ', (utc_transition_time + 
datetime.timedelta(minutes=5)).time())

    print('      Stop WeeWX\n')

    print('    ', gmtStartTime, ' > ', (utc_transition_time + 
datetime.timedelta(hours=1)).time())

    print('      Start WeeWX\n')

On Sunday, March 28, 2021 at 11:35:54 AM UTC+1 vigilance wx wrote:

> same issue
> I have been using weewx around 7 years with a vantage and for the most 
> part it runs flawlessly. i have version 3.9.1 running without any issues 
> just this memory problem once every 6 months in march and October
>
> On Sunday, March 28, 2021 at 10:57:03 AM UTC+1 [email protected] wrote:
>
>> snap, just posted the same message and wee_device --clear-memory was the 
>> only way I could get it running again as well.
>>
>> I want a cron job fix
>>
>> On Sunday, March 28, 2021 at 10:51:52 AM UTC+1 Alastair L wrote:
>>
>>> Hi.  Looking back at previous posts memory corruption of the Davis WS 
>>> has been discussed a fair bit.  My Pi 4 running Weewx 4.4.0 and connected 
>>> to a Vantage Pro was working without any problems until 1am this morning 
>>> when it stopped updating.  I could only get it to update again by clearing 
>>> the Vantage memory (using wee_device --clear-memory).  My Pi is fitted with 
>>> a RTC and there was no power outage last night. The only obvious thing that 
>>> may be relevant is that daylight saving time 2021 in United Kingdom began 
>>> at 01:00 on Sunday, 28 March,  the time weewx stopped updating.   I was 
>>> wondering if anyone else with a Davis WS had a similar issue if so is there 
>>> a fix?  Thanks. 
>>>
>>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/b24fd69a-8cec-4762-8a70-219798a28a07n%40googlegroups.com.

Reply via email to