Cubieboard2 gpio read problem with DHT22(AM2302)


Recommended Posts

Hello guys!

 

I haven't found any helpful regarding to my problem, maybe you are more professional as me! (I'm not really!) :)

I would like to set an ordered DHT22 temp & humidity sensor to work on this SBC.

OS is :

NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
Kernel :

Linux cubieboard2 5.3.9-sunxi #19.11.3 SMP Mon Nov 18 18:49:43 CET 2019 armv7l armv7l armv7l GNU/Linux

I can export a pin as GPIO, and control a simple led.

I've built a kernel module for DHT22 found on github : https://github.com/edwardlintw/DHT22

The main problem is, after successful GPIO export :

echo 202 > /sys/class/gpio/export

cat /sys/kernel/debug/gpio | grep 202
 gpio-202 (                    |sysfs               ) in  lo

can't read a value!

It's all the same, I load a kernel module, or not, I get the following message :

gpioget gpiochip0 202
gpioget: error reading GPIO values: Device or resource busy

And with the kernel module :

insmod dht22.ko gpio=202
insmod: ERROR: could not insert module dht22.ko: Device or resource busy

In kernel.log I see followings :

[  906.815645] sun4i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[ 1224.340665] dht22: loading out-of-tree module taints kernel.
[ 1224.342543] Loading dht22 module...
[ 1224.359904] dht22 driver (major 241) installed
[ 1224.377611] dht22 failed to request GPIO 202, unloaded

 

If I don't create a pin for GPIO, result looks like :

Invalid parameters!

 

[   97.922348] dht22: loading out-of-tree module taints kernel.
[   97.924030] Loading dht22 module...
[   97.942646] dht22 driver (major 241) installed
[   97.960523] sun4i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[   97.961115] dht22 failed to get IRQ for GPIO 202, unloaded

 

What do I wrong? Could somebody give me some hint?

 

Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...