WeeWX Version 4, beta 6

602 views
Skip to first unread message

Thomas Keffer

unread,
Dec 30, 2019, 4:28:50 PM12/30/19
to weewx-development

-tk

Cameron D

unread,
Dec 31, 2019, 2:53:47 AM12/31/19
to weewx-development
I have just started messing around with the beta 4 code.

1. the WMR300 driver seems to be basically working, both standalone under python3 and as part of weewx to a new sqlite db.  There is one small problem  -  it is not reading the history from the console because there is no time to which data was previously stored.  It's only a once-off problem but I'll see if there's an easy fix.  Once the database has a "last time" then the read history works as expected.  I would expect the bug is also present in the old version.

2. My system was based on METRICWX - If I configure v4 for that then it raises a KeyError exception:
 
...
  File "/home/weewx/_base/bin/weewx/units.py", line 1190, in convert
    conversion_func = conversionDict[val_t[1]][target_unit_type]
KeyError: 'km'

and the log file reports:

 DEBUG weewx.units: Unable to convert from meter to km


Using METRIC seems to work fine.
Happy to provide more logs if necessary.

Thomas Keffer

unread,
Dec 31, 2019, 6:55:24 AM12/31/19
to weewx-development
Thanks, Cameron

1. Can you post the log where this happened? 

2. Conversion from meter to km was never possible. Meter is a member of group_altitude, and km is a member of group_distance. Can you give me the context where this happened? 

-tk


--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/df802b4a-2833-4536-8133-797987f5e4cf%40googlegroups.com.

Vince Skahan

unread,
Dec 31, 2019, 1:42:37 PM12/31/19
to weewx-development
On Monday, December 30, 2019 at 1:28:50 PM UTC-8, Tom Keffer wrote:

Does b6 have a minimum python version ?

Rolled the dice and tried an upgrade of my ancient Seagate Dockstar 3.9.0 to beta-6.  Fail on startup.

Python is 2.7.3,  debian version is 7.6
I'd have to compile my own python pieces from source to get a current version if you wanted me to try that.
Same goes for trying to get to python3.  Nothing newer than 3.2.3 available precompiled for this box.

root@debian:/home/src/weewx-4.0.0b6# service weewx start
[....] Starting weewx weather system: weewxTraceback (most recent call last):
  File "/home/weewx/bin/weewxd", line 16, in <module>
    import weewx.engine
  File "/home/weewx/bin/weewx/engine.py", line 30, in <module>
    import weewx.accum
  File "/home/weewx/bin/weewx/accum.py", line 95, in <module>
    defaults_dict = configobj.ConfigObj(StringIO(DEFAULTS_INI), encoding='utf-8')
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1230, in __init__
    self._load(infile, configspec)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1290, in _load
    infile = self._handle_bom(infile)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1430, in _handle_bom
    if not line.startswith(BOM):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
 failed!
 

mwall

unread,
Dec 31, 2019, 1:51:00 PM12/31/19
to weewx-development


On Tuesday, December 31, 2019 at 1:42:37 PM UTC-5, Vince Skahan wrote:
On Monday, December 30, 2019 at 1:28:50 PM UTC-8, Tom Keffer wrote:

Does b6 have a minimum python version ?

as i understand it, weex4 should work with python 2.7 or python 3.  don't think we are specifying anything more detailed than that, but maybe we have to?
 
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1430, in _handle_bom
    if not line.startswith(BOM):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
 failed!
 

i am seeing the same exception, in the same place.  but with python 2.6 (i know, we are only going to support python 2.7, but its an old system and i cannot update python on it)

Vince Skahan

unread,
Dec 31, 2019, 2:53:25 PM12/31/19
to weewx-development
On Tuesday, December 31, 2019 at 10:51:00 AM UTC-8, mwall wrote:

i am seeing the same exception, in the same place.  but with python 2.6 (i know, we are only going to support python 2.7, but its an old system and i cannot update python on it)



I'm trying to compile python-3.8.1 on this ancient 32bit swapping-like-crazy box.  It might be 2020 before I get to try to 'make test' :-)
But stay tuned....
 

Ralph Underwood

unread,
Dec 31, 2019, 3:42:57 PM12/31/19
to weewx-development
I'm running fine with 4.0.0b5 and the newest version of the Ultimeter driver on two different RPi4 stations. Knowing just enough unix & python to be dangerous, I thought maybe I should clarify a few things before using Vince's script to update to beta 6. 

