[weewx-user] Re: rtupdate.wunderground.com certificate error

2020-02-02 Thread J B
I should mention that I'm assuming that this workaround doesn't turn off 
certificate validation system-wide but I'm not well-versed enough in how 
this works to know for sure. Since the daemons are managed by root I guess 
it's possible.

On Sunday, February 2, 2020 at 9:14:24 PM UTC-8, J B wrote:
>
> Like some of you I'm still getting intermittent errors that stop weewx 
> 3.9.2 from uploading until I restart. Someone over at 
> https://apicommunity.wunderground.com/ posted this creative 
> workaround that seems to be working so far. It lowers the security of 
> python but it's better than sending everything over http.
>
> tmarschner 
> 
>
>- 2 Posts 
>-  0 Reply Likes
>
> Hi there,
>
> Here's an alternative workaround that doesn't require you to send your 
> Wunderground credentials in clear text. It turns off certificate validation 
> for python. I've tested this on weewx 3.9.2 on a Raspberry Pi (v. 9 
> Stretch) running python 2.7.13.
>
> Modify the weewx startup script /etc/init.d/weewx.
>
> Find the start-stop-daemon line that starts up weewx (the do_start 
> routine) and insert "/usr/bin/env PYTHONHTTPSVERIFY=0" into the --exec 
> parameter as shown below:
>
> start-stop-daemon --start --chuid $WEEWX_USER --pidfile $PIDFILE --exec 
> /usr/bin/env PYTHONHTTPSVERIFY=0 $DAEMON -- $DAEMON_ARGS || return 2
>
> Cheers,
> Tom
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0b003603-6086-4d16-8612-ddb526efa1b9%40googlegroups.com.


[weewx-user] Re: rtupdate.wunderground.com certificate error

2020-02-02 Thread J B
Like some of you I'm still getting intermittent errors that stop weewx 
3.9.2 from uploading until I restart. Someone over at 
https://apicommunity.wunderground.com/ posted this creative workaround that 
seems to be working so far. It lowers the security of python but it's 
better than sending everything over http.

tmarschner 


   - 2 Posts 
   -  0 Reply Likes

Hi there,

Here's an alternative workaround that doesn't require you to send your 
Wunderground credentials in clear text. It turns off certificate validation 
for python. I've tested this on weewx 3.9.2 on a Raspberry Pi (v. 9 
Stretch) running python 2.7.13.

Modify the weewx startup script /etc/init.d/weewx.

Find the start-stop-daemon line that starts up weewx (the do_start routine) 
and insert "/usr/bin/env PYTHONHTTPSVERIFY=0" into the --exec parameter as 
shown below:

start-stop-daemon --start --chuid $WEEWX_USER --pidfile $PIDFILE --exec 
/usr/bin/env PYTHONHTTPSVERIFY=0 $DAEMON -- $DAEMON_ARGS || return 2

Cheers,
Tom

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/98106b14-546a-481b-a49c-c8cf3ec19d7c%40googlegroups.com.


Re: [weewx-user] Re: rtupdate.wunderground.com certificate error

2020-02-02 Thread Brice Ruth
on the *Pi

Stupid auto correct

On Sun, Feb 2, 2020 at 9:42 PM Brice Ruth  wrote:

