roe-dl / weewx-GTS

XType extension for WeeWX to provide solar energy, "Grünlandtemperatursumme" (a kind of growing degree days) and "dayET" and "ET24" as some kind of opposite to "dayRain" and "rain24"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unrecoverable exception after install

rodolfozan opened this issue · comments

Hello,

i get the following error when trying to restart weewx after installing your GTS extension:

May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: Caught unrecoverable exception:
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** offset must be a timedelta representing a whole number of minutes, not datetime.timedelta(0, 2445, 168000).
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** Traceback (most recent call last):
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** File "/usr/share/weewx/weewxd", line 151, in main
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** engine = weewx.engine.StdEngine(config_dict)
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 93, in init
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** self.loadServices(config_dict)
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** obj = weeutil.weeutil.get_object(svc)(self, config_dict)
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** File "/usr/share/weewx/user/GTS.py", line 765, in init
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** self.GTSextension=GTSType(__lat,__lon)
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** File "/usr/share/weewx/user/GTS.py", line 209, in init
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** self.lmt_tz=datetime.timezone(self.timeoffset,"LMT")
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** ValueError: offset must be a timedelta representing a whole number of minutes, not datetime.timedelta(0, 2445, 168000).
May 20 11:24:29 raspberrypi weewx[29526] CRITICAL main: **** Exiting.

Could you say, which version of Python you use? This error typically occurs for Python version before 3.7.

I made some changes. Please, download the extension and install it again and try. Be aware that this is a work-around for Python versions that do not allow timezone offset to be seconds.

Thanks for the quick reply.
Unfortunetly it doesnt work - the following exception is thrown:

May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: Caught unrecoverable exception:
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** module 'datetime' has no attribute 'timdedelta'
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** Traceback (most recent call last):
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/user/GTS.py", line 210, in init
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** self.lmt_tz=datetime.timezone(self.timeoffset,"LMT")
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** ValueError: offset must be a timedelta representing a whole number of minutes, not datetime.timedelta(0, 2445, 168000).
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: ****
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** During handling of the above exception, another exception occurred:
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: ****
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** Traceback (most recent call last):
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/weewxd", line 151, in main
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** engine = weewx.engine.StdEngine(config_dict)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 93, in init
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** self.loadServices(config_dict)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** obj = weeutil.weeutil.get_object(svc)(self, config_dict)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/user/GTS.py", line 771, in init
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** self.GTSextension=GTSType(__lat,__lon)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/user/GTS.py", line 214, in init
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** self.timeoffset = datetime.timdedelta(minutes=(lon*240)//60)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** AttributeError: module 'datetime' has no attribute 'timdedelta'
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** Exiting.
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: Caught unrecoverable exception:
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** module 'datetime' has no attribute 'timdedelta'
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** Traceback (most recent call last):
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/user/GTS.py", line 210, in init
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** self.lmt_tz=datetime.timezone(self.timeoffset,"LMT")
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** ValueError: offset must be a timedelta representing a whole number of minutes, not datetime.timedelta(0, 2445, 168000).
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: ****
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** During handling of the above exception, another exception occurred:
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: ****
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** Traceback (most recent call last):
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/weewxd", line 151, in main
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** engine = weewx.engine.StdEngine(config_dict)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 93, in init
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** self.loadServices(config_dict)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** obj = weeutil.weeutil.get_object(svc)(self, config_dict)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** File "/usr/share/weewx/user/GTS.py", line 771, in init
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: **** self.GTSextension=GTSType(__lat,__lon)
May 20 12:53:46 raspberrypi weewx[11109] CRITICAL main: May 20 12:56:40 raspberrypi systemd[1]: Stopping LSB: weewx weather system...

Please check your python version. i got no problems with this addon.

root@weather  ~ python3 --version
Python 3.9.4

Oh. I found a typo. Sorry. Please, try again.

Now it is working - thanks again.