I have extra sensors that use mqtt. I have a Python 3.7 program that subscribes to mqtt and writes a file for the filepile service. On one station this is working great, on the other I am not getting my mqtt publications (same code except for broker IP address) so I have some sleuthing to do on that station. The rest of the station is working fine - so it's not a WeeWx problem.

My python mqtt program and filepile.py are in /home/weewx/bin/user. And all of my other changes to WeeWx are in the Seasons directory. 

So is my understanding that these will be "safe" during the upgrade correct? Will I have to re-install the filepile changes to the weewx.conf?

Thanks
Ralph




Vince Skahan

unread,
Dec 31, 2019, 3:49:18 PM12/31/19
to weewx-development
On Tuesday, December 31, 2019 at 12:42:57 PM UTC-8, Ralph Underwood wrote:
I'm running fine with 4.0.0b5 and the newest version of the Ultimeter driver on two different RPi4 stations. Knowing just enough unix & python to be dangerous, I thought maybe I should clarify a few things before using Vince's script to update to beta 6. 


You probably don't want to use my script to update a version, unless you're using a script that I can't remember I wrote :-)

  • wget the .tar.gz file to a scratch directory
  • extract it with tar
  • cd into the directory it makes
  • python3 setup.py build
  • python3 setup.py install
  • restart weewx
You should almost certainly have no surprises nor other edits needed.  I just did b5 to b6 this morning.  Slam dunk.

Ralph Underwood

unread,
Dec 31, 2019, 4:11:54 PM12/31/19
to weewx-development
Slam and dunk! One station now on 4.0.0b6.  

The script I was referring to is the "weewx flexible installer script for Debian(ish) systems". 

Using the six steps was easy once I remembered to add the -xf to tar.

BTW - under the 3.? versions I was having seemingly random crashes (7 to 14 days between) that I suspect were caused by running out of memory. I was wondering if the Ultimeter driver was causing a memory leak. I also am not using cmon with version 4, so this may be why things are more "stable".  Again, knowing just enough unix & python to be dangerous, it's beyond me to figure that one out.

Thanks, Ralph

Thomas Keffer

unread,
Dec 31, 2019, 6:13:59 PM12/31/19
to Vince Skahan, weewx-development
Come on, Python 2.6 is over 11 years old, and hasn't been supported for well over 6 years! Time to upgrade! 

If you're running Python 3, WeeWX requires Python v3.5 or greater. Versions before that do not support % formatting of bytes and bytearrays.

Not sure what the problem is. Are you two using an old version of configobj? That could do it. Try

python -c "import configobj; print(configobj.__version__)"

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Ralph Underwood

unread,
Dec 31, 2019, 6:27:40 PM12/31/19
to weewx-development
It was relatively painless to convert/upgrade my python code to 3.7.  A few stumbles as the great internet  has many wrong examples and "solutions". For instance trying to install pyehem - what worked is sudo pip3 install ephem 

Same kind of issues with install the mosquitto and paho client - being sure that the solutions are valid for python 3

(google sure does like to "fix" spelling)

I think that there will be a lot of work to update the docs and wiki for version 4 - probably can't get it done this year :)

happy New Year.

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Vince Skahan

unread,
Dec 31, 2019, 6:28:29 PM12/31/19
to weewx-development
On Tuesday, December 31, 2019 at 3:13:59 PM UTC-8, Tom Keffer wrote:
Not sure what the problem is. Are you two using an old version of configobj? That could do it. Try

python -c "import configobj; print(configobj.__version__)"


Mine's python 2.7.3 and configobj 4.7.2
undoubtedly ancient :-)

Working on trying to compile python3.8.1 - now up to 3:30 in doing 'make test' and a load average up over 8.00 - that little Dockstar is working more today than it's done in 5 years I think.

Vince Skahan

unread,
Dec 31, 2019, 6:32:45 PM12/31/19
to weewx-development
On Tuesday, December 31, 2019 at 3:27:40 PM UTC-8, Ralph Underwood wrote:
It was relatively painless to convert/upgrade my python code to 3.7.  A few stumbles as the great internet  has many wrong examples and "solutions". For instance trying to install pyehem - what worked is sudo pip3 install ephem 



One thing you might want to look into is whether you have dpkg versions of things available in python3.  There are a few available for current Raspbian for raspi that you used to have to use pip3 to install....but pip of course always works too. 

Thomas Keffer

