vitormhenrique / OctoPrint-Enclosure

OctoPrint Enclosure Plugin
GNU General Public License v3.0
395 stars 201 forks source link

DS18B20 Sensor - Not getting readings in dashboard #485

Closed sorscode closed 2 years ago

sorscode commented 2 years ago

Describe the bug Installed the Enclosure Plugin, wired up a DS18B20 with a 4.7K resistor. I can see the sensor and the values however the plugin is not reading the data.

This is what I'm seeing in the log:

2022-04-25 12:05:30,594 - octoprint.plugins.enclosure - WARNING - An exception of type IndexError occurred on log_error. Arguments:
('list index out of range',)
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1009, in get_sensor_data
    temp = self.read_18b20_temp(sensor['ds18b20_serial'])
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1319, in read_18b20_temp
    lines = self.read_raw_18b20_temp(serial_number)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1334, in read_raw_18b20_temp
    device_folder = glob.glob(base_dir + str(serial_number) + '*')[0]
IndexError: list index out of range
2022-04-25 12:05:30,596 - octoprint.plugins.enclosure - WARNING - An exception of type TypeError occurred on log_error. Arguments:
('cannot unpack non-iterable NoneType object',)
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 827, in check_enclosure_temp
    temp, hum, airquality = self.get_sensor_data(sensor)
TypeError: cannot unpack non-iterable NoneType object

/sys/bus/w1/devices:

pi@snt-mo-3d01:/sys/bus/w1/devices $ ls
28-000005b4b535  w1_bus_master1

cat w1_slave:

pi@snt-mo-3d01:/sys/bus/w1/devices/28-000005b4b535 $ cat w1_slave
64 01 4b 46 7f ff 0c 10 01 : crc=01 YES
64 01 4b 46 7f ff 0c 10 01 t=22250

cat /boot/config.txt | grep w1:

pi@snt-mo-3d01:/boot $ cat config.txt | grep w1
dtoverlay=w1-gpio

Any help would be appreciated.

sorscode commented 2 years ago

Some odd reason, removing the configuration and re-applying, it finally worked. Now to figure out why my CPU is getting hot now.