v4.10.2 will have the same problem. It's Python 3.12 that's causing the problem.
On Tue, Nov 21, 2023 at 1:16 PM Frank Frommelt <f.fromm...@gmail.com> wrote: > Hi Tom, > thanks for that tip. > I managed to downgrade to 4.10.2 in the meantime to re-gain my weather > station. > I will try your workaround next weekend. > Take care > Frank > > --- Original Nachricht --- > *Von: * Tom Keffer tkef...@gmail.com > *Datum: * 21. November 2023 14:51:33 > *An: * weewx-user@googlegroups.com > *Betreff: * Re: [weewx-user] weewx 5.0 upgrade trouble > >> This is a problem with the Fine Offset driver that we're aware of. It's >> caused by the deprecation of the function datetime.utcnow() in Python 3.12. >> >> The fix for now is to downgrade to Python 3.11. >> >> -tk >> >> On Tue, Nov 21, 2023 at 3:26 AM Frank Frommelt <f.fromm...@gmail.com> >> wrote: >> >>> Hi there, >>> >>> OK, I have taken the risk in updatting weewx from 4.10.2 to the latest >>> 5.0 (beta) version. >>> >>> I followed the update guide and everything looked fine. >>> >>> When finally starting the service I am getting the following error: >>> >>> *Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> TypeError: can't subtract offset-naive and offset-aware datetimes* >>> >>> So, it looks like some data is time-zone aware and some is not. >>> >>> Basically I found something to cure the problem, but as I have no idea >>> on programming, I need some help... >>> >>> >>> https://toptechtips.github.io/2023-04-03-python-offset-aware-offset-naive-timezones/ >>> >>> >>> Here is the full log down to the error message... >>> >>> (weewx-venv) pi@raspi:/home/weewx $ sudo systemctl start weewx >>> (weewx-venv) pi@raspi:/home/weewx $ tail -f /var/log/weewx.log >>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: binding to archive >>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: topic is weather >>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: desired unit system >>> is METRIC >>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: data will be uploaded >>> to mqtt://weewx:xxx@192.168.1.140:1883 >>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: 'pyephem' >>> detected, extended almanac data is available >>> Nov 21 12:03:48 raspi weewx[18165] INFO __main__: Starting up weewx >>> version 5.0.0b15 >>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: Using binding >>> 'wx_binding' to database 'weewx.sdb' >>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Starting backfill >>> of daily summaries >>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Daily summaries >>> up to date >>> Nov 21 12:03:49 raspi weewx[18165] INFO weewx.drivers.fousb: >>> synchronising to the weather station (quality=0) >>> Nov 21 12:03:52 raspi weewx[18165] INFO weewx.engine: Main loop exiting. >>> Shutting engine down. >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: Caught >>> unrecoverable exception: >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** can't >>> subtract offset-naive and offset-aware datetimes >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> Traceback (most recent call last): >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py", line 157, in >>> main >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> engine.run() >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line >>> 175, in run >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> self.dispatchEvent(weewx.Event(weewx.STARTUP)) >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line >>> 242, in dispatchEvent >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> callback(event) >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line >>> 581, in startup >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> self._catchup(self.engine.console.genStartupRecords) >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line >>> 694, in _catchup >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** for >>> record in generator(lastgood_ts): >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", >>> line 1094, in genArchiveRecords >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> records = self.get_records(since_ts) >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", >>> line 1303, in get_records >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** dts, >>> ptr = self.sync(read_period=fixed_block['read_period']) >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** File >>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", >>> line 1380, in sync >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** if >>> last_date - prev_date > datetime.timedelta(seconds=50): >>> *Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** >>> TypeError: can't subtract offset-naive and offset-aware datetimes* >>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: **** Exiting. >>> >>> -- >>> 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/905eb6cb-ebf0-4e70-8dd1-279db3a47750n%40googlegroups.com >>> <https://groups.google.com/d/msgid/weewx-user/905eb6cb-ebf0-4e70-8dd1-279db3a47750n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> 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/52Woq03XVoM/unsubscribe. >> To unsubscribe from this group and all its topics, 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/CAPq0zEA93Sv3vSDzVTWmWDJYiWY%3DMa3h9ZdaYtqFPrK8U3Uttw%40mail.gmail.com >> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEA93Sv3vSDzVTWmWDJYiWY%3DMa3h9ZdaYtqFPrK8U3Uttw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > -- 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/CAPq0zEDHEApsr8ArkgFJyzJjTTc0fDFVnvnhTHM8kaNQhRPaEA%40mail.gmail.com.