Hello, 

First off here are my details:

   - Raspberry Pi 3, Raspian 9 (Jessie)
   - Davis Vantage Pro (model 6160)
   - Serial to USB, connected at /dev/ttyUSB0
   - Python 2.7.9
   - weewx 3.8.2 (according to my weewx.conf)


I am a long time (since 2008ish) user of wview and made the switch a few 
weeks ago to weewx. The install went smooth, moved my sdb files over, but I 
couldn't see any pages being generated in the html folder.  I have lurked a 
bit here and read about how to set the debug level in the weewx.conf and I 
have been watching the logs. I also haven't had a ton of time to sit down 
and think things through until today. What I have been observing is, I 
believe, weewx can connect to my data logger and download data, parse it, 
and insert into the sdb.  There is a odd thing happening though, the date 
time stamp is in UTC but the time zone designation is Pacific Daylight Time 
(which is my time zone).  After weewx downloads from the data logger it 
tries to connect to the console, and start the "main loop." It's here that 
the program crashes and exits. I have attached the log 
(mainLoopError_NoneType.txt), if you take a look you will see that weewx 
acknowledges that my raspberry pi's clock (PDT) is less than the UTC time 
coming that the record has (my vantage console has the PDT time displayed). 
Also you will see in the log file that at line 1677 in the vantage.py file 
is where the program crashes. It looks like the value passed into the 
_null_int() function is null and the function cant return the integer of a 
null value. So, here is where I decided to try and handle the error. I 
edited vantage.py and added an if statement to only return the integer if 
the value is not None. I don't really know the repercussions of doing this 
because I haven't dug through the entire program to trace out what this 
value is.  

> # Try to handle NoneType error
>
> def _null_int(v):
>
>     if v is not None:
>
>         return int(v)
>
>
 
After saving and restarting weewx the program doesn't error out and my html 
pages are finally generated! Very exciting but I am wondering if anyone 
here has the experience to know why my console was sending a null value and 
whether my error handling will have any negative effects. I am attaching 
the log file after my little fix for your review too 
(afterEditVantagePy.txt).

Thanks, I am excited to get this up and running!

Mike

