dht11 example
Posted: 2024-01-08 19:58
Hi,
I've got Lucfox Pico Pro/Max, as first job I would like to run DHT22 sensor, it is compatible with DHT11 by the way.
Of course I read Your tutorial from here:
https://wiki.luckfox.com/Luckfox-Pico/L ... Pico-dht11
But, reading sdk I've noticed that probably instruction from link above is depracated right becouse there is already built in driver for DHT sensor in sdk. I mean:
/sysdrv/source/kernel/drivers/iio/humidity/dht11.c
I enabled this driver using menuconfig and instruction from link below:
https://wiki.luckfox.com/Luckfox-Pico/L ... Menuconfig
Then, according to devicetree documentation from location
/sysdrv/source/kernel/Documentation/devicetree/bindings/iio/humidity/dht11.txt
I modified device tree for my board
/sysdrv/source/kernel/arch/arm/boot/dts/rv1106g-luckfox-pico-pro-max.dts
by adding definition acording to documentation, top of my device tree looks like below
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2022 Rockchip Electronics Co., Ltd.
*/
/dts-v1/;
#include "rv1106.dtsi"
#include "rv1106-evb.dtsi"
#include "rv1106-luckfox-pico-pro-max-ipc.dtsi"
/ {
model = "Luckfox Pico Max";
compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1106";
dht22 {
status = "okay";
compatible = "dht11";
gpios = <&gpio1 7 0>;
};
};
I commented PWM11 periphery as well.
//&pwm11 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm11m1_pins>;
// // pinctrl-0 = <&pwm11m2_pins>;
// // pinctrl-0 = <&pwm11m0_pins>;
//};
After pristin build and flashing I can't see /dev/dht22 device... Am I doing wrong something?
I've got Lucfox Pico Pro/Max, as first job I would like to run DHT22 sensor, it is compatible with DHT11 by the way.
Of course I read Your tutorial from here:
https://wiki.luckfox.com/Luckfox-Pico/L ... Pico-dht11
But, reading sdk I've noticed that probably instruction from link above is depracated right becouse there is already built in driver for DHT sensor in sdk. I mean:
/sysdrv/source/kernel/drivers/iio/humidity/dht11.c
I enabled this driver using menuconfig and instruction from link below:
https://wiki.luckfox.com/Luckfox-Pico/L ... Menuconfig
Then, according to devicetree documentation from location
/sysdrv/source/kernel/Documentation/devicetree/bindings/iio/humidity/dht11.txt
I modified device tree for my board
/sysdrv/source/kernel/arch/arm/boot/dts/rv1106g-luckfox-pico-pro-max.dts
by adding definition acording to documentation, top of my device tree looks like below
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2022 Rockchip Electronics Co., Ltd.
*/
/dts-v1/;
#include "rv1106.dtsi"
#include "rv1106-evb.dtsi"
#include "rv1106-luckfox-pico-pro-max-ipc.dtsi"
/ {
model = "Luckfox Pico Max";
compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1106";
dht22 {
status = "okay";
compatible = "dht11";
gpios = <&gpio1 7 0>;
};
};
I commented PWM11 periphery as well.
//&pwm11 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm11m1_pins>;
// // pinctrl-0 = <&pwm11m2_pins>;
// // pinctrl-0 = <&pwm11m0_pins>;
//};
After pristin build and flashing I can't see /dev/dht22 device... Am I doing wrong something?