I am trying to use a DHT21 with a Lamobo R1 aka Banana PI R1 to read temperature and humidity, with Armbian/Jessie and a 4.5.2 kernel. A Lamobo R1 is basically an A20 board raspberry pi compatible, with an inverted compatible raspberry pi 2 bus.
I have setup it up in GPIO5, raspberry pin compatible 24, WirinPi 5, physical pin 18, according to a table here, plus the GND and +5V pins.
I tried to read the temperature and humidity with and without the recommended resistor. While the temperature is reading fine, and is also corroborated by a DS18b20 sensor connected to GPIO2, the humidity is always at 99.9%.
I have installed the WiringPi compatible library from WiringBP repository.
However, using for instance DHT21-AM2301 or lol_dht22 I have got always the output of Humidity as 99.9% or 99.90%
A custom kernel module for this chip, am2301 simply hangs the machine.
What I have found until now is:
- It seems to work with Raspberry and Arduino;
- The DHT21 is highly sensitive to timings, even in the original raspberry;
- Some people did report it only worked in GPIO1 and GPIO2 in the original raspberry, whilst the other GPIOs had much greater latency;
- There is a much more complicated hardware setup to connect it to a I2C, in which I am not particularly interested;
- Some people also theorise it only works with kernel 3;
- The Lamobo R1 seems to have a pullup pin bus by default;
- Readings can be done only every second due to chipset limitations;
- The physical implementation of the R1 bus compared to the rpi allows me to get by without the resistor;
- The limit of cable seems to be 25m, and there are anecdotal tales of people achieving 60m with UTP cable. Mine is no longer than 20cm;
- It cannot be exposed to direct sunlight due to maintaining the chemical balance;
- Said chemical balance degrades over time (2-3 years?).
Does anyone has anything else to add?
Additional notes as per comments:
- Humidity comes first than temperature;
- As @ChrisStratton correctly theorised, humidity bits are all 1;
- I have already tested two DHT21 sensors with the same results.
The output of
gpio readall
is
+----------+-Rev3-+------+--------+------+-------+
| wiringPi | GPIO | Phys | Name | Mode | Value |
+----------+------+------+--------+------+-------+
| 0 | 17 | 11 | GPIO 0 | IN | Low |
| 1 | 18 | 12 | GPIO 1 | IN | High |
| 2 | 27 | 13 | GPIO 2 | IN | Low |
| 3 | 22 | 15 | GPIO 3 | IN | Low |
| 4 | 23 | 16 | GPIO 4 | IN | Low |
| 5 | 24 | 18 | GPIO 5 | OUT | High |
| 6 | 25 | 22 | GPIO 6 | IN | Low |
| 7 | 4 | 7 | GPIO 7 | IN | Low |
| 8 | 2 | 3 | SDA | ALT5 | High |
| 9 | 3 | 5 | SCL | ALT5 | High |
| 10 | 8 | 24 | CE0 | IN | Low |
| 11 | 7 | 26 | CE1 | IN | Low |
| 12 | 10 | 19 | MOSI | ALT5 | Low |
| 13 | 9 | 21 | MISO | ALT5 | Low |
| 14 | 11 | 23 | SCLK | ALT5 | Low |
| 15 | 14 | 8 | TxD | ALT0 | Low |
| 16 | 15 | 10 | RxD | ALT0 | Low |
| 17 | 28 | 3 | GPIO 8 | IN | Low |
| 18 | 29 | 4 | GPIO 9 | ALT4 | Low |
| 19 | 30 | 5 | GPIO10 | OUT | High |
| 20 | 31 | 6 | GPIO11 | ALT4 | Low |
+----------+------+------+--------+------+-------+