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:[email protected]: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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/905eb6cb-ebf0-4e70-8dd1-279db3a47750n%40googlegroups.com.

Reply via email to