unread,
Dec 31, 2019, 6:48:32 PM12/31/19
to Ralph Underwood, weewx-development
Ralph, the docs that come with WeeWX v4 should be correct. If you found a mistake, please post it!

As for the Wiki, it will take some time for all the extension publishers to switch to Python 3.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/a7445948-6163-47d6-ad1b-5ec25e46e27b%40googlegroups.com.

Thomas Keffer

unread,
Dec 31, 2019, 6:49:37 PM12/31/19
to Vince Skahan, weewx-development
Mine's python 2.7.3 and configobj 4.7.2

Does the problem go away if you upgrade configobj to the current version, 5.0.6?

-tk

Ralph Underwood

unread,
Dec 31, 2019, 6:50:58 PM12/31/19
to weewx-development
My bad - I hadn't looked into the v4 docs.

Vince Skahan

unread,
Dec 31, 2019, 7:43:43 PM12/31/19
to weewx-development
On Tuesday, December 31, 2019 at 3:49:37 PM UTC-8, Tom Keffer wrote:
Mine's python 2.7.3 and configobj 4.7.2

Does the problem go away if you upgrade configobj to the current version, 5.0.6?



I can't find a way to get there on this ancient system, unfortunately.

Working on upgrading to python3 but need to rebuild it all after installing a newer openssl from sources (sigh) because there's no way to get 'there' either otherwise, so I can eventually 'pip3 install' all the python modules I'll need to try it again under python3.   Given it taking 5 hours to get through a make test+build+install the first time, this might take a while.....

 

Vince Skahan

unread,
Jan 1, 2020, 12:39:27 AM1/1/20
to weewx-development
On Tuesday, December 31, 2019 at 4:43:43 PM UTC-8, Vince Skahan wrote:
Working on upgrading to python3 but need to rebuild it all after installing a newer openssl from sources (sigh) because there's no way to get 'there' either otherwise, so I can eventually 'pip3 install' all the python modules I'll need to try it again under python3.   Given it taking 5 hours to get through a make test+build+install the first time, this might take a while.....

 

ok - got python 3.8.1 and openssl compiled and weewx upgraded finally.   Geez what a PAIN getting all the right switches to get the right stuff linked in correctly into python's binaries.   I must have built python3 over a half-dozen times.  Wow.

Letting it run overnight and crossing my fingers some extension doesn't go boom :-)
 

Cameron D

unread,
Jan 1, 2020, 4:33:15 AM1/1/20
to weewx-development
Hi Tom,
1. the failure to read history on DB initialisation was a trivial change, so I will submit that at some stage.

2. KeyError - a bit of background, the WMR300 unit returns date in METRICWX the unit set, which is partly why I chose that for my DB.  So wind speed is in m/s and as soon as I return the first new set of data from the history, it wants to calculate windrun which is group_distance.   If I used METRIC then it converts the speed to km/hour, which might be why it is happy with that.

I added a convertion from 'meter' to 'km' in conversionDict in units.py and it seems to be happy.

I have attached a log from startup to crash, with various debug lines of wmr300.py enabled, so you can see the exception happens as soon as it returns the first relevant historical record.


On Tuesday, 31 December 2019 21:55:24 UTC+10, Tom Keffer wrote:
Thanks, Cameron

1. Can you post the log where this happened? 

2. Conversion from meter to km was never possible. Meter is a member of group_altitude, and km is a member of group_distance. Can you give me the context where this happened? 

-tk


On Tue, Dec 31, 2019 at 12:53 AM Cameron D <Cgo...@davidsoncj.id.au> wrote:
I have just started messing around with the beta 4 code.

1. the WMR300 driver seems to be basically working, both standalone under python3 and as part of weewx to a new sqlite db.  There is one small problem  -  it is not reading the history from the console because there is no time to which data was previously stored.  It's only a once-off problem but I'll see if there's an easy fix.  Once the database has a "last time" then the read history works as expected.  I would expect the bug is also present in the old version.

2. My system was based on METRICWX - If I configure v4 for that then it raises a KeyError exception:
 
...
  File "/home/weewx/_base/bin/weewx/units.py", line 1190, in convert
    conversion_func = conversionDict[val_t[1]][target_unit_type]
KeyError: 'km'

and the log file reports:

 DEBUG weewx.units: Unable to convert from meter to km


Using METRIC seems to work fine.
Happy to provide more logs if necessary.

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.
weewx-2nd-test.log

