Re: [weewx-user] Python versions

2020-05-09 Thread Tom Keffer
I can't think of any reason why I changed the stack trace from INFO to DEBUG. I've changed it back again. -tk On Sat, May 9, 2020 at 1:59 PM Colin Larsen wrote: > Perfect, thank you sir, case closed :) > > And again many thanks for all the work that goes into this project. > > On Sun, 10 May

Re: [weewx-user] Python versions

2020-05-09 Thread Colin Larsen
Perfect, thank you sir, case closed :) And again many thanks for all the work that goes into this project. On Sun, 10 May 2020, 08:55 gjr80, wrote: > A couple of things happened in WeeWX 4, a fair amount of code was moved > from engine.py to weewxd, this included the code that adds the stack

Re: [weewx-user] Python versions

2020-05-09 Thread gjr80
A couple of things happened in WeeWX 4, a fair amount of code was moved from engine.py to weewxd, this included the code that adds the stack trace on exit, plus WeeWX logging changed from using the syslog package to using the logging package. Under 3.9.2 the stack trace on exit was sent to the

Re: [weewx-user] Python versions

2020-05-09 Thread Colin Larsen
Thanks Gary, does that mean that it's just peculiar to my setup? I haven't heard of any others reporting it. Good to know it's nothing serious :) Colin On Sun, 10 May 2020, 08:25 gjr80, wrote: > There is no error. It is an informational stack trace on WeeWX exit and it > cannot be turned off

Re: [weewx-user] Python versions

2020-05-09 Thread gjr80
There is no error. It is an informational stack trace on WeeWX exit and it cannot be turned off without modifying the code base. Gary -- 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

Re: [weewx-user] Python versions

2020-05-09 Thread Colin Larsen
Hi gents Is there anything I can do for the error I posted above that only seems to happen on Weewx service stop? Thanks Colin On Fri, 8 May 2020, 11:00 gjr80, wrote: > Good, I have submitted a PR for the change to the repo owner. > > Gary > > On Thursday, 7 May 2020 17:32:49 UTC+10, Greg

Re: [weewx-user] Python versions

2020-05-07 Thread gjr80
Good, I have submitted a PR for the change to the repo owner. Gary On Thursday, 7 May 2020 17:32:49 UTC+10, Greg from Oz wrote: > > Hi Gary, > > I add the highlighted text you suggested into line 277 > of gauge-data.txt.tmpl > so it in now like this: > #if $hour.rain.sum.raw is not None and

Re: [weewx-user] Python versions

2020-05-07 Thread Greg from Oz
Hi Gary, I add the highlighted text you suggested into line 277 of gauge-data.txt.tmpl so it in now like this: #if $hour.rain.sum.raw is not None and $hour.rain.sum.raw > $hourlyrainTH and I had no errors and the gauges have now appeared. So it works. I don't think I could have worked that one

Re: [weewx-user] Python versions

2020-05-07 Thread Greg from Oz
Thanks Gary. All this is a learning curve for me. I will have a crack at this tomorrow and see what happens. I worked out most of the other things that didn't work by trial and error (mostly error) I wasn't in a hurry to get the gauges to work and I know you would be busy looking at other more

Re: [weewx-user] Python versions

2020-05-07 Thread gjr80
As you are no doubt aware by now tracking down python errors that occur in a template (as distinct from python errors in a SLE or the WeeWX code base) can be a real pain as we can't reconcile the line number given in the error message with any source code. The following line tells us the error

Re: [weewx-user] Python versions

2020-05-06 Thread Colin Larsen
That fixed it - thanks!! My only error now is the one at service stop - no eros reported at start or while running May 7 16:24:53 raspberrypi systemd[1]: Stopping LSB: weewx weather system... May 7 16:24:53 raspberrypi weewx[10196] INFO __main__: Received signal TERM (15). May 7 16:24:53

Re: [weewx-user] Python versions

2020-05-06 Thread Tom Keffer
Missed that. Give it another try: https://raw.githubusercontent.com/tkeffer/weewx-owm/master/bin/user/owm.py -tk On Wed, May 6, 2020 at 4:57 PM Colin Larsen wrote: > Whoops - nope, now getting this error from owm.py > > May 7 11:55:15 raspberrypi weewx[4010] ERROR weewx.restx: OWM: >

Re: [weewx-user] Python versions

2020-05-06 Thread Colin Larsen
Whoops - nope, now getting this error from owm.py May 7 11:55:15 raspberrypi weewx[4010] ERROR weewx.restx: OWM: Unexpected exception of type May 7 11:55:15 raspberrypi weewx[4010] ERROR weewx.restx: *** Traceback (most recent call last): May 7 11:55:15 raspberrypi weewx[4010] ERROR

Re: [weewx-user] Python versions