> So, is there a way to get 4.x on the you? Guessing I need to grab the
> source if it’s not published yet?
>
> On Sun, Feb 2, 2020 at 2:53 PM Brice Ruth  wrote:
>
>> I wonder if they forgot to update one...
>>
>> On Sat, Feb 1, 2020 at 9:57 PM Cameron D 
>> wrote:
>>
>>> I am seeing the occasional error in the logs, but running v4 beta 10 and
>>> it keeps  running and succeeds each time after the error.
>>> Errors have been:
>>>
>>>-  self-signed cert (3 times)
>>>- cert for wrong hostname (using base server name instead of
>>>wunderground's cname) (twice)
>>>- connection closed prematurely. (twice)
>>>
>>> It looks to me as if they are fiddling around with their servers.  The
>>> server DNS provides 3 IPv4 addrs so maybe we occasionally pick one they are
>>> working on and they didn't give enough time for DNS changes to filter
>>> through.
>>>
>>>
>>> On Sunday, 2 February 2020 10:12:08 UTC+10, Brice Ruth wrote:

 Is anyone else still seeing errors? It works for a bit, then fails
 enough for weewx to fail out and I have to restart...


 --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/321a1732-f7bd-4588-bc39-67e8440d80fd%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> Brice Ruth, FCD
>> Software Engineer, Madison WI
>>
> --
> Brice Ruth, FCD
> Software Engineer, Madison WI
>
-- 
Brice Ruth, FCD
Software Engineer, Madison WI

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAFbExW7_AXbUQ3pQ%3DFCH88so2VVUr0Zq-vZLh0kBnitbAKioSQ%40mail.gmail.com.


Re: [weewx-user] Re: rtupdate.wunderground.com certificate error

2020-02-02 Thread Brice Ruth
So, is there a way to get 4.x on the you? Guessing I need to grab the
source if it’s not published yet?

On Sun, Feb 2, 2020 at 2:53 PM Brice Ruth  wrote:

> I wonder if they forgot to update one...
>
> On Sat, Feb 1, 2020 at 9:57 PM Cameron D  wrote:
>
>> I am seeing the occasional error in the logs, but running v4 beta 10 and
>> it keeps  running and succeeds each time after the error.
>> Errors have been:
>>
>>-  self-signed cert (3 times)
>>- cert for wrong hostname (using base server name instead of
>>wunderground's cname) (twice)
>>- connection closed prematurely. (twice)
>>
>> It looks to me as if they are fiddling around with their servers.  The
>> server DNS provides 3 IPv4 addrs so maybe we occasionally pick one they are
>> working on and they didn't give enough time for DNS changes to filter
>> through.
>>
>>
>> On Sunday, 2 February 2020 10:12:08 UTC+10, Brice Ruth wrote:
>>>
>>> Is anyone else still seeing errors? It works for a bit, then fails
>>> enough for weewx to fail out and I have to restart...
>>>
>>>
>>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/321a1732-f7bd-4588-bc39-67e8440d80fd%40googlegroups.com
>> 
>> .
>>
> --
> Brice Ruth, FCD
> Software Engineer, Madison WI
>
-- 
Brice Ruth, FCD
Software Engineer, Madison WI

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAFbExW6d3cWOP%2BsRScEUWd0q3a2Ah-TYWoRNa%3DWC-1h84RFDPQ%40mail.gmail.com.


[weewx-user] Re: New sensor - WT0124 Pool Thermometer

2020-02-02 Thread Iain Grant
Sorry, I should have added

DRIVER_NAME = 'SDR'
DRIVER_VERSION = '0.75'

ig.

On Sunday, February 2, 2020 at 10:24:41 PM UTC-5, Iain Grant wrote:
>
> I'm hoping you can help me also.  I have the pool sensor and it's being 
> captured and decoded fine.  But it isn't being ingested.
>
> Here's what I'm receiving..
>
>  u'{"time" : "2020-02-03 02:36:11", "model" : "WT0124 Pool Thermometer", 
> "rid" : 169, "channel" : 3, "temperature_C" : 1.300, "mic" : "CHECKSUM", 
> "data" : 49}\n', 
>
> it looked like there might have been an extra comma in the known packets
>
> WT0124Packet,
> ]
>
> but that still didn't seem to help.  Any idea what I'm doing wrong?
>
> Thank you.
>
>
>
> On Tuesday, April 23, 2019 at 9:49:26 AM UTC-4, Andy wrote:
>>
>> From here .
>>
>> Try this untested
>>
>> Andy
>>
>>
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/43c9359d-9f44-4328-843a-ff52d4a373f9%40googlegroups.com.


[weewx-user] Re: New sensor - WT0124 Pool Thermometer

2020-02-02 Thread Iain Grant
I'm hoping you can help me also.  I have the pool sensor and it's being 
captured and decoded fine.  But it isn't being ingested.

Here's what I'm receiving..

 u'{"time" : "2020-02-03 02:36:11", "model" : "WT0124 Pool Thermometer", 
"rid" : 169, "channel" : 3, "temperature_C" : 1.300, "mic" : "CHECKSUM", 
"data" : 49}\n', 

it looked like there might have been an extra comma in the known packets

WT0124Packet,
]

but that still didn't seem to help.  Any idea what I'm doing wrong?

Thank you.



On Tuesday, April 23, 2019 at 9:49:26 AM UTC-4, Andy wrote:
>
> From here .
>
> Try this untested
>
> Andy
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/1bf01b8b-b978-4e06-9a98-be628e838498%40googlegroups.com.


[weewx-user] Re: users guide for python3 installation

2020-02-02 Thread Susan Mackay
I run WeeWx on a RPi zero w (plus other weather-related software plus the 
web server) and it idles along (I've seen some peaks of about 70% CPU but 
mostly idle between the 5-minute bursts. Even the web access only accounts 
for a few percent of CPU).
The RPi 4 is a nice device (I've just got on to play with) but I think it 
will be a waste if you are thinking of dedicating it to the WeeWx app.
Do you have a NAS or some other computer that is always on? If so then you 
can use that for the WeeWx database and web files so that you don't 'wear 
out' the SD card. (Also keeping the log files there or in a memory disk 
image can significantly reduce the wear.)
Susan

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/3881d557-d887-45f3-9728-9c5acfb5ba5e%40googlegroups.com.


