Describe the bug
I think DHT11 module doesn't work with my kernel image
Steps to reproduce the behaviour
My aim is to read dht11 from the file system (kernel module)
Steps :
- Changed my device tree bcm2711-rpi-4-b.dts and added the following lines
humidity-sensor {
compatible = "dht11";
gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
};
- connected my dht data to gpio17 - vcc to rpi.5v - gnd to rpi.gnd
- i can find the file in ls -l /sys/bus/iio/devices/iio:device0
- output of
ls -l /sys/bus/iio/devices/iio:device0 is :
-rw-r--r-- 1 root root 4096 Jun 7 01:30 in_humidityrelative_input
-rw-r--r-- 1 root root 4096 Jun 7 01:30 in_temp_input
-r--r--r-- 1 root root 4096 Jun 7 01:29 name
lrwxrwxrwx 1 root root 0 Jun 7 01:30 of_node -> ../../../../firmware/devicetree/base/humidity-sensor
drwxr-xr-x 2 root root 0 Jun 7 01:30 power
lrwxrwxrwx 1 root root 0 Jun 7 01:30 subsystem -> ../../../../bus/iio
-rw-r--r-- 1 root root 4096 Jun 7 01:29 uevent
-r--r--r-- 1 root root 4096 Jun 7 01:30 waiting_for_supplier
- I try to read the temperature using the following code :
It shows
cat: in_temp_input: Input/output error
- output of
dmesg | tail is
[ 59.967095] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 4
[ 62.719064] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 3
[ 64.866734] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 3
[ 193.956733] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 3
- The reading in dmesg is correct. I tried to test it with a lighter and the temperature increased correctly.
- I tried to connect dht11 on gpio4 and use a python script to read the data using
adafruit-circuitpython-dht and it worked fine (following that article https://pimylifeup.com/raspberry-pi-dht11-sensor/)
Device (s)
Raspberry Pi 4 Mod. B
System
cat /etc/issue :
Raspbian GNU/Linux 12 \n \l
cat /etc/rpi-issue :
Raspberry Pi reference 2024-03-15
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 11096428148f0f2be3985ef3126ee71f99c7f1c2, stage5
vcgencmd version :
May 24 2024 15:30:04
Copyright (c) 2012 Broadcom
version 4942b7633c0ff1af1ee95a51a33b56a9dae47529 (clean) (release) (start)
uname -m :
Logs
[ 59.967095] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 4
[ 62.719064] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 3
[ 64.866734] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 3
[ 193.956733] dht11 humidity-sensor: Don't know how to decode data: 42 0 31 3
Additional context
It may be irrelevant. But I am also appended lcd and i2c-gepio-expander to my rpi device tree to work with the modules. Both of them work fine.
Describe the bug
I think DHT11 module doesn't work with my kernel image
Steps to reproduce the behaviour
My aim is to read dht11 from the file system (kernel module)
Steps :
ls -l /sys/bus/iio/devices/iio:device0is :It shows
dmesg | tailisadafruit-circuitpython-dhtand it worked fine (following that article https://pimylifeup.com/raspberry-pi-dht11-sensor/)Device (s)
Raspberry Pi 4 Mod. B
System
cat /etc/issue:cat /etc/rpi-issue:vcgencmd version:uname -m:Logs
Additional context
It may be irrelevant. But I am also appended lcd and i2c-gepio-expander to my rpi device tree to work with the modules. Both of them work fine.