lm-sensors crash
Saw the following crash on my RPi:
May 06 19:14:41 hallmonitor-pi python3[25286]: Exception in thread Plugin-1-lm_sensors:
May 06 19:14:41 hallmonitor-pi python3[25286]: Traceback (most recent call last):
May 06 19:14:41 hallmonitor-pi python3[25286]: File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
May 06 19:14:41 hallmonitor-pi python3[25286]: self.run()
May 06 19:14:41 hallmonitor-pi python3[25286]: File "/home/pi/mqtt4hass/mqtt4hass.py", line 145, in run
May 06 19:14:41 hallmonitor-pi python3[25286]: self.loop()
May 06 19:14:41 hallmonitor-pi python3[25286]: File "/home/pi/mqtt4hass/plugins/lm_sensors/__init__.py", line 51, in loop
May 06 19:14:41 hallmonitor-pi python3[25286]: sensor_data = lm_sensors.read_sensors()
May 06 19:14:41 hallmonitor-pi python3[25286]: File "/home/pi/mqtt4hass/plugins/lm_sensors/__init__.py", line 109, in read_sensors
May 06 19:14:41 hallmonitor-pi python3[25286]: "value": feature.get_value(),
May 06 19:14:41 hallmonitor-pi python3[25286]: File "/home/pi/.local/lib/python3.7/site-packages/sensors/__init__.py", line 142, i
May 06 19:14:41 hallmonitor-pi python3[25286]: return next(iter(self)).get_value()
May 06 19:14:41 hallmonitor-pi python3[25286]: File "/home/pi/.local/lib/python3.7/site-packages/sensors/__init__.py", line 90, in
May 06 19:14:41 hallmonitor-pi python3[25286]: _get_value(byref(self.parent.chip), self.number, byref(result))
May 06 19:14:41 hallmonitor-pi python3[25286]: File "/home/pi/.local/lib/python3.7/site-packages/sensors/__init__.py", line 36, in
May 06 19:14:41 hallmonitor-pi python3[25286]: raise SensorsError(_strerror(result), result)
May 06 19:14:41 hallmonitor-pi python3[25286]: sensors.SensorsError: b"Can't read"
It looks like if there is an error reading the sensor, the plugin just crashes. It probably should log an error and try again on the next scheduled interval.
Edited by David G. Martin IV