G'day Andrew, That was it - I had incorrectly replaced old records and only set the rain and rainRate fields, leaving all the other fields on the row default values. oops - thankfully I have a backup of all the data, so a relatively simple restore. All good now.
Regards, Christopher On Friday, 21 October 2016 18:37:58 UTC+11, Andrew Milner wrote: > > Or better still try and see if there are more records which do not have > usUnits set correctly > eg - assuming you are not in metric - > > select dateTime, usUnits from archive where usUnits <> 1; > > and delete or sort out any such records that are found. > > > On Friday, 21 October 2016 09:58:52 UTC+3, gjr80 wrote: > >> Hi Christopher, >> >> 1475731610 looks ok but what of the record after it? In particular the >> usUnits field. >> >> Gary >> >> On Friday, 21 October 2016 16:54:50 UTC+10, Christopher McAvaney wrote: >>> >>> G'day, >>> >>> Was following the instructions to clean up a bad rain reading from >>> https://github.com/weewx/weewx/wiki/Cleaning-up-old-'bad'-data >>> >>> But, when I execute the --backfill-daily option I am getting a "Unit >>> system mismatch" error. >>> >>> $ wee_database --drop-daily >>> Using configuration file /etc/weewx/weewx.conf >>> Using database binding 'wx_binding', which is bound to database >>> 'archive_mysql' >>> Proceeding will delete all your daily summaries from database 'weewx' >>> Are you sure you want to proceed (y/n)? y >>> Dropping daily summary tables from 'weewx' ... >>> Dropped daily summary tables from database 'weewx' >>> >>> $ wee_database --backfill-daily --dry-run >>> Using configuration file /etc/weewx/weewx.conf >>> Using database binding 'wx_binding', which is bound to database >>> 'archive_mysql' >>> Backfilling daily summaries in database 'weewx' ... >>> Traceback (most recent call last):te: 2016-10-06 16:26:50 AEDT >>> (1475731610) >>> File "/usr/bin/wee_database", line 444, in <module> >>> main() >>> File "/usr/bin/wee_database", line 153, in main >>> backfillDaily(config_dict, db_binding, int(options.trans_days)) >>> File "/usr/bin/wee_database", line 217, in backfillDaily >>> nrecs, ndays = dbmanager.backfill_day_summary(trans_days=trans_days) >>> File "/usr/share/weewx/weewx/manager.py", line 1374, in >>> backfill_day_summary >>> _day_accum.addRecord(_rec) >>> File "/usr/share/weewx/weewx/accum.py", line 240, in addRecord >>> func(self, record, obs_type, add_hilo) >>> File "/usr/share/weewx/weewx/accum.py", line 335, in check_units >>> self._check_units(record['usUnits']) >>> File "/usr/share/weewx/weewx/accum.py", line 348, in _check_units >>> raise ValueError("Unit system mismatch %d v. %d" % >>> (self.unit_system, new_unit_system)) >>> ValueError: Unit system mismatch 1 v. 0 >>> >>> >>> In looking at the data for that timestamp, everything looks o.k.: >>> "dateTime" "usUnits" "interval" "barometer" "pressure" "altimeter" >>> "inTemp" "outTemp" "inHumidity" "outHumidity" "windSpeed" "windDir" >>> "windGust" "windGustDir" "rainRate" "rain" "dewpoint" "windchill" >>> "heatindex" "ET" "radiation" "UV" "extraTemp1" "extraTemp2" "extraTemp3" >>> "soilTemp1" "soilTemp2" "soilTemp3" "soilTemp4" "leafTemp1" "leafTemp2" >>> "extraHumid1" "extraHumid2" "soilMoist1" "soilMoist2" "soilMoist3" >>> "soilMoist4" "leafWet1" "leafWet2" "rxCheckPercent" "txBatteryStatus" >>> "consBatteryVoltage" "hail" "hailRate" "heatingTemp" "heatingVoltage" >>> "supplyVoltage" "referenceVoltage" "windBatteryStatus" >>> "rainBatteryStatus" "outTempBatteryStatus" "inTempBatteryStatus" >>> "1475731610" "1" "5" "29.43787700257" "29.3473124630833" >>> "29.432883539847" "82.4" "79.34" "45" "36" "9.17143879392" "315" >>> "12.07945597248" "315" "0" "0" "50.0428531173988" "79.34" "79.34" \N \N >>> \N \N \N \N \N \N \N \N \N \N \N \N \N \N \N \N \N \N "100" \N \N \N \N >>> \N \N \N \N \N \N "0" \N >>> >>> I don't really understand why this error is thrown as the backfill works >>> for 10's of thousands of records until that particular date. >>> >>> Does anybody know why it would be throwing this unit error? >>> >>> Thanks in advance, >>> Christopher >>> >> -- 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. For more options, visit https://groups.google.com/d/optout.