Thomas Keffer

unread,
Jan 1, 2020, 7:27:15 AM1/1/20
to Cameron D, weewx-development
Thanks for figuring that one out, Cameron! Nice sleuthing.

Fixed in commit 3f0d80a.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/9bcb976a-af3e-4cb5-8854-08262a0508b7%40googlegroups.com.

Cameron D

unread,
Jan 1, 2020, 10:00:23 AM1/1/20
to weewx-development
A comment on the documentation.
I'm not sure if I missed it somewhere, but the docs say that if the default python is v2 then  "...you would be happiest if you install using Python 2".
In fact, I wouldn't. I'd like to ensure programs use python3 where possible, but I don't want to change the system default just yet for fear of killing other python code.

What I found by accident was that explicitly using python3 to run setup.py will configure the hash-bang lines to use python 3 but I don't know if that is the appropriate way.  I was expecting a config option somewhere but never saw any

Thomas Keffer

unread,
Jan 1, 2020, 10:28:24 AM1/1/20
to Cameron D, weewx-development
I've noticed that as well. That seems to be the way setup.py works: however you invoke it, is how it installs the executables.

I will make a note in the setup docs.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Thomas Keffer

unread,
Jan 1, 2020, 10:59:15 AM1/1/20
to weewx-development
Commit 2943038c.

Patrick Tranchant

unread,
Jan 1, 2020, 2:24:57 PM1/1/20
to weewx-development
hello Tom
happy new for all

I downloaded version B6 to test on my BYOWS, where is the new doc ( if there is); the installation is the same of version 3.9.2 ?
I have already python 3.5

thanks

patrick

Thomas Keffer

unread,
Jan 1, 2020, 4:45:53 PM1/1/20
to Patrick Tranchant, weewx-development
The docs are in the "docs" subdirectory. 

Installation is largely the same for Python 2, quite different for Python 3. Instructions are in the docs.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Patrick Tranchant

unread,
Jan 2, 2020, 10:35:12 AM1/2/20
to weewx-development

hello

I can follow this procedure ?

On Monday, December 30, 2019 at 10:28:50 PM UTC+1, Tom Keffer wrote:

Thomas Keffer

unread,
Jan 2, 2020, 10:47:53 AM1/2/20
to Patrick Tranchant, weewx-development
Unfortunately, no. WeeWX V4 is only available for installation via the setup.py. 

However, it is easy enough to unpack the tarball someplace, then simply run the unpacked weewxd using your old weewx.conf file. It should work fine.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Patrick Tranchant

unread,
Jan 2, 2020, 10:54:54 AM1/2/20
to weewx-development
or can I just copy the new directories instead of the others?

my previous installation was done by apt-get install.

thanks

patrick

Patrick Tranchant

unread,
Jan 2, 2020, 11:08:01 AM1/2/20
to weewx-development
ok
I go to try it

Patrick Tranchant

unread,
Jan 2, 2020, 11:19:18 AM1/2/20
to weewx-development
I done this command

pi@rpi-bureau:~/weewx-4.0.0b6/bin $ weewxd --version
3.8.2
 it is normal ?

Vince Skahan

unread,
Jan 2, 2020, 11:26:54 AM1/2/20
to weewx-development
On Thursday, January 2, 2020 at 8:19:18 AM UTC-8, Patrick Tranchant wrote:
I done this command

pi@rpi-bureau:~/weewx-4.0.0b6/bin $ weewxd --version
3.8.2
 it is normal ?


Patrick - given your recent questions and the fact that you have a previous apt-get installation, you might want to just wait until the v4 version comes out in a packaged version.

Patrick Tranchant

unread,
Jan 2, 2020, 11:28:19 AM1/2/20
to weewx-development
it is better
pi@rpi-bureau:~/weewx-4.0.0b6/bin $ ./weewxd --version
4.0.0b6
pi@rpi-bureau:~/weewx-4.0.0b6/bin $

Patrick Tranchant

unread,
Jan 2, 2020, 11:40:02 AM1/2/20
to weewx-development
ok, i will test version 4 using installation with setup.py, when it is available in .deb (final version), i will do the real update.

tk

patrick

Patrick Tranchant

unread,
Jan 2, 2020, 11:46:42 AM1/2/20
to weewx-development
up
if i still want to test before, i just replace this in the weewx file (in init.d) WEEWX_BIN = / usr / bin / weewxd with /home/pi/weewx-4.0.0b6/bin/weewxd (new directory).