-- 
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].
For more options, visit https://groups.google.com/d/optout.
Sep 15 21:49:00 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:15:00 PDT (1537067700) to daily summary in 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:20:00 PDT (1537068000) to database 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:20:00 PDT (1537068000) to daily summary in 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:25:00 PDT (1537068300) to database 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:25:00 PDT (1537068300) to daily summary in 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:30:00 PDT (1537068600) to database 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:30:00 PDT (1537068600) to daily summary in 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:35:00 PDT (1537068900) to database 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:35:00 PDT (1537068900) to daily summary in 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:40:00 PDT (1537069200) to database 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:40:00 PDT (1537069200) to daily summary in 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:45:00 PDT (1537069500) to database 'weewx.sdb'
Sep 15 21:49:01 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:45:00 PDT (1537069500) to daily summary in 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:50:00 PDT (1537069800) to database 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:50:00 PDT (1537069800) to daily summary in 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:55:00 PDT (1537070100) to database 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
20:55:00 PDT (1537070100) to daily summary in 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:00:00 PDT (1537070400) to database 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:00:00 PDT (1537070400) to daily summary in 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:05:00 PDT (1537070700) to database 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:05:00 PDT (1537070700) to daily summary in 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:10:00 PDT (1537071000) to database 'weewx.sdb'
Sep 15 21:49:02 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:10:00 PDT (1537071000) to daily summary in 'weewx.sdb'
Sep 15 21:49:03 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:15:00 PDT (1537071300) to database 'weewx.sdb'
Sep 15 21:49:03 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:15:00 PDT (1537071300) to daily summary in 'weewx.sdb'
Sep 15 21:49:03 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:20:00 PDT (1537071600) to database 'weewx.sdb'
Sep 15 21:49:03 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:20:00 PDT (1537071600) to daily summary in 'weewx.sdb'
Sep 15 21:49:04 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:25:00 PDT (1537071900) to database 'weewx.sdb'
Sep 15 21:49:04 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:25:00 PDT (1537071900) to daily summary in 'weewx.sdb'
Sep 15 21:49:05 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:30:00 PDT (1537072200) to database 'weewx.sdb'
Sep 15 21:49:05 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:30:00 PDT (1537072200) to daily summary in 'weewx.sdb'
Sep 15 21:49:05 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:35:00 PDT (1537072500) to database 'weewx.sdb'
Sep 15 21:49:05 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:35:00 PDT (1537072500) to daily summary in 'weewx.sdb'
Sep 15 21:49:06 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:40:00 PDT (1537072800) to database 'weewx.sdb'
Sep 15 21:49:06 weatherpi weewx[7085]: manager: Added record 2018-09-15 
21:40:00 PDT (1537072800) to daily summary in 'weewx.sdb'
Sep 15 21:49:06 weatherpi weewx[7085]: vantage: DMPAFT complete: page timestamp 
2018-09-15 14:46:00 PDT (1537047960) less than final timestamp 2018-09-15 
21:40:00 PDT (1537072800)
Sep 15 21:49:06 weatherpi weewx[7085]: vantage: Catch up complete.
Sep 15 21:49:06 weatherpi weewx[7085]: engine: Starting main packet loop.
Sep 15 21:49:10 weatherpi weewx[7085]: vantage: Retry  #0 failed
Sep 15 21:49:10 weatherpi weewx[7085]: vantage: Gentle wake up of console 
successful
Sep 15 21:49:10 weatherpi weewx[7085]: vantage: Requesting 200 LOOP packets.
Sep 15 21:49:10 weatherpi weewx[7085]: vantage: Gentle wake up of console 
successful
Sep 15 21:49:10 weatherpi weewx[7085]: engine: Main loop exiting. Shutting 
engine down.
Sep 15 21:49:10 weatherpi weewx[7085]: engine: Caught unrecoverable exception 
in engine:
Sep 15 21:49:10 weatherpi weewx[7085]:     ****  int() argument must be a 
string or a number, not 'NoneType'
Sep 15 21:49:10 weatherpi weewx[7085]:     ****  Traceback (most recent call 
last):
Sep 15 21:49:10 weatherpi weewx[7085]:     ****    File 
"/usr/share/weewx/weewx/engine.py", line 877, in main
Sep 15 21:49:10 weatherpi weewx[7085]:     ****      engine.run()
Sep 15 21:49:10 weatherpi weewx[7085]:     ****    File 
"/usr/share/weewx/weewx/engine.py", line 188, in run
Sep 15 21:49:10 weatherpi weewx[7085]:     ****      for packet in 
self.console.genLoopPackets():
Sep 15 21:49:10 weatherpi weewx[7085]:     ****    File 
"/usr/share/weewx/weewx/drivers/vantage.py", line 507, in genLoopPackets
Sep 15 21:49:10 weatherpi weewx[7085]:     ****      for _loop_packet in 
self.genDavisLoopPackets(200):
Sep 15 21:49:10 weatherpi weewx[7085]:     ****    File 
"/usr/share/weewx/weewx/drivers/vantage.py", line 539, in genDavisLoopPackets
Sep 15 21:49:10 weatherpi weewx[7085]:     ****      loop_packet = 
self._unpackLoopPacket(_buffer[:95])
Sep 15 21:49:10 weatherpi weewx[7085]:     ****    File 
"/usr/share/weewx/weewx/drivers/vantage.py", line 1434, in _unpackLoopPacket
Sep 15 21:49:10 weatherpi weewx[7085]:     ****      val = 
func(raw_loop_packet[_type])
Sep 15 21:49:10 weatherpi weewx[7085]:     ****    File 
"/usr/share/weewx/weewx/drivers/vantage.py", line 1677, in _null_int
Sep 15 21:49:10 weatherpi weewx[7085]:     ****      return int(v)
Sep 15 21:49:10 weatherpi weewx[7085]:     ****  TypeError: int() argument must 
be a string or a number, not 'NoneType'
Sep 15 21:49:10 weatherpi weewx[7085]:     ****  Exiting.
Sep 15 22:03:48 weatherpi rsyslogd-2007: action 'action 17' suspended, next 
retry is Sat Sep 15 22:04:48 2018 [try http://www.rsyslog.com/e/2007 ]
Sep 15 22:05:34 weatherpi rsyslogd-2007: action 'action 17' suspended, next 
retry is Sat Sep 15 22:06:34 2018 [try http://www.rsyslog.com/e/2007 ]
Sep 15 22:05:34 weatherpi systemd[1]: Starting LSB: weewx weather system...
Sep 15 22:05:35 weatherpi weewx[8071]: engine: Initializing weewx version 3.8.2
Sep 15 22:05:35 weatherpi weewx[8071]: engine: Using Python 2.7.9 (default, Sep 
17 2016, 20:26:04) #012[GCC 4.9.2]
Sep 15 22:05:35 weatherpi weewx[8071]: engine: Platform 
Linux-4.14.68-v7+-armv7l-with-debian-8.0
Sep 15 22:05:35 weatherpi weewx[8071]: engine: Locale is 'en_GB.UTF-8'
Sep 15 22:05:35 weatherpi weewx[8071]: engine: pid file is /var/run/weewx.pid
Sep 15 22:05:35 weatherpi weewx[8075]: engine: Using configuration file 
/etc/weewx/weewx.conf
Sep 15 22:05:35 weatherpi weewx[8075]: engine: Debug is 1
Sep 15 22:05:35 weatherpi weewx[8075]: engine: Initializing engine
Sep 15 22:05:35 weatherpi weewx[8075]: engine: Loading station type Vantage 
(weewx.drivers.vantage)
Sep 15 22:05:35 weatherpi weewx[8061]: Starting weewx weather system: weewx.
Sep 15 22:05:35 weatherpi systemd[1]: Started LSB: weewx weather system.
Sep 15 22:05:35 weatherpi weewx[8075]: vantage: Driver version is 3.0.11
Sep 15 22:05:35 weatherpi weewx[8075]: vantage: Opened up serial port 
/dev/ttyUSB0; baud 19200; timeout 4.00
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Retry  #0 failed
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Gentle wake up of console 
successful
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Hardware type is 16
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: ISS ID is 1
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Hardware name: Vantage Pro
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.engine.StdTimeSynch
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.engine.StdTimeSynch
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.engine.StdConvert
Sep 15 22:05:39 weatherpi weewx[8075]: engine: StdConvert target unit is 0x1
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.engine.StdConvert
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.engine.StdCalibrate
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.engine.StdCalibrate
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.engine.StdQC
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.engine.StdQC
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.wxservices.StdWXCalculate
Sep 15 22:05:39 weatherpi weewx[8075]: wxcalculate: The following values will 
be calculated: barometer=prefer_hardware, windchill=prefer_hardware, 
dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, 
windrun=prefer_hardware, heatindex=prefer_hardware, 
maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, 
inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, 
cloudbase=prefer_hardware
Sep 15 22:05:39 weatherpi weewx[8075]: wxcalculate: The following algorithms 
will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.wxservices.StdWXCalculate
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.engine.StdArchive
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Archive will use data binding 
wx_binding
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Record generation will be 
attempted in 'hardware'
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Using archive interval of 300 
seconds (specified by hardware)
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Use LOOP data in hi/low 
calculations: 1
Sep 15 22:05:39 weatherpi weewx[8075]: manager: Daily summary version is 2.0
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Using binding 'wx_binding' to 
database 'weewx.sdb'
Sep 15 22:05:39 weatherpi weewx[8075]: manager: Starting backfill of daily 
summaries
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.engine.StdArchive
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.restx.StdStationRegistry
Sep 15 22:05:39 weatherpi weewx[8075]: restx: StationRegistry: Registration not 
requested.
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.restx.StdStationRegistry
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.restx.StdWunderground
Sep 15 22:05:39 weatherpi weewx[8075]: restx: Wunderground: Posting not enabled.
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.restx.StdWunderground
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.restx.StdPWSweather
Sep 15 22:05:39 weatherpi weewx[8075]: restx: PWSweather: Posting not enabled.
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.restx.StdPWSweather
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.restx.StdCWOP
Sep 15 22:05:39 weatherpi weewx[8075]: restx: CWOP: Posting not enabled.
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.restx.StdCWOP
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.restx.StdWOW
Sep 15 22:05:39 weatherpi weewx[8075]: restx: WOW: Posting not enabled.
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.restx.StdWOW
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.restx.StdAWEKAS
Sep 15 22:05:39 weatherpi weewx[8075]: restx: AWEKAS: Posting not enabled.
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.restx.StdAWEKAS
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.engine.StdPrint
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.engine.StdPrint
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Loading service 
weewx.engine.StdReport
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Finished loading service 
weewx.engine.StdReport
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Starting up weewx version 3.8.2
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Gentle wake up of console 
successful
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Clock error is -0.50 seconds 
(positive is fast)
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Getting archive packets since 
2018-09-15 21:40:00 PDT (1537072800)
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Gentle wake up of console 
successful
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Retrieving 2 page(s); starting 
index= 1
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: DMPAFT complete: page timestamp 
2018-09-15 14:46:00 PDT (1537047960) less than final timestamp 2018-09-15 
21:40:00 PDT (1537072800)
Sep 15 22:05:39 weatherpi weewx[8075]: vantage: Catch up complete.
Sep 15 22:05:39 weatherpi weewx[8075]: engine: Starting main packet loop.
Sep 15 22:05:43 weatherpi weewx[8075]: vantage: Retry  #0 failed
Sep 15 22:05:43 weatherpi weewx[8075]: vantage: Gentle wake up of console 
successful
Sep 15 22:05:43 weatherpi weewx[8075]: vantage: Requesting 200 LOOP packets.
Sep 15 22:05:43 weatherpi weewx[8075]: vantage: Gentle wake up of console 
successful
Sep 15 22:07:31 weatherpi rsyslogd-2007: action 'action 17' suspended, next 
retry is Sat Sep 15 22:08:31 2018 [try http://www.rsyslog.com/e/2007 ]
Sep 15 22:10:14 weatherpi weewx[8075]: vantage: Getting archive packets since 
2018-09-15 21:40:00 PDT (1537072800)
Sep 15 22:10:14 weatherpi rsyslogd-2007: action 'action 17' suspended, next 
retry is Sat Sep 15 22:11:14 2018 [try http://www.rsyslog.com/e/2007 ]
Sep 15 22:10:17 weatherpi weewx[8075]: vantage: Retry  #0 failed
Sep 15 22:10:17 weatherpi weewx[8075]: vantage: Rude wake up of console 
successful
Sep 15 22:10:17 weatherpi weewx[8075]: vantage: Retrieving 2 page(s); starting 
index= 1
Sep 15 22:10:17 weatherpi weewx[8075]: vantage: DMPAFT complete: page timestamp 
2018-09-15 14:46:00 PDT (1537047960) less than final timestamp 2018-09-15 
21:40:00 PDT (1537072800)
Sep 15 22:10:17 weatherpi weewx[8075]: vantage: Catch up complete.
Sep 15 22:10:18 weatherpi weewx[8075]: vantage: Requesting 200 LOOP packets.
Sep 15 22:10:18 weatherpi weewx[8075]: reportengine: Running reports for latest 
time in the database.
Sep 15 22:10:18 weatherpi weewx[8075]: reportengine: Running report 
StandardReport
Sep 15 22:10:18 weatherpi weewx[8075]: reportengine: Found configuration file 
/etc/weewx/skins/Standard/skin.conf for report StandardReport
Sep 15 22:10:18 weatherpi weewx[8075]: cheetahgenerator: using search list 
['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 
'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 
'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras']
Sep 15 22:10:18 weatherpi weewx[8075]: manager: Daily summary version is 2.0
Sep 15 22:10:22 weatherpi weewx[8075]: vantage: Retry  #0 failed
Sep 15 22:10:22 weatherpi weewx[8075]: vantage: Gentle wake up of console 
successful
Sep 15 22:10:48 weatherpi weewx[8075]: cheetahgenerator: Generated 61 files for 
report StandardReport in 30.01 seconds
Sep 15 22:10:48 weatherpi weewx[8075]: manager: Daily summary version is 2.0
Sep 15 22:11:00 weatherpi weewx[8075]: imagegenerator: Generated 49 images for 
StandardReport in 12.06 seconds
Sep 15 22:11:00 weatherpi weewx[8075]: copygenerator: copied 9 files to 
/var/www/html/weewx
Sep 15 22:11:00 weatherpi weewx[8075]: reportengine: Running report FTP
Sep 15 22:11:00 weatherpi weewx[8075]: reportengine: Found configuration file 
/etc/weewx/skins/Ftp/skin.conf for report FTP
Sep 15 22:11:00 weatherpi weewx[8075]: ftpgenerator: FTP upload not requested. 
Skipped.
Sep 15 22:11:00 weatherpi weewx[8075]: reportengine: Running report RSYNC
Sep 15 22:11:00 weatherpi weewx[8075]: reportengine: Found configuration file 
/etc/weewx/skins/Rsync/skin.conf for report RSYNC
Sep 15 22:11:00 weatherpi weewx[8075]: rsyncgenerator: rsync upload not 
requested. Skipped.

Reply via email to