Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DHT11/DHT22/AM2302 temperature retrieval with recent versions of … #503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions octoprint_enclosure/getDHTTemp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import time
import adafruit_dht

from microcontroller import Pin

# Parse command line parameters.
sensor_args = {
Expand All @@ -16,7 +16,7 @@
else:
sys.exit(1)

dht_dev = sensor(pin)
dht_dev = sensor(Pin(pin))

# DHT sensor read fails quite often, causing enclosure plugin to report value of 0.
# If this happens, retry as suggested in the adafruit_dht docs.
Expand All @@ -42,4 +42,4 @@
retry_count += 1

print('-1 | -1')
sys.exit(1)
sys.exit(1)