i have good

Andy

unread,
Jan 2, 2020, 12:53:53 PM1/2/20
to weewx-development
This issue seems to be resolved. Tested by tipping teeter-totter during spider eviction. 

Andy

Johannes Ebner

unread,
Jan 2, 2020, 1:16:06 PM1/2/20
to weewx-development
Hi, 

I am trying to install weewx 4 beta with python3 on my RPi with Rasbian Buster Lite.

I was doing a basic installation of Raspbian (which includes Python 2.7 per default). Then I followed the docs (from the source) for Raspbian with Python3:

sudo apt-get install python3-pil
sudo apt
-get install python3-configobj
sudo apt
-get install python3-cheetah
sudo apt
-get install python3-ephem

after that I added the follwoing to .bashrc

alias python='/usr/bin/python3'
alias pip=pip3

followed by

source ~/.bashrc

I can see now:

pi@Weewx:~ $ python -V
Python 3.7.3
pi@Weewx
:~ $ pip --version
pip
18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

So this should be correct.

Then I tried to install weewx but getting the following error:

pi@Weewx:~/weewx-4.0.0b6 $ ./setup.py build
Traceback (most recent call last):

 
File "./setup.py", line 21, in <module>
   
import configobj
ImportError: No module named configobj


Any hints?

Br,
Johannes

mwall

unread,
Jan 2, 2020, 1:32:41 PM1/2/20
to weewx-development


On Thursday, January 2, 2020 at 1:16:06 PM UTC-5, Johannes Ebner wrote:

Then I tried to install weewx but getting the following error:

pi@Weewx:~/weewx-4.0.0b6 $ ./setup.py build
Traceback (most recent call last):
 
File "./setup.py", line 21, in <module>
   
import configobj
ImportError: No module named configobj


Any hints?

you might want to be explicit about everything, at least until we get all the dependencies sorted out.  if you 'source' an rc file you may not get what you expect.

there can be a huge difference between this:

./setup.py install

and this:

python ./setup.py install

i find it best to do this:

python2 ./setup.py install

or, if you want to use python3:

python3 ./setup.py install

then be sure that you do not mix!  when you do an 'install' using setup.py, the shebang line in every entry point in weewx is modified to use the python with which you invoked it.  since some python installations are python2 and others are python3, it may not be obvious which one you'll get when you just do 'python'.  also, it gets even more complicated if you have multiple instances of python on the system and they were built to use shared libraries (i think that is the default?).  then the LD_LIBRARY_PATH also affects which python you'll end up getting.


mwall

unread,
Jan 2, 2020, 1:43:34 PM1/2/20
to weewx-development
it has always been best practice to not modify the system's python.  however, to do that strictly would mean that you must do one of these:

* use python's virtualenv
* install your own version of python, completely separately from the system python
* install extensions to the system python using the --user option to 'pip install'

none of those are particularly user-friendly.

since weewx has minimal requirements, the docs use instructions that result in modification of the system's python installation.  typically that mean 'sudo pip install xxx'.  but on some systems you would have to first install pip, or you would have to use easy_install.

i think we can continue this pattern - use the system's python - instead of complicating things for weewx users.  but only if we can keep the weewx dependencies to a minimum.

Thomas Keffer

unread,
Jan 2, 2020, 1:59:44 PM1/2/20
to mwall, weewx-development
Teaching users to use virtualenv or pyenv sounds like a nightmare. 

I wish Python's package management system was up to the task. Things are so much easier in Javascript land.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Patrick Tranchant

unread,
Jan 2, 2020, 2:07:22 PM1/2/20
to weewx-development
up

installation done with setup.py = OK
I try just now with "simulator" in weewx.conf =>

but I had an error in syslog

Jan  2 19:57:02 raspberrypi weewx[5741] INFO weewx.engine: Initializing weewx version 4.0.0b6
Jan  2 19:57:02 raspberrypi weewx[5741] INFO weewx.engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22                                ) #012[GCC 6.3.0 20170516]
Jan  2 19:57:02 raspberrypi weewx[5741] INFO weewx.engine: Platform Linux-4.14.71-v7+-armv7l-with-debian-9.4
Jan  2 19:57:02 raspberrypi weewx[5741] INFO weewx.engine: Locale is 'fr_FR.UTF-8'
Jan  2 19:57:02 raspberrypi weewx[5741] INFO weewx.engine: PID file is /var/run/weewx.pid
Jan  2 19:57:02 raspberrypi weewx[5729]: Starting weewx weather system: weewx.
Jan  2 19:57:02 raspberrypi systemd[1]: Started LSB: weewx weather system.
Jan  2 19:57:02 raspberrypi weewx[5746] INFO weewx.engine: Using configuration file /home/weewx/weewx.conf
Jan  2 19:57:02 raspberrypi weewx[5746] INFO weewx.engine: Loading station type Simulator (weewx.drivers.simulator)

