Upgrading weewx, plugins and python

100 views
Skip to first unread message

Gordon Dickens

unread,
Dec 7, 2020, 12:44:20 PM12/7/20
to weewx-user
Hello all,

I have been successfully running the following versions of weewx software, skins and python on Debian 10 and I need to upgrade the software as depicted here:
  • weewx current version 3.9.2 needs upgrading to 4.2.0.
  • Belchertown Skin current version 1.0.1 needs upgrading to 1.2
  • Weather34 Skin current version WX-UB40-IHVN-0.9.1 needs upgrading toW34-HC-IMJD-3.0.0
  • Python current version 2.7 needs upgrading to Python 3.7.3
As an FYI, weewx is installed from the Debian weewx package with the Debian package manager, apt.

What is the recommended order for performing these upgrades?

My initial thoughts were to upgrade in this order:
  1. Upgrade Python to version 3.7.3
  2. Upgrade weew to version 4.2.0
  3. Upgrade the Belchertown skin to verion 1.2
  4. Upgrade the Weather34 skin to version W34-HC-IMJD-3.0.0
So, I began the python upgrade by installing python 3.7.3 and the python3 dependencies: python3-configobj python3-pil  python3-serial, python3-usb, python3-pip, python3-cheetah,  python3-ephem, python3-mysqldb.

I then used the update-alternatives package to switch the default python command to python 3.7.3.  Then, after I started the weewx service with "systemctl restart weewx", the command "systemctl status weewx" generates the following error dialog:

● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated)
   Active: active (exited) since Mon 2020-12-07 09:12:53 EST; 7s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 28868 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)

Dec 07 09:12:53 zeebytes.org weewx[28868]: Starting weewx weather system: weewxTraceback (most recent call last):
Dec 07 09:12:53 zeebytes.org weewx[28868]:   File "/usr/bin/weewxd", line 64, in <module>
Dec 07 09:12:53 zeebytes.org weewx[28868]:     weewx.engine.main(options, args)
Dec 07 09:12:53 zeebytes.org weewx[28868]:   File "/usr/share/weewx/weewx/engine.py", line 845, in main
Dec 07 09:12:53 zeebytes.org weewx[28868]:     daemon.daemonize(pidfile=options.pidfile)
Dec 07 09:12:53 zeebytes.org weewx[28868]:   File "/usr/share/weewx/daemon.py", line 71, in daemonize
Dec 07 09:12:53 zeebytes.org weewx[28868]:     si = file(stdin, 'r')
Dec 07 09:12:53 zeebytes.org weewx[28868]: NameError: name 'file' is not defined
Dec 07 09:12:53 zeebytes.org weewx[28868]: .
Dec 07 09:12:53 zeebytes.org systemd[1]: Started LSB: weewx weather system.

I researched "NameError: name 'file' is not defined" and found a reference that stated that file() is not supported in Python3.  Is that the problem and if so, how do I fix it?  Otherwise, how do I get my existing weewx 3.9.2 installation to run Python3 or do I need to upgrade weewx to 4.2.0 for it to work with python3?

Any comments on the best way to perform these upgrades would be most appreciated.

Thanks,

Gordon

vince

unread,
Dec 7, 2020, 1:14:45 PM12/7/20
to weewx-user
Well typically you want to do one thing at a time...
 - spin up a raspi or VM with weewx using the simulator driver
 - if you're using something other than sqlite3, get the db working too
 - then get all your skins working
 - then try to get the driver working assuming others have gone there before

I can't speak to weather34 and whether it's weewx-4.2/python3 compatible, but I know others can.
Other stuff I think is known good.

Tom Keffer

unread,
Dec 7, 2020, 1:43:40 PM12/7/20
to weewx-user
The error 'file' is not defined was fixed in WeeWX V4 as part of the port to Python 3. You will get LOTS of these kinds of errors trying to run WeeWX V3 under Python 3. Either upgrade WeeWX first, or use Python 2.7.

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/988598aa-d167-48cc-b591-ca740d6b9afen%40googlegroups.com.

Gordon Dickens

unread,
Dec 7, 2020, 2:44:38 PM12/7/20
to weewx-user


Thanks very much Tom for your very helpful post!  I suspected that was the case and I will proceed by first upgrading weewx to V4 as you suggested.

Gordon Dickens

unread,
Dec 7, 2020, 5:04:09 PM12/7/20
to weewx...@googlegroups.com, Tom Keffer
Thanks very much Tom for your very helpful post!  I suspected that was the case and I will proceed by first upgrading weewx to V4 as you suggested.


You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/ctbffuJOfXY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEA5QxUx855e%3DZ%3DYMszbzZiq2khJMu%3DZzDLJa%2B4W6jycxw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages