Cannot decode reading of 'None' for gauge 'windDir'

64 views
Skip to first unread message

Andrej B.

unread,
Jun 24, 2020, 12:15:36 PM6/24/20
to weewx-user
Good afternoon,

I use Bootstrap theme with Nick gauges (dajda.net). Weewx ver. 4.1 under python 2.7 (Debian Buster)
In my syslog every archive interval I see hundreds messages like: GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'
This is only happens when wind speed is not None. Below is logfile part:

Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: outTemp reading = 25.5 degree_C
Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: inTemp reading = 24.1111111111 degree_C
Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: barometer reading = 1022.58763232 mbar
Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: outHumidity reading = 49.0 percent
Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: inHumidity reading = 56.0 percent
Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: windSpeed reading = 2.68224 meter_per_second
Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: windGust reading = 6.25856 meter_per_second
Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: windDir reading = 0.0 degree_compass
Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'
Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'
Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'


This is part of code responsible for this:

try:
            history = int(plot_options.get('history'))
        except:
            pass
        else:
            history_list = []
            windspeed_history_list = []

            batch_records = self.db_manager.genBatchRecords(self.lastGoodStamp - history * 60 * 60, self.lastGoodStamp)

            for rec in batch_records:
                db_value_tuple = weewx.units.as_value_tuple(rec, columnname)
                history_value = weewx.units.convert(db_value_tuple, target_unit)[0]

                try:
                    history_list.append(float(history_value))
                except:
                    syslog.syslog(syslog.LOG_DEBUG, "GaugeGenerator: Cannot decode reading of '%s' for gauge '%s'"
                                  % (history_value, gaugename))


Why this happens when wind speed has reading?

Thanks
gaugeengine.py

Andrej B.

unread,
Jun 24, 2020, 3:27:52 PM6/24/20
to weewx-user
If wind speed is 0, then "cannot decode" message is not seen:

Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: windSpeed reading = 0.0 meter_per_second
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: windGust reading = 0.0 meter_per_second
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: windDir has no reading (None)
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: radiation reading = 0.0 watt_per_meter_squared
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: UV reading = 0.0 uv_index

Pat

unread,
Jun 24, 2020, 3:37:29 PM6/24/20
to weewx-user
I'm not the maintainer of this extension, and I don't use it so I'm purely guessing here.  

But based on the information you've given, try replacing the section you've pasted with this. Maintain a backup copy in case you need to revert back. 

try:
            history
= int(plot_options.get('history'))
       
except:
           
pass
       
else:
            history_list
= []
            windspeed_history_list
= []


            batch_records
= self.db_manager.genBatchRecords(self.lastGoodStamp - history * 60 * 60, self.lastGoodStamp)


           
for rec in batch_records:
                db_value_tuple
= weewx.units.as_value_tuple(rec, columnname)
                history_value
= weewx.units.convert(db_value_tuple, target_unit)[0]


               
try:

                   
if history_value is not None:
                        history_list
.append(float(history_value))
                   
else:
                       
continue

               
except:
                    syslog
.syslog(syslog.LOG_DEBUG, "GaugeGenerator: Cannot decode reading of '%s' for gauge '%s'"
                                 
% (history_value, gaugename))

Andrej B.

unread,
Jul 13, 2020, 12:34:29 PM7/13/20
to weewx-user
Hello,

Thanks. Look like this improvement works!


Andrej
Reply all
Reply to author
Forward
0 new messages