I have python 2.7 and python 3.5 installed on my RPi, I can deactived python 2.7 for test ?

Vince Skahan

unread,
Jan 2, 2020, 2:15:54 PM1/2/20
to weewx-development
On Thursday, January 2, 2020 at 11:07:22 AM UTC-8, Patrick Tranchant wrote:
I have python 2.7 and python 3.5 installed on my RPi, I can deactived python 2.7 for test ?



You would have to reinstall weewx:

  • python3 setup.py build
  • python3 setup.py install
  • then restart weewx

Thomas Keffer

unread,
Jan 2, 2020, 2:16:31 PM1/2/20
to Patrick Tranchant, weewx-development
You're not giving much information, but it looks like you are trying to run weewx as a daemon. Unless you changed the in init.d file you are using (or systemd weewx.service), it is still invoking python 2. If you wish to run as a daemon, you will need to change that file.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Vince Skahan

unread,
Jan 2, 2020, 2:21:12 PM1/2/20
to weewx-development
On Thursday, January 2, 2020 at 10:32:41 AM UTC-8, mwall wrote:


On Thursday, January 2, 2020 at 1:16:06 PM UTC-5, Johannes Ebner wrote:

Then I tried to install weewx but getting the following error:

pi@Weewx:~/weewx-4.0.0b6 $ ./setup.py build
Traceback (most recent call last):
 
File "./setup.py", line 21, in <module>
   
import configobj
ImportError: No module named configobj


Any hints?

you might want to be explicit about everything, at least until we get all the dependencies sorted out.  if you 'source' an rc file you may not get what you expect.

there can be a huge difference between this:

./setup.py install

and this:

python ./setup.py install

i find it best to do this:

python2 ./setup.py install

or, if you want to use python3:

python3 ./setup.py install



Matthew - the 'installation using setup.py' instructions on the web show "./setup.py" as the recommended syntax, not prefaced with "python".

Might be worth a quick edit to specify your preferred syntax on what people see on the web, just in case people don't dig into the development branch docs for the v4 syntax (which looks ok to me)



Patrick Tranchant

unread,
Jan 2, 2020, 2:31:18 PM1/2/20
to weewx-development
up
ok, we erase everything i said.
as in the logs I saw that it was python 2.7 which was used, I changed the python by default with this command,
pi@raspberrypi:~ $ update-alternatives --config python
Il existe 2 choix pour l'alternative python (qui fournit /usr/bin/python).

  Sélection   Chemin              Priorité  État
------------------------------------------------------------
* 0            /usr/bin/python3.5   2         mode automatique
  1            /usr/bin/python2.7   1         mode manuel
  2            /usr/bin/python3.5   2         mode manuel

Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :
pi@raspberrypi:~ $

after I want to reinstall everything, and now I have this error !!!
pi@raspberrypi:~/weewx-4.0.0b6 $ ./setup.py build

Traceback (most recent call last):
  File "./setup.py", line 21, in <module>
    import configobj
ImportError: No module named 'configobj'

I didn't have it with python 2.7 !!!

why, I rebooted my RPi
pi@raspberrypi:~ $ python --version
Python 3.5.3

Thomas Keffer

unread,
Jan 2, 2020, 2:32:21 PM1/2/20
to Vince Skahan, weewx-development
The instructions that come with V4 invokes setup.py with an explicit call to python.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Patrick Tranchant

unread,
Jan 2, 2020, 2:37:29 PM1/2/20
to weewx-development


sorry, i don't understand, what should i do, uninstall python 2.7?

Vince Skahan

unread,
Jan 2, 2020, 2:45:15 PM1/2/20
to weewx-development
On Thursday, January 2, 2020 at 11:32:21 AM UTC-8, Tom Keffer wrote:
The instructions that come with V4 invokes setup.py with an explicit call to python.



Yes, it does indeed.

