This is a excerpt from the extra_sensors_service script - ========== # Get DHT22 data def get_DHT22(self, event): humidity, temperature = DHT.read_retry(DHT.DHT22, self.DHT22_PIN) temperature = temperature * 9.0/5.0 + 32 if humidity is not None: syslog.syslog(syslog.LOG_DEBUG, "extrasensors: found humidity value of %s %%" % humidity) event.packet['inHumidity'] = float(humidity) if temperature is not None: syslog.syslog(syslog.LOG_DEBUG, "extrasensors: found temperature value of %s F" % temperature) # NOTE: stores as celsius event.packet['inTemp'] = float(temperature) ====================== The suggestion is to add something like this ------ # Get DHT22 data def get_DHT22(self, event): humidity, temperature = DHT.read_retry(DHT.DHT22, self.DHT22_PIN)
* try: temperature = temperature * 9.0/5.0 + 32* * except; if temperature is none......* if humidity is not None: syslog.syslog(syslog.LOG_DEBUG, "extrasensors: found humidity value of %s %%" % humidity) event.packet['inHumidity'] = float(humidity) if temperature is not None: syslog.syslog(syslog.LOG_DEBUG, "extrasensors: found temperature value of %s F" % temperature) # NOTE: stores as celsius event.packet['inTemp'] = float(temperature) ============ Am I on the proper path? Michael H Grossie mhgros...@sbcglobal.net On Mon, Sep 14, 2020 at 7:50 PM Michael Grossie <mhgros...@sbcglobal.net> wrote: > Can someone enlighten me on the following that I see in the syslog. the > length is either 21 or 51. > *Sep 14 16:42:10 raspberrypi weewx[1032] INFO weewx.drivers.ws1: Failed > attempt 2 of 5 to get readings: Unexpected buffer length 51* > > Thanks > > > Michael H Grossie > mhgros...@sbcglobal.net > > > On Mon, Sep 14, 2020 at 6:27 PM Michael Grossie <mhgros...@sbcglobal.net> > wrote: > >> Thanks Tom, Vince I apologize - >> >> I will look at something to catch the "none" temperature values. >> >> >> Michael H Grossie >> mhgros...@sbcglobal.net >> >> >> On Mon, Sep 14, 2020 at 4:57 PM Tom Keffer <tkef...@gmail.com> wrote: >> >>> On Mon, Sep 14, 2020 at 2:34 PM Michael Grossie <mhgros...@sbcglobal.net> >>> wrote: >>> >>>> Vince, thanks for responding. I would consider that if the system had >>>> not been running for almost 10 days prior, without an issue. >>>> >>> >>> Sometimes the temperature is valid, occasionally it is None. One must >>> always be vigilant to the possibility that an observation value could be >>> None. The author of the extension was not. >>> >>> The ordering in the log is misleading, but the engine shut down because >>> of the exception, not the other way around. The engine shutdown happens at >>> a lower level than the exception reporting, so it appears earlier in the >>> log as the stack gets unwound. >>> >>> Vince has it right. >>> >>> -tk >>> >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "weewx-user" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/weewx-user/hJ3ZNKmKO6s/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> weewx-user+unsubscr...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAT6rT%3DvtFf-4fmCy5Y7VxQrMn0qutXif%3DqCoUo9SvwxA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEAT6rT%3DvtFf-4fmCy5Y7VxQrMn0qutXif%3DqCoUo9SvwxA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAJBcQpUdNNX%2BLeMsFH0hoi6Zu93bzWc6eYKeOL8eW19agFEs8w%40mail.gmail.com.