Open WontedAcorn44 opened 2 years ago
I am having a similar issue. Only getting checksum/not full buffer errors.
import time
import board
from adafruit_dht import DHT22
dht = DHT22(board.D15, use_pulseio=False)
while True:
try:
dht.measure()
print(f"Temp: {dht.temperature} Humidity: {dht.humidity}")
except Exception as e:
print("Failed")
print(e)
finally:
time.sleep(2.5)
print('-----')
DHT sensor not found, check wiring
So, I think it's your code that sets an error GPIO output PIN.
What's the board.D4
PIn? Raspberry Pi GPIO is not that PIN as far as I know.
Try changing your code as below shows @WontedAcorn44
- dhtDevice = adafruit_dht.DHT22(board.D4)
+ # BCM GPIO 18 PIN
+ dhtDevice = adafruit_dht.DHT22(board.18)
I am trying to use a raspberry pi 4 to capture and store values taken from a DHT22 sensor and I get these errors whenever I try to connect it in properly:
Can anyone make any sense of this?
My code is as follows:
I tried to remedy the problem with this:
But, all I get are things like: Checksum did not validate. Try again. A full buffer was not returned. Try again.
NOTICE: I am in no way passing the code above off as my own purely.