But the legacy v3 web pages that most folks likely read along with (I know that's where I look) have the less preferred syntax.   In the days of only python2 that was probably ok, but I was just suggesting that perhaps a quick edit on the web pages might help lessen confusion.  It's not always self-evident to dig down into the html-formated docs subdirectory when trying to install the v4 beta.

Thomas Keffer

unread,
Jan 2, 2020, 3:17:57 PM1/2/20
to Vince Skahan, weewx-development
Respectively, disagree. At this point, editing the pages on weewx.conf is not only more work, but would add to the confusion. Python 3? Version 3.x supports Python 3?

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Vince Skahan

unread,
Jan 2, 2020, 3:41:39 PM1/2/20
to weewx-development
On Thursday, January 2, 2020 at 12:17:57 PM UTC-8, Tom Keffer wrote:
Respectively, disagree. At this point, editing the pages on weewx.conf is not only more work, but would add to the confusion. Python 3? Version 3.x supports Python 3?



No, I'm merely suggesting a change

From:

    ./setup.py build
    sudo ./setup.py install

To:

python setup.py build
sudo python setup.py install


Basically to reinforce best practices as Matthew mentioned earlier.
Always specify the python you want to use.

But no biggie either way. Thanks.

Cameron D

unread,
Jan 2, 2020, 6:52:50 PM1/2/20
to weewx-development
You should not need to uninstall python2. I have a working weewx3 install that requires it and I managed to get weewx4 testing under python3 on the same system.

I will put my notes onto the wiki in the next hour or so.

Cameron.

Cameron D

unread,
Jan 2, 2020, 10:36:21 PM1/2/20
to weewx-development
I have changed the wmr300 driver: 1 minute to fix the code and 1 day trying to understand how to make git work.

I may or may not have submitted a pull request on the development branch.If I haven't succeeded then let me know and I'll post the diffs.

On Tuesday, 31 December 2019 17:53:47 UTC+10, Cameron D wrote:
I have just started messing around with the beta 4 code.

1. the WMR300 driver seems to be basically working, both standalone under python3 and as part of weewx to a new sqlite db.  There is one small problem  -  it is not reading the history from the console because there is no time to which data was previously stored.  It's only a once-off problem but I'll see if there's an easy fix.  Once the database has a "last time" then the read history works as expected.  I would expect the bug is also present in the old version.


Johannes Ebner

unread,
Jan 3, 2020, 12:52:37 AM1/3/20
to weewx-development
I had to use "python3 ./setup.py build"

But as this is not that trivial to use python3 on a new raspbian buster and I am not the expert. 
Is there any advantage to move now to python3 for weewx?

The only reason why I was trying to do it that way is because I anyhow have to newly setup weewx so I wanted to take the advantage and go immediatly with weewx 4 and python 3.

But maybe it is better to stay with weewx stable and python2 for the time beeing?

salinois

unread,
Jan 3, 2020, 5:12:49 AM1/3/20
to weewx-de...@googlegroups.com

thanks

can you give me URL of wiki ?

patrick

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Patrick Tranchant

unread,
Jan 3, 2020, 5:58:34 AM1/3/20
to weewx-development
ok Cameron
I follow your procedure, and it is ok for installation
I choose "Simulator" in weewx.conf for test; and it is ok but I have this errors message in syslog

Jan  3 11:57:15 raspberrypi weewx[2332] INFO weewx.manager: Added record 2020-01-03 11:57:00 CET (1578049020) to database 'weewx.sdb'
Jan  3 11:57:15 raspberrypi weewx[2332] INFO weewx.manager: Added record 2020-01-03 11:57:00 CET (1578049020) to daily summary in 'weewx.sdb'
Jan  3 11:57:17 raspberrypi weewx[2332] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 1.77 seconds
Jan  3 11:57:18 raspberrypi weewx[2332] INFO weewx.imagegenerator: Generated 14 images for SeasonsReport in 1.02 seconds
Jan  3 11:57:18 raspberrypi weewx[2332] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Jan  3 11:57:18 raspberrypi weewx[2332] INFO weewx.cheetahgenerator: Generated 7 files for report SmartphoneReport in 0.18 seconds
Jan  3 11:57:19 raspberrypi weewx[2332] INFO weewx.imagegenerator: Generated 7 images for SmartphoneReport in 0.43 seconds
Jan  3 11:57:19 raspberrypi weewx[2332] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx/smartphone
Jan  3 11:57:19 raspberrypi weewx[2332] INFO weewx.cheetahgenerator: Generated 1 files for report MobileReport in 0.07 seconds
Jan  3 11:57:19 raspberrypi weewx[2332] INFO weewx.imagegenerator: Generated 4 images for MobileReport in 0.26 seconds
Jan  3 11:57:19 raspberrypi weewx[2332] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx/mobile
Jan  3 11:57:21 raspberrypi weewx[2332] INFO weewx.cheetahgenerator: Generated 14 files for report Belchertown in 1.55 seconds
Jan  3 11:57:21 raspberrypi weewx[2332] INFO weewx.reportengine: Copied 1 files to /var/www/html/weewx/belchertown
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.CheetahGenerator'
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****  unsupported operand type(s) for +: 'int' and 'NoneType'
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      obj.start()
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      self.run()
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 150, in run
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      ngen = self.generate(gen_dict[section_name], self.gen_ts)
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 220, in generate
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], gen_ts)
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 220, in generate
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], gen_ts)
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 309, in generate
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      default_binding)
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 383, in _getSearchList
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      searchList += obj.get_extension_list(timespan, db_lookup)
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/user/belchertown_highchartsSearchX.py", line 460, in get_extension_list
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      rain_count = rain_count + rain
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****  TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****  Generator terminated