2020-05-06 Thread Colin Larsen
That seems to have fixed owm - thanks! Getting this error on a restart - but no errors during the start itself May 7 11:53:05 raspberrypi weewx[3923] INFO weewx.engine: Main loop exiting. Shutting engine down. May 7 11:53:05 raspberrypi weewx[3923] INFO __main__: Terminating weewx version

Re: [weewx-user] Python versions

2020-05-06 Thread Greg from Oz
Thanks Tom, I am converting to python3 and I am know nothing about python at all so going through the code manually for me was not an option. I just used the 2to3 and if it worked then it was ok if it didn't then I just had to delve deeper or contact the author. I built a 20.04 server Ubuntu

Re: [weewx-user] Python versions

2020-05-06 Thread Tom Keffer
The problem with 2to3 is that the results are Python 3 only. The tool python-modernize does a little better and its results will run under 2 or 3, but they will also depend on the library 'six'. Drivers and uploaders are especially tricky

Re: [weewx-user] Python versions

2020-05-06 Thread Greg from Oz
I have run a program called 2to3 python converter program on some of the python2 scripts and it fixed most of the problems and did the conversion to the python3 syntax. example: 2to3 -w /usr/share/weewx/user/owm.py On Wednesday, 6 May 2020 12:31:23 UTC+10, Colin Larsen wrote: > > Fixed that

Re: [weewx-user] Python versions

2020-05-06 Thread Tom Keffer
I did a quick port. Try this version of owm.py: https://raw.githubusercontent.com/tkeffer/weewx-owm/master/bin/user/owm.py On Wed, May 6, 2020 at 2:23 PM Colin Larsen wrote: > Righto, back to Python2 it is, apologies for asking but hadn't seen this > one before. > > Cheers and thanks > Colin >

Re: [weewx-user] Python versions

2020-05-06 Thread Colin Larsen
Righto, back to Python2 it is, apologies for asking but hadn't seen this one before. Cheers and thanks Colin On Thu, 7 May 2020, 02:32 vince, wrote: > On Tuesday, May 5, 2020 at 7:31:23 PM UTC-7, Colin Larsen wrote: >> >> >> May 6 14:29:07 raspberrypi weewx[6896] CRITICAL __main__:

Re: [weewx-user] Python versions

2020-05-06 Thread vince
On Tuesday, May 5, 2020 at 7:31:23 PM UTC-7, Colin Larsen wrote: > > > May 6 14:29:07 raspberrypi weewx[6896] CRITICAL __main__: > except > KeyError, e: > > May 6 14:29:07 raspberrypi weewx[6896] CRITICAL __main__: > ^ > > May 6 14:29:07 raspberrypi

Re: [weewx-user] Python versions

2020-05-05 Thread Colin Larsen
Fixed that one with; sudo python3 -m pip install paho-mqtt Now I have an error that looks like it is Open Wetaher map? May 6 14:29:07 raspberrypi weewx[6896] CRITICAL __main__: Caught unrecoverable exception: May 6 14:29:07 raspberrypi weewx[6896] CRITICAL __main__: invalid syntax

Re: [weewx-user] Python versions

2020-05-05 Thread Colin Larsen
Still going .. Installed the new mqtt and now get this error May 6 14:16:47 raspberrypi weewx[6432] CRITICAL __main__: Caught unrecoverable exception: May 6 14:16:47 raspberrypi weewx[6432] CRITICAL __main__: No module named 'paho' May 6 14:16:47 raspberrypi weewx[6432]

Re: [weewx-user] Python versions

2020-05-04 Thread Graham Eddy
this (ujson instead of python-cjson, then install mqtt extension) seems to have worked up to point that weewx.log reports its mqtt client is successfully publishing loop data sudo python3.7 -m pip install ujson > On 4 May 2020, at 8:58 pm, Graham Eddy wrote: > > i have only just become

Re: [weewx-user] Python versions

2020-05-04 Thread Graham Eddy
i have only just become interested in mqtt (to make my custom weewx gauges near realtime). the link to the MQTT weewx extension mentioned below lists two prerequisites: paho-mqtt, python-cjson. paho-mqtt installed fine. python-cjson fails. i haven't found anything in the forum relating to this

Re: [weewx-user] Python versions

2020-05-03 Thread Colin Larsen
Perfect will do that tonight, thanks Tom On Mon, 4 May 2020, 07:28 Tom Keffer, wrote: > Colin, yes, your version of mqtt.py needs to be updated. You can the link > on the MQTT wiki page . > > On Sun, May 3, 2020 at 12:21 PM Colin Larsen > wrote: > >>

Re: [weewx-user] Python versions

2020-05-03 Thread Tom Keffer
Colin, yes, your version of mqtt.py needs to be updated. You can the link on the MQTT wiki page . On Sun, May 3, 2020 at 12:21 PM Colin Larsen wrote: > So just double checking, Matt was this the definitive answer that the > version of mqtt needs

