Closed markleary closed 2 years ago
the error are in python script getDHTTemp.py in octoprint_enclosure directory! maybe adafruit_dht library change from last review. for fixing i this dictionary:
'5': board.D5 '6': board.D6 '7': board.D7 '8': board.D8 '9': board.D9 '10': board.D10 '11': board.D11 '12': board.D12 '13': board.D13 '14': board.D14 '15': board.D15 '16': board.D16 '17': board.D17 '18': board.D18 '19': board.D19 '20': board.D20 '21': board.D21 '22': board.D22 '23': board.D23 '24': board.D24 '25': board.D25 '26': board.D26 '27': board.D27
and define pin = board_pin[sys.argv[2]]
now the line: dht_dev = sensor(pin) works correctly
DHT sensor reads fail fairly often, causing the enclosure plugin to report a value of 0. When this happens, octoprint logs the exception:
This seem to be a well known issue, the adafruit_dht docs recommend catching the failed read exception and retrying. I no longer get false 0 degree readings with this change.