[weewx-user] Re: Pyehpem and International Space Station

2020-02-02 Thread Susan Mackay
Also consider using SkyField instead of PyEphem as it is newer and 
supported.
Look at https://rhodesmill.org/skyfield/earth-satellites.html and the 
example under the title 'Finding when a satellite rises and sets'
Susan

On Sunday, February 2, 2020 at 11:21:29 AM UTC+11, Kevin Davis wrote:
>
> Has anybody played with adding upcoming sightings to there page?
>
> Adding it to pyehpem seems easy enough, just brainstorming a way to loop 
> through to produce the next X number of sightings. 
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/dd7c0dc8-8388-4308-917a-ab8f03420740%40googlegroups.com.


Re: [weewx-user] Re: templating with cheetah for last 2 days

2020-02-02 Thread Thomas Keffer
I had completely forgotten about the .spans() iterator!

Well done!

On Sun, Feb 2, 2020 at 11:36 AM Hyrules Hyrules  wrote:

> Actually it's quite easy for those who would like to do it here is the
> code for the search list extension. All I need is to remove the first spans
> in the list and voila. This gives me all spans in intervals of 15 minutes
> from 2 days ago to closes quarter to now.
>
> # BASED ON BELCHERTOWN PYTHON FILE START
>
> from __future__ import with_statement
> import datetime
> import time
> import calendar
> import json
> import os
> import os.path
> import syslog
> import sys
> import locale
>
> import weewx
> import weecfg
> import configobj
> import weedb
> import weeutil.weeutil
> import weewx.reportengine
> import weewx.station
> import weewx.units
> import weewx.tags
> import weewx.uwxutils
>
> from collections import OrderedDict
>
> from weewx.cheetahgenerator import SearchList
> from weewx.tags import TimespanBinder
> from weeutil.weeutil import to_bool, TimeSpan, to_int, archiveDaySpan,
> archiveWeekSpan, archiveMonthSpan, archiveYearSpan, startOfDay,
> timestamp_to_string, option_as_list
> try:
>from weeutil.config import search_up
> except:
># Pass here because chances are we have an old version of weewx which
> will get caught below.
> pass
>
> # Check weewx version. Many things like search_up, weeutil.weeutil.KeyDict
> (label_dict) are from 3.9
> if weewx.__version__ < "3.9":
>raise weewx.UnsupportedFeature("weewx 3.9 and newer is required, found
> %s" % weewx.__version__)
>
> reload(sys)
> sys.setdefaultencoding("utf-8")
>
> def logmsg(level, msg):
>syslog.syslog(level, 'Hydrometeo Extension: %s' % msg)
>
> def logdbg(msg):
>logmsg(syslog.LOG_DEBUG, msg)
>
> def loginf(msg):
>logmsg(syslog.LOG_INFO, msg)
>
> def logerr(msg):
>logmsg(syslog.LOG_ERR, msg)
>
> # Print version in syslog for easier troubleshooting
> VERSION = "0.1"
> loginf("version %s" % VERSION)
>
> class HydroMeteoStats(SearchList):
>def __init__(self, generator):
>SearchList.__init__(self, generator)
>
> def get_extension_list(self, timespan, db_lookup):
> today = datetime.datetime.now()
>twodaysago = datetime.datetime.now() - datetime.timedelta(days=2)
>
>twodaysago = twodaysago.replace(hour=00, minute=00, second=00,
> microsecond=00) #.strftime("%Y-%m-%d %H:%M:%S")
>
>tsb = TimespanBinder(TimeSpan(time.mktime(twodaysago.timetuple()),
> time.mktime(today.timetuple())), db_lookup,formatter=self.generator.formatter,
> converter=self.generator.converter)
>spans = tsb.spans(interval=900)
>last2days = spans
>
> search_list_extension = {'last2days' : last2days}
>
> return [search_list_extension]
>
>
>
> On Saturday, February 1, 2020 at 12:42:45 PM UTC-5, Hyrules Hyrules wrote:
>>
>> Hi everyone,
>>
>> I was wondering if there is an actual way of doing this in the cheetah
>> templating engine.
>>
>> I would like to get the following information in my file :
>>
>> - last 2 days of archive
>> - starting at midnight and 15 minutes
>> - in intervals of 15 minutes
>> - all through today closest to the quarter of the hour (eg if it's 12:47
>> -> 12:45, 1:24 -> 1:15)
>>
>> I'm not sure if it's possible using the pre-existing $span or $day
>> variables. I`ve been trying some stuff apparently unsucessfully.
>>
>> Any input would be appreciated.
>>
>> 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 weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/7b7cbbca-2d25-493f-a77c-2169be26b6f4%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAJ9fE9rYCW7hWno7O6rjMaB4F_mBCY88a5Yy7vPPq%2BLQ%40mail.gmail.com.


[weewx-user] Re: users guide for python3 installation

2020-02-02 Thread david glenn
thank you all for the encouragement and ideas.   The gist of the posts is 
go with the python 2.7 and version 3 of weewx.  That is probably the safest 
since the only 2 statements I know in python 3 are exit() = exit and print 
= print().  If I find the model 2 RPi unstable I'll go for the newer RPi 
model 4.  I have several model 2 B RPi's.  I discovered pi's just as the 
model 2 was released and went a little over-board with projects and 
purchases.  $35-55 isn't going to kill me for a new pi but I do have a 
loyalty to raspberry pi and hate to toss good hardware.  Good advice about 
the power supply and SD card-thanks

Again, thanks for the time and expertise to respond.  David


On Sunday, February 2, 2020 at 9:52:51 AM UTC-5, david glenn wrote:
>
> I am new to weewx and have very basic linux and python skills.  I'd like 
> to run weewx on windows 10 with python 3.7.  I've read the 'Python 3 
> strategy' in the users group and it's outside my skill level.  The users 
> guide for 2.7 seems very straightforward and meets the guide statement of " 
> Ability 
> to do simple Unix tasks such as changing file permissions and running 
> commands".  that I can do.  Has an installation guide been developed for 
> Windows 10 and python 3 and where can I find it?
>
> To introduce myself, I am a retired research plant physiologist.  I built 
> a raspberry pi weather station and developed the code for it to monitor the 
> external weather as well as conditions in a small greenhouse.  After a year 
> or so I decided that many of the sensors were unreliable so I purchased a 
> Davis Vantage Pro unit and will use weewx to manage the data.  
>
> I realize I could subscribe to the WeatherLInk Pro site and obtain what I 
> want but I'd prefer to develop it myself (with your help).  As a colleague 
> once wrote "what fun is it if it works out of the box".  My alternative is 
> to use a RPI with python 2.7 and a samba server to shuttle the data to my 
> PC but I'd rather handle it directly on the PC if possible.  I looked into 
> downloading Python 2.7 on the WIN10 PC and it seems python.org no longer 
> provides it because it is being phased-out.
>
> I greatly appreciate the time in helping me get started and any advice on 
> my strategy,  David
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/435c13ff-ca1f-44d6-ab75-1c1fee232025%40googlegroups.com.


Re: [weewx-user] Re: rtupdate.wunderground.com certificate error

2020-02-02 Thread Brice Ruth
I wonder if they forgot to update one...

On Sat, Feb 1, 2020 at 9:57 PM Cameron D  wrote:

> I am seeing the occasional error in the logs, but running v4 beta 10 and
> it keeps  running and succeeds each time after the error.
> Errors have been:
>
>-  self-signed cert (3 times)
>- cert for wrong hostname (using base server name instead of
>wunderground's cname) (twice)
>- connection closed prematurely. (twice)
>
> It looks to me as if they are fiddling around with their servers.  The
> server DNS provides 3 IPv4 addrs so maybe we occasionally pick one they are
> working on and they didn't give enough time for DNS changes to filter
> through.
>
>
> On Sunday, 2 February 2020 10:12:08 UTC+10, Brice Ruth wrote:
>>
>> Is anyone else still seeing errors? It works for a bit, then fails enough
>> for weewx to fail out and I have to restart...
>>
>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/321a1732-f7bd-4588-bc39-67e8440d80fd%40googlegroups.com
> 
> .
>
-- 
Brice Ruth, FCD
Software Engineer, Madison WI

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAFbExW4Z-UtGxhyFDtW%2BL710zz4ks3iPydzUiazz74WuRvVV%2Bg%40mail.gmail.com.


[weewx-user] Re: templating with cheetah for last 2 days

2020-02-02 Thread Hyrules Hyrules
Actually it's quite easy for those who would like to do it here is the code 
for the search list extension. All I need is to remove the first spans in 
the list and voila. This gives me all spans in intervals of 15 minutes from 
2 days ago to closes quarter to now.

# BASED ON BELCHERTOWN PYTHON FILE START

from __future__ import with_statement
import datetime
import time
import calendar
import json
import os
import os.path
import syslog
import sys
import locale

import weewx
import weecfg
import configobj
import weedb
import weeutil.weeutil
import weewx.reportengine
import weewx.station
import weewx.units
import weewx.tags
import weewx.uwxutils

from collections import OrderedDict

from weewx.cheetahgenerator import SearchList
from weewx.tags import TimespanBinder
from weeutil.weeutil import to_bool, TimeSpan, to_int, archiveDaySpan, 
archiveWeekSpan, archiveMonthSpan, archiveYearSpan, startOfDay, 
timestamp_to_string, option_as_list
try:
   from weeutil.config import search_up
except:
   # Pass here because chances are we have an old version of weewx which 
will get caught below. 
pass
   
# Check weewx version. Many things like search_up, weeutil.weeutil.KeyDict 
(label_dict) are from 3.9
if weewx.__version__ < "3.9":
   raise weewx.UnsupportedFeature("weewx 3.9 and newer is required, found %s
" % weewx.__version__)   

reload(sys)
sys.setdefaultencoding("utf-8")

def logmsg(level, msg):
   syslog.syslog(level, 'Hydrometeo Extension: %s' % msg)

def logdbg(msg):
   logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
   logmsg(syslog.LOG_INFO, msg)

def logerr(msg):
   logmsg(syslog.LOG_ERR, msg)

# Print version in syslog for easier troubleshooting
VERSION = "0.1"
loginf("version %s" % VERSION)

class HydroMeteoStats(SearchList):
   def __init__(self, generator):
   SearchList.__init__(self, generator)

def get_extension_list(self, timespan, db_lookup):   
today = datetime.datetime.now()
   twodaysago = datetime.datetime.now() - datetime.timedelta(days=2)
   
   twodaysago = twodaysago.replace(hour=00, minute=00, second=00,
microsecond=00) #.strftime("%Y-%m-%d %H:%M:%S")
   
   tsb = TimespanBinder(TimeSpan(time.mktime(twodaysago.timetuple()), 
time.mktime(today.timetuple())), db_lookup,formatter=self.generator.formatter, 
converter=self.generator.converter)
   spans = tsb.spans(interval=900)
   last2days = spans

search_list_extension = {'last2days' : last2days}

return [search_list_extension]



On Saturday, February 1, 2020 at 12:42:45 PM UTC-5, Hyrules Hyrules wrote:
>
> Hi everyone,
>
> I was wondering if there is an actual way of doing this in the cheetah 
> templating engine.
>
> I would like to get the following information in my file :
>
> - last 2 days of archive
> - starting at midnight and 15 minutes
> - in intervals of 15 minutes
> - all through today closest to the quarter of the hour (eg if it's 12:47 
> -> 12:45, 1:24 -> 1:15)
>
> I'm not sure if it's possible using the pre-existing $span or $day 
> variables. I`ve been trying some stuff apparently unsucessfully. 
>
> Any input would be appreciated.
>
> 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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/7b7cbbca-2d25-493f-a77c-2169be26b6f4%40googlegroups.com.


Re: [weewx-user] Re: users guide for python3 installation

2020-02-02 Thread p q
I agree 100%.  I'm still running an old version of weewx but I'm going to
move to 4 on python3 in the next couple of months. I'm going to do all the
testing on a virtual machine to make the transition on my real station as
smooth as possible.

Anyway, made a new temp sensor for my installation and wrote it up here:
https://hackaday.io/project/101680-solar-powered-wifi-temperature-sensor-for-weewx
I'm
not saying this is the right way to do it, but it is a way. I'm sure you
can find other examples.

On Sun, Feb 2, 2020 at 9:22 AM vince  wrote:

> On Sunday, February 2, 2020 at 6:52:51 AM UTC-8, david glenn wrote:
>>
>> I've read the 'Python 3 strategy' in the users group and it's outside my
>> skill level.
>>
>
>
>> To introduce myself, I am a retired research plant physiologist.  I built
>> a raspberry pi weather station and developed the code for it to monitor the
>> external weather as well as conditions in a small greenhouse.  After a year
>> or so I decided that many of the sensors were unreliable so I purchased a
>> Davis Vantage Pro unit and will use weewx to manage the data.
>>
>>
> Then weewx is 'definitely' inside your skill level if you're willing to
> work a 'little' to get the minimal basic Linux skills needed to run a pi
> reliably.
>
> Don't sweat python2 versus python3.  It's just about solved in the weewx
> world.  Lots of us are running the beta of weewx-v4 with python3 on pi with
> no problems.
>
> You didn't mention which model pi you built your home-made station on, but
> if it's a pi3 or later you will have a 'very' stable pi-based system as
> long as:
>
>- you have a quality USB power supply
>- you have a quality microSD card
>
> I might add lots of people build Arduino-based tiny sensors and sprinkle
> them around the house and out buildings etc. and integrate them with the pi
> running weewx.   I have a bunch of those monitoring the temperature in
> various rooms.  You can also do this with a remote pi as well if you have
> some of those laying around.
>
> Take your pi, install weewx v4 beta on it running the Simulator.  Get your
> feet wet.  It works.
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/648809aa-9d91-4024-afba-6a1395450228%40googlegroups.com
> 
> .
>


-- 
Peter Quinn
(415)794-2264

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAA1SM20w%2BfNt_XCzhTk4F76PrhFaR19ZAjo8Lx0QDnQag0D%2BLA%40mail.gmail.com.


[weewx-user] Re: users guide for python3 installation

2020-02-02 Thread vince
On Sunday, February 2, 2020 at 6:52:51 AM UTC-8, david glenn wrote:
>
> I've read the 'Python 3 strategy' in the users group and it's outside my 
> skill level.
>
  

> To introduce myself, I am a retired research plant physiologist.  I built 
> a raspberry pi weather station and developed the code for it to monitor the 
> external weather as well as conditions in a small greenhouse.  After a year 
> or so I decided that many of the sensors were unreliable so I purchased a 
> Davis Vantage Pro unit and will use weewx to manage the data.  
>
>
Then weewx is 'definitely' inside your skill level if you're willing to 
work a 'little' to get the minimal basic Linux skills needed to run a pi 
reliably.

Don't sweat python2 versus python3.  It's just about solved in the weewx 
world.  Lots of us are running the beta of weewx-v4 with python3 on pi with 
no problems.

You didn't mention which model pi you built your home-made station on, but 
if it's a pi3 or later you will have a 'very' stable pi-based system as 
long as:

   - you have a quality USB power supply
   - you have a quality microSD card

I might add lots of people build Arduino-based tiny sensors and sprinkle 
them around the house and out buildings etc. and integrate them with the pi 
running weewx.   I have a bunch of those monitoring the temperature in 
various rooms.  You can also do this with a remote pi as well if you have 
some of those laying around.

Take your pi, install weewx v4 beta on it running the Simulator.  Get your 
feet wet.  It works.
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/648809aa-9d91-4024-afba-6a1395450228%40googlegroups.com.


[weewx-user] Re: users guide for python3 installation

2020-02-02 Thread mwall
hi david,

although python 2.7 works just fine, and will continue to work just fine, 
all new development is done in python3.

we will ensure that weewx4 works with both python2 and python3, but at some 
point there will probably be a version of weewx (weewx5?) that is python3 
only.  at some point it is just too cumbersome to maintain backward 
compatibility - it increases the number of configuration/platform options, 
which results in many more configurations that have to be tested.

although it is possible to run weewx3 reliably on windows using python2.7, 
that requires some hacking.

weewx4 *should* be easier to run on windows, due primarily to the use of 
the python logger instead of syslog.  however, there are still many usb 
issues that must be tested in order to make every weewx extension run 
reliably on windows.  (to a lesser extent this is also true for macosx)

if you want to build a system right now, i would recommend that you use 
weewx3 and python 2.7 on a debian flavor of linux.

when weewx4 comes out (real soon now!) you will be able to upgrade weewx 
with little hassle, then later upgrade to python3 whenever you are ready 
for that step (mostly gated by when the weewx extensions that you need have 
been updated to work with python3).

making weewx4 work on windows will probably happen at some point, but it is 
not a high priority right now.

m

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/ccefd40f-988a-446c-86fc-44a47f76dac4%40googlegroups.com.


[weewx-user] Re: users guide for python3 installation

2020-02-02 Thread vince
On Sunday, February 2, 2020 at 8:37:40 AM UTC-8, Rich Altmaier wrote:
>
> I got tired of my RPI freezing every 2 months. 
>
>
>
Well there are hundreds of pi users here who could have helped you, some 
with pi that have been up literally years without problems.

But sure, throw a $500 computer at a $30 problem and you will certainly 
solve it.
(big NUC fan here with two of those two - great little boxes).
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/7061f2be-5aac-4a8b-bfd0-6bdb0f576f9c%40googlegroups.com.


[weewx-user] Re: users guide for python3 installation

2020-02-02 Thread Andrew Milner
None of my 5 RPis - of different models - has ever exhibited freezing at 2 
monthly intervals so I suspect you had something else causing your 
problem(s).



On Sunday, 2 February 2020 18:37:40 UTC+2, Rich Altmaier wrote:
>
> Hi David, perhaps noone will agree with me but I suggest swapping the RPI 
> for an Intel NUC.  You can get a used one on ebay very reasonably.   The 
> reliability is much greater. I got tired of my RPI freezing every 2 months. 
> And need I say the NUC is 20 to 50 times faster?  Loading multiple years 
> of weewx database transfer on RPI, 2 minutes. On NUC, 2 seconds.  Do you 
> believe me?
>
> Good luck!
> Rich
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/557ed271-0c46-48c9-8f67-f4d906377b46%40googlegroups.com.


[weewx-user] users guide for python3 installation

2020-02-02 Thread 'Rich Altmaier' via weewx-user
Hi David, perhaps noone will agree with me but I suggest swapping the RPI for 
an Intel NUC.  You can get a used one on ebay very reasonably.   The 
reliability is much greater. I got tired of my RPI freezing every 2 months. 
And need I say the NUC is 20 to 50 times faster?  Loading multiple years of 
weewx database transfer on RPI, 2 minutes. On NUC, 2 seconds.  Do you believe 
me?

Good luck!
Rich

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/4786f05d-eb87-405d-a915-85f5296dce71%40googlegroups.com.


Re: [weewx-user] templating with cheetah for last 2 days

2020-02-02 Thread Hyrules Hyrules
this is what I have at the moment. I'm getting close. Just need to process 
the data I get from the SQL.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/28b79fa5-72a7-471d-85fa-9fd6418473b0%40googlegroups.com.
# BASED ON BELCHERTOWN PYTHON FILE START

from __future__ import with_statement
import datetime
import time
import calendar
import json
import os
import os.path
import syslog
import sys
import locale

import weewx
import weecfg
import configobj
import weedb
import weeutil.weeutil
import weewx.reportengine
import weewx.station
import weewx.units
import weewx.tags
import weewx.uwxutils

from collections import OrderedDict

from weewx.cheetahgenerator import SearchList
from weewx.tags import TimespanBinder
from weeutil.weeutil import to_bool, TimeSpan, to_int, archiveDaySpan, archiveWeekSpan, archiveMonthSpan, archiveYearSpan, startOfDay, timestamp_to_string, option_as_list
try:
	from weeutil.config import search_up
except:
	# Pass here because chances are we have an old version of weewx which will get caught below. 
	pass

# Check weewx version. Many things like search_up, weeutil.weeutil.KeyDict (label_dict) are from 3.9
if weewx.__version__ < "3.9":
	raise weewx.UnsupportedFeature("weewx 3.9 and newer is required, found %s" % weewx.__version__)   

reload(sys)
sys.setdefaultencoding("utf-8")

def logmsg(level, msg):
	syslog.syslog(level, 'Hydrometeo Extension: %s' % msg)

def logdbg(msg):
	logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
	logmsg(syslog.LOG_INFO, msg)

def logerr(msg):
	logmsg(syslog.LOG_ERR, msg)

# Print version in syslog for easier troubleshooting
VERSION = "0.1"
loginf("version %s" % VERSION)

class HydroMeteoStats(SearchList):
def __init__(self, generator):
SearchList.__init__(self, generator)

def get_extension_list(self, timespan, db_lookup):
		binding = self.generator.config_dict['StdReport'].get('data_binding', 'wx_binding')
		manager = self.generator.db_binder.get_manager(binding)  
		wx_manager = db_lookup()

		twodaysago = datetime.datetime.now() - datetime.timedelta(days=2)
		
		twodaysago = twodaysago.replace(hour=00, minute=15, second=00) #.strftime("%Y-%m-%d %H:%M:%S")
		loginf(twodaysago)
		last2days = wx_manager.genSql("SELECT * FROM archive WHERE (FROM_UNIXTIME(dateTime) >= '%s' AND FROM_UNIXTIME(dateTime) <= NOW()) AND MOD(MINUTE(FROM_UNIXTIME(dateTime)),15) = 0;" % twodaysago)

		search_list_extension = {'last2days' : last2days}

		return [search_list_extension]


Re: [weewx-user] templating with cheetah for last 2 days

2020-02-02 Thread Hyrules Hyrules
Basically that's what i`ve been trying to do since i`ve posted this 
message. I will see how I can implement that with python. I will try to 
create my own skin with some python functions.

I have been able to run a custom SQL on the weewx database and return 
exactly what I want (in a search list extension) but i have yet to 
transform that into something that the cheetah engine understand and 
think is a valuehelper in order for me to process in the engine. I'm not an 
expert in python but It's not really hard to learn and understand. I know a 
few programming languages myself.
In order to be able to use the value I will need to process each record to 
convert the value to the required units (eg : farenheit to celsius ) and 
the transform that to a ValueHelper.

Thanks for the tip

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0d3cf814-6d6f-4281-8a09-4ae1e277abc2%40googlegroups.com.


[weewx-user] users guide for python3 installation

2020-02-02 Thread david glenn
I am new to weewx and have very basic linux and python skills.  I'd like to 
run weewx on windows 10 with python 3.7.  I've read the 'Python 3 strategy' 
in the users group and it's outside my skill level.  The users guide for 
2.7 seems very straightforward and meets the guide statement of " Ability 
to do simple Unix tasks such as changing file permissions and running 
commands".  that I can do.  Has an installation guide been developed for 
Windows 10 and python 3 and where can I find it?

To introduce myself, I am a retired research plant physiologist.  I built a 
raspberry pi weather station and developed the code for it to monitor the 
external weather as well as conditions in a small greenhouse.  After a year 
or so I decided that many of the sensors were unreliable so I purchased a 
Davis Vantage Pro unit and will use weewx to manage the data.  

I realize I could subscribe to the WeatherLInk Pro site and obtain what I 
want but I'd prefer to develop it myself (with your help).  As a colleague 
once wrote "what fun is it if it works out of the box".  My alternative is 
to use a RPI with python 2.7 and a samba server to shuttle the data to my 
PC but I'd rather handle it directly on the PC if possible.  I looked into 
downloading Python 2.7 on the WIN10 PC and it seems python.org no longer 
provides it because it is being phased-out.

I greatly appreciate the time in helping me get started and any advice on 
my strategy,  David


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fcc9d47e-923b-41f7-8560-2084f5b39da2%40googlegroups.com.


Re: [weewx-user] templating with cheetah for last 2 days

2020-02-02 Thread Thomas Keffer
I can't think of anyway of doing this either with the existing tag system.
Essentially, you're asking for a new iteration and aggregation period: 15
minutes.

If you know Python, you could try writing a search list extension
, but it would
not be a simple one.  You'd want it to allow something like

#for $chunk in $chunk15
The average temperature is: $chunk.outTemp
#end for

where chunk15 is your extension. This is not easy, because it would have to
return an iterator, as well as allow observation types as an attribute.

Sorry!

-tk




On Sat, Feb 1, 2020 at 9:42 AM Hyrules Hyrules  wrote:

> Hi everyone,
>
> I was wondering if there is an actual way of doing this in the cheetah
> templating engine.
>
> I would like to get the following information in my file :
>
> - last 2 days of archive
> - starting at midnight and 15 minutes
> - in intervals of 15 minutes
> - all through today closest to the quarter of the hour (eg if it's 12:47
> -> 12:45, 1:24 -> 1:15)
>
> I'm not sure if it's possible using the pre-existing $span or $day
> variables. I`ve been trying some stuff apparently unsucessfully.
>
> Any input would be appreciated.
>
> 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 weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/2a33be30-0298-4634-8064-429ff27c2101%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAseDVW1oKb10S9mGWo2YggNoJzqSTeDuDhOKH5dLjzZw%40mail.gmail.com.


[weewx-user] Re: Gravity AS3935 lightning detector

2020-02-02 Thread Giuseppe Saia


This project that explains in detail the inclusion in weewx as an extension 
has already been created in a splendid way by mwall for a lightning 
detection sensor called mod 1016 by filling in a file already available to 
everyone in github. This, logically, does not work for the gravity sensor 
as3935. Could anyone help me please?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/c628a1e0-289a-4dee-8086-1b1b21e84a1f%40googlegroups.com.


[weewx-user] Re: Gravity AS3935 lightning detector

2020-02-02 Thread Giuseppe Saia


Il giorno domenica 2 febbraio 2020 12:25:07 UTC+1, Giuseppe Saia ha scritto:
>
> Good morning and good Sunday to everyone
> I recently purchased the DFrobot gravity detection sensor. after having 
> connected it correctly to the raspberry pi 3b + and having verified the 
> correct operation with the command sudo i2cdetect -y 1 I would like to 
> implement on weewx the fields lightning_strikes and avg_distance to each 
> archive record.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/6948e6f1-7765-4ff9-8164-5d5ba529554c%40googlegroups.com.


[weewx-user] Gravity AS3935 lightning detector

2020-02-02 Thread Giuseppe Saia
Good morning and good Sunday to everyone
I recently purchased the DFrobot gravity detection sensor. after having 
connected it correctly to the raspberry pi 3b + and having verified the 
correct operation with the command sudo i2cdetect -y 1 I would like to 
implement on weewx the fields lightning_strikes and avg_distance to each 
archive record.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/4c8bebea-1f57-4760-9f72-aa1b02580736%40googlegroups.com.