Re: [weewx-user] Python versions

2020-05-03 Thread Colin Larsen
So just double checking, Matt was this the definitive answer that the version of mqtt needs updating? Cheers Colin On Sun, 3 May 2020, 20:32 Jaap de Munck, wrote: > That means your MQTT extension is not Python3 proof! > Get your self an updated version. > Is it this one:

Re: [weewx-user] Python versions

2020-05-03 Thread Jaap de Munck
That means your MQTT extension is not Python3 proof! Get your self an updated version. Is it this one: https://github.com/weewx/weewx/wiki/mqtt ? Op zondag 3 mei 2020 06:29:34 UTC+2 schreef Colin Larsen: > > This may be a problem? After changing to

Re: [weewx-user] Python versions

2020-05-02 Thread Colin Larsen
This may be a problem? After changing to python3 .. May 3 16:28:06 raspberrypi weewx[5437] CRITICAL __main__: Caught unrecoverable exception: May 3 16:28:06 raspberrypi weewx[5437] CRITICAL __main__: invalid syntax (mqtt.py, line 196) May 3 16:28:06 raspberrypi weewx[5437]

Re: [weewx-user] Python versions

2020-05-02 Thread Colin Larsen
Ah .. that will be the missing piece of the puzzle! Off to sort that now, will report back. Thanks! On Sun, 3 May 2020 at 15:30, mwall wrote: > On Saturday, May 2, 2020 at 9:11:51 PM UTC-4, Colin Larsen wrote: >> >> I found this /etc/default >> >> WEEWX_PYTHON=python2 >> >>

Re: [weewx-user] Python versions

2020-05-02 Thread mwall
On Saturday, May 2, 2020 at 9:11:51 PM UTC-4, Colin Larsen wrote: > > I found this /etc/default > > WEEWX_PYTHON=python2 > > WEEWX_BINDIR=/usr/share/weewx > > WEEWX_BIN=/usr/bin/weewxd > > WEEWX_CFG=/etc/weewx/weewx.conf > > > Changing it to python3 breaks weewx so I'll just leave well enough

Re: [weewx-user] Python versions

2020-05-02 Thread mwall
On Saturday, May 2, 2020 at 9:12:41 PM UTC-4, Colin Larsen wrote: > > Whoops sorry /etc/default/weewx that should have been > colin has it right. one of the things we did in the weewx4 packaging for debian, redhat (and soon suse and *bsd) is to put the parameters into /etc/default/weewx (it

Re: [weewx-user] Python versions

2020-05-02 Thread Colin Larsen
Whoops sorry /etc/default/weewx that should have been On Sun, 3 May 2020 at 13:11, Colin Larsen wrote: > I found this /etc/default > > WEEWX_PYTHON=python2 > > WEEWX_BINDIR=/usr/share/weewx > > WEEWX_BIN=/usr/bin/weewxd > > WEEWX_CFG=/etc/weewx/weewx.conf > > > Changing it to python3 breaks

Re: [weewx-user] Python versions

2020-05-02 Thread Colin Larsen
I found this /etc/default WEEWX_PYTHON=python2 WEEWX_BINDIR=/usr/share/weewx WEEWX_BIN=/usr/bin/weewxd WEEWX_CFG=/etc/weewx/weewx.conf Changing it to python3 breaks weewx so I'll just leave well enough alone Colin On Sun, 3 May 2020 at 12:54, Colin Larsen wrote: > Hi Graham > > Thanks

Re: [weewx-user] Python versions

2020-05-02 Thread Colin Larsen
Hi Graham Thanks for that and I understand all of what you are saying - except I have no idea whereabouts in /etc/init.d/weewx to change to make it use Python3. I thought I might find the line command line containing weewxd in there somewhere but alas no (or I've done a "boy look"). And I know

Re: [weewx-user] Python versions

2020-05-02 Thread Graham Eddy
as others have already mentioned you can instruct use of python3 either (a) system-widee.g. /etc/default or defaults (b) startupe.g. /etc/init.d/weewx or /Library/LaunchDaemons/com .weewx.weewxd (c) embedded e.g. shebang (insert

Re: [weewx-user] Python versions

2020-05-02 Thread Colin Larsen
Thanks Tom Well /etc/init.d/weewx is there and the other one isn't so I'll go with that but to be honest the innards of that file is out of my depth. On Sun, 3 May 2020 at 12:20, Tom Keffer wrote: > You will have to edit whatever script you use to start weewx as a daemon. > > Look in

Re: [weewx-user] Python versions

2020-05-02 Thread Tom Keffer
You will have to edit whatever script you use to start weewx as a daemon. Look in /etc/init.d/weewx. If not there, then /etc/systemd/system/weewx.service. -tk On Sat, May 2, 2020 at 5:13 PM Colin Larsen wrote: > Hi all > > I know that this is buried somewhere in the threads of information,