# dateTime,altimeter,appTemp,barometer,channel,cloudbase,dewpoint,heatindex,humidex,inTemp,maxSolarRad,outHumidity,outTemp,outTempBatteryStatus,pressure,rainRate,rssi,rxCheckPercent,sensor_battery,sensor_id,usUnits,windSpeed,windchill
1571077878,75.1909422213,None,3733.59877061,57.2421654093,72.9,78.9824045747,None,58,72.9,0,0,3,100.0,0,1228,1,None,0.0,72.91571077931,29.9314717722,None,76.19,None,0,29.7514624062,None,0,110.4646,3,100.0,0,1228,1,180.0,3.707606845041571077949,74.1763675742,None,3850.99831681,57.225607406,73.4,79.472688903,None,57,73.4,0,0,3,100.0,0,1228,1,2.67886214224,73.4
# dateTime,maxSolarRad,outTemp,rainRate,txBatteryStatus,usUnits,windDir,windSpeed,windchill
1571103610,0.0,49.4,0,0,1,None,0.0,49.4
1571103612,0.0,0.0,0,0,1,None,0.0
1571103615,0.0,0.0,0,1,None,0.0
1571103617,0.0,0.0,0,0,1,None,0.0
1571103620,0.0,49.4,0,0,1,None,0.0,49.4
1571103625,0.0,0.0,0,1,None,0.0
1571103627,30.0690643936,47.1460416382,44.15,69.98,0.0,29.6138526645,0,1LOOP: 2019-10-15 08:09:56 PDT (1571152196) altimeter: 29.9926902844, channel: None, dateTime: 1571152196, inTemp: 77.0, maxSolarRad: None, outTempBatteryStatus: 0, pressure: 29.8123680055, rain: None, rain_total: 110.4646, rainRate: 0, rssi: 3, rxCheckPercent: 100.0, sensor_battery: 0, sensor_id: 1228, usUnits: 1, windDir: None, windSpeed: 0.0LOOP: 2019-10-15 08:10:14 PDT (1571152214) appTemp: 54.9009717276, channel: None, cloudbase: 428.468658946, dateTime: 1571152214, dewpoint: 52.8847379006, heatindex: 54.0, humidex: 57.6993884477, maxSolarRad: None, outHumidity: 96, outTemp: 54.0, outTempBatteryStatus: 0, rainRate: 0, rssi: 3, rxCheckPercent: 100.0, sensor_battery: 0, sensor_id: 1228, usUnits: 1, windchill: 54.0, windDir: None, windSpeed: 0.01571152196,29.9926902844,None,77.0,None,0,29.8123680055,None,0,110.4646,3,100.0,0,1228,1,None,0.01571152214,54.9009717276,None,428.468658946,52.8847379006,54.0,57.6993884477,None,96,54.0,0,0,3,100.0,0,1228,1,None,0.0,54.0Tue Oct 15 08:09:56 2019 altimeter:29.9926902844 barometer:77.0 dewpoint:29.8123680055 inTemp:110.4646 maxSolarRad:3 outHumidity:100.0 outTempBatteryStatus:1228 pressure:1 rssi:0.0 Tue Oct 15 08:10:14 2019 altimeter:54.9009717276 barometer:428.468658946 channel:52.8847379006 cloudbase:54.0 dewpoint:57.6993884477 humidex:96 inTemp:54.0 outTemp:3 outTempBatteryStatus:100.0 rainRate:1228 rssi:1 sensor_battery:0.0 sensor_id:54.0
# dateTime,altimeter,appTemp,barometer,channel,cloudbase,dewpoint,heatindex,humidex,inTemp,maxSolarRad,outHumidity,outTemp,outTempBatteryStatus,pressure,rainRate,rssi,rxCheckPercent,sensor_battery,sensor_id,usUnits,windSpeed,windchill
Also, I am assuming you're on the latest CSV extension version, but I shouldn't assume anything. Are you on the latest CSV extension version?
I saw the debug, but didn't see any actual helpful debug output. That's why I asked for a syslog.
Oct 15 08:09:55 myserver weewx[18438]: engine: Debug is 1Oct 15 08:09:55 myserver weewx[18438]: engine: Initializing engineOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.engine.StdTimeSynchOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.engine.StdTimeSynchOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.engine.StdConvertOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.engine.StdConvertOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.engine.StdCalibrateOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.engine.StdCalibrateOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.engine.StdQCOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.engine.StdQCOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.wxservices.StdWXCalculateOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.wxservices.StdWXCalculateOct 15 08:09:55 myserver weewx[18438]: engine: Loading service user.csv.CSVOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service user.csv.CSVOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.engine.StdArchiveOct 15 08:09:55 myserver weewx[18438]: engine: Use LOOP data in hi/low calculations: 1Oct 15 08:09:55 myserver weewx[18438]: manager: Daily summary version is 2.0Oct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.engine.StdArchiveOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.engine.StdPrintOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.engine.StdPrintOct 15 08:09:55 myserver weewx[18438]: engine: Loading service weewx.engine.StdReportOct 15 08:09:55 myserver weewx[18438]: engine: Finished loading service weewx.engine.StdReportOct 15 08:09:55 myserver weewx[18438]: engine: Station does not support reading the timeOct 15 08:09:56 myserver weewx[18438]: acurite: Found station at bus= device=Oct 15 08:09:56 myserver weewx[18438]: acurite: next read in 18 secondsOct 15 08:10:14 myserver weewx[18438]: acurite: Found station at bus= device=Oct 15 08:10:14 myserver weewx[18438]: acurite: next read in 18 seconds
Hi,The problem you are experiencing is due an incompatibility between your station emitting what is known as partial loop packets (ie not all obs are included in all loop packets) and the mode in which you are operating the csv extension.You are running the CSV extension such that it emits loop data to file and includes a header line. Subsequent loop packets are appended to the file. The header line is only written (1) when the csv output file is first created or (2) on each loop packet but only if mode = 'overwrite'. In your case you are using 'append' mode so the header line is only written when the csv output file is first created. Think now of the situation where the first loop packet has, say, observation outTemp but the next loop packet does not. So the header line is written and includes 'outTemp' in the relevant place. The line of csv data for that packet is written to file and each field matches with the header line. When the next loop packet is processed there is no outTemp field in the loop packet so nothing is written in outTemp's place in the line of csv data (well in fact something will be written it will be the next field if there is one). Consequently when your parser parses that line it expects to see outTemp data when in fact it sees the next value instead (perhaps it was outTempBatteryStatus) and hence you get nonsense values from your parser.
dateTime,altimeter,appTemp,barometer,channel,cloudbase,dewpoint,heatindex,humidex,inDewpoint,maxSolarRad,outHumidity,outTemp,rainRate,rssi,rxCheckPercent,sensor_battery,sensor_id,txTempBatteryStatus,usUnits,windSpeed,windchill1571075730,None,71.4621394073,None,None,3276.5581345,56.6531442082,70.3,76.0399971396,None,None,62,70.3,0,3,100.0,0,1228,0,1,1.65011333748,70.3dateTime,altimeter,appTemp,barometer,channel,cloudbase,dewpoint,heatindex,humidex,inDewpoint,maxSolarRad,rain,rainRate,rain_total,rssi,rxCheckPercent,sensor_battery,sensor_id,txTempBatteryStatus,usUnits,windDir,windSpeed,windchill1571075748,None,None,None,None,None,None,None,None,None,None,0.0,0,110.4646,3,100.0,0,1228,0,1,180.0,2.16448441021,NonedateTime,altimeter,appTemp,barometer,channel,cloudbase,dewpoint,heatindex,humidex,inDewpoint,inTemp,maxSolarRad,outHumidity,outTemp,pressure,rainRate,rssi,rxCheckPercent,sensor_battery,sensor_id,txTempBatteryStatus,usUnits,windSpeed,windchill1571075766,29.9423211803,71.4621394073,29.9470837144,None,3276.5581345,56.6531442082,70.3,76.0399971396,None,74.39,None,62,70.3,29.7622563497,0,3,100.0,0,1228,0,1,1.65011333748,70.3
[CSV] filename = /var/db/weewx/weewx.csv header = true
Solutions, there are a few possibilities:1. use 'overwrite' mode instead of append, in this mode the header line is written each time a packet is processed but there is only ever one line in your csv output file2. delete the csv output file after each loop packet is read by your parser (this is a pretty lame solution)3. rewrite the csv extension to cache loop packet data so that a 'complete' loop packet is written each time4. emit archive record data rather than loop packet data
# If the station hardware supports data logging then the archive interval # will be downloaded from the station. Otherwise, specify it (in seconds). archive_interval = 300
header = None
if self.emit_header and (
not os.path.exists(filename) or flag == "w"):
header = '# %s\n' % ','.join(self.sort_keys(data))
header = '# %s\n' % ','.join(self.sort_keys(data))