tk
now, I go maybe try on my real station to see.

patrick

Cameron D

unread,
Jan 3, 2020, 7:55:55 AM1/3/20
to weewx-development
Patrick,


On Friday, 3 January 2020 20:12:49 UTC+10, salinois wrote:

thanks

can you give me URL of wiki ?

patrick

Le 03/01/2020 à 00:52, Cameron D a écrit :
You should not need to uninstall python2. I have a working weewx3 install that requires it and I managed to get weewx4 testing under python3 on the same system.

I will put my notes onto the wiki in the next hour or so.

Cameron.

On Friday, 3 January 2020 05:37:29 UTC+10, Patrick Tranchant wrote:


sorry, i don't understand, what should i do, uninstall python 2.7?

On Monday, December 30, 2019 at 10:28:50 PM UTC+1, Tom Keffer wrote:

-tk
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Cameron D

unread,
Jan 3, 2020, 7:59:43 AM1/3/20
to weewx-development
From what I have read, Belchertown is not yet compatible with python3 or weewx4 changes or maybe both.

Maybe try reinstall with forcing python2 in place of python3.


On Friday, 3 January 2020 20:58:34 UTC+10, Patrick Tranchant wrote:
ok Cameron
I follow your procedure, and it is ok for installation
I choose "Simulator" in weewx.conf for test; and it is ok but I have this errors message in syslog

...

Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/user/belchertown_highchartsSearchX.py", line 460, in get_extension_list
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****      rain_count = rain_count + rain
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****  TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
Jan  3 11:57:22 raspberrypi weewx[2332] ERROR weewx.reportengine:         ****  Generator terminated

Patrick Tranchant

unread,
Jan 3, 2020, 8:28:13 AM1/3/20
to weewx-development
ok; so
Version b6= ok, on my real weather station with skin Season
after I go to try skin Belchertown

tk
patrick

Patrick Tranchant

unread,
Jan 3, 2020, 8:49:03 AM1/3/20
to weewx-development
so
ok, I'm going to let it run for a day with the B6 version.

tk , good job for version b6

Praveen Chandrasekaran

unread,
Jan 4, 2020, 7:09:41 AM1/4/20
to weewx-development
Any planned timeline for v4.0 full release?

raenrfm

unread,
Jan 9, 2020, 8:17:11 AM1/9/20
to weewx-development
I run my current 3.8.0 in a docker container, any plans on creating a docker image?  That would be way cool!

Vince Skahan

unread,
Jan 9, 2020, 10:40:13 AM1/9/20
to weewx-development
On Thursday, January 9, 2020 at 5:17:11 AM UTC-8, raenrfm wrote:
I run my current 3.8.0 in a docker container, any plans on creating a docker image?  That would be way cool!



You'd have to ask whoever created the Docker image you are running.
There are at least a half-dozen variants out there.

Tom Mitchell

unread,
Jan 9, 2020, 2:32:23 PM1/9/20
to weewx-development
FWIW, I have been grabbing the betas and making Docker images from them here:


Let me know if you have any questions or suggestions on usage. I use this as a base image for several weewx instances.
Reply all
Reply to author
Forward
0 new messages