unsupported operand type(s) for -: 'int' and 'NoneType'

83 views
Skip to first unread message

Peter Hurn

unread,
Nov 7, 2020, 1:12:45 PM11/7/20
to weewx-user
Hi All, 

I am getting the following Critical error on a clean install of Weewx, any ideas, no additional addons.

Nov 7 18:00:30 raspberrypi weewx[615] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
Nov 7 18:00:30 raspberrypi weewx[615] INFO weewx.manager: Starting backfill of daily summaries
Nov 7 18:00:30 raspberrypi weewx[615] INFO user.ws6in1: find_my_device::success getting dev
Nov 7 18:00:30 raspberrypi kernel: [ 866.527875] usb 1-1.2.1: reset full-speed USB device number 6 using dwc_otg
Nov 7 18:00:31 raspberrypi weewx[615] INFO user.ws6in1: initialise_my_device::success getting configuration
Nov 7 18:00:31 raspberrypi weewx[615] INFO user.ws6in1: initialise_my_device::my_cfg.bConfigurationValue = 1
Nov 7 18:00:31 raspberrypi weewx[615] INFO user.ws6in1: initialise_my_device::my_cfg.bNumInterfaces = 1
Nov 7 18:00:32 raspberrypi weewx[615] INFO weewx.engine: Main loop exiting. Shutting engine down.
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: Caught unrecoverable exception:
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** unsupported operand type(s) for -: 'int' and 'NoneType'
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** Traceback (most recent call last):
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** File "/usr/share/weewx/weewxd", line 154, in main
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** engine.run()
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 173, in run
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** self.dispatchEvent(weewx.Event(weewx.STARTUP))
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 241, in dispatchEvent
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** callback(event)
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 580, in startup
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** self._catchup(self.engine.console.genStartupRecords)
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** File "/usr/share/weewx/weewx/engine.py", line 690, in _catchup
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** for record in generator(lastgood_ts):
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** File "/usr/share/weewx/user/ws6in1.py", line 1231, in genStartupRecords
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** packet = self.decode(level)
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** File "/usr/share/weewx/user/ws6in1.py", line 729, in decode
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** my_interval = my_time - self.last_ts
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
Nov 7 18:00:32 raspberrypi weewx[615] CRITICAL main: **** Exiting.  

Tom Keffer

unread,
Nov 7, 2020, 3:38:55 PM11/7/20
to weewx-user
Looks like the author of ws6in1 forgot to check for the case where self.last_ts could be None. This can happen when a brand new database.

I'd submit a bug report on his GitHub repository.

--
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/6eb6599a-931b-423d-88a7-831688d6342bn%40googlegroups.com.

Bob Atchley

unread,
Nov 7, 2020, 4:19:40 PM11/7/20
to weewx-user
Yes ... spot on, missed that one ... a fix on the way

Bob

Peter Hurn

unread,
Nov 8, 2020, 9:23:59 AM11/8/20
to weewx-user
Thanks Both, and thanks Bob for updating the driver, I'll test it now.
Reply all
Reply to author
Forward
0 new messages