ESP8266 with DHT22: sometimes no values received

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
balkonplant
New user
Posts: 1
Joined: 21 Nov 2016, 11:50

ESP8266 with DHT22: sometimes no values received

#1 Post by balkonplant » 21 Nov 2016, 12:07

Hi all,

Recently I bought an ESP8266 to experiment with. My goal was to measure humidity in the bathroom and - if needed - switch on the mechanic fan. So I also bought a DHT22-sensor. With some help of a friend, we installed ESP Easy on the ESP and connected the DHT22. After configuring the ESP, everything worked fine. Via AliExpress I bought a power supply (230V -> 3.3V) and a little, waterproof box. I installed this little box in the bathroom and connected it to a 230V outlet. Still, everything worked fine.

After a few days, I didn't received any data in Domoticz. I could still logon into the ESP and saw "nan" instead of sensor data. So I thought that maybe one of the connections wasn't good anymore. After checking the connections and rebooting the device, I did receive data. But again, for a few days only.

After a little bit of research, I found out that when I disconnect and reconnect the power supply, the sensor is working, but still for a couple of days. I still can login on the ESP, but don't see any values (only "nan"). Rebooting via the software doesn't solve the problem, only by disconnecting and reconnecting the power.

Does anyone recognize this behavior and/or how to solve it?

Thanks!

Rick

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: ESP8266 with DHT22: sometimes no values received

#2 Post by papperone » 21 Nov 2016, 12:40

what is the sensor reading delay value? did you try to make reading every 10min, 15min, 20mins to check if the behavior change?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: ESP8266 with DHT22: sometimes no values received

#3 Post by Drum » 21 Nov 2016, 13:36

Easiest band-aid might be to put it on a timer and turn it off for a minute or so every day, but not really a fix.

I have the same issue with DHT22s, much less so with BMP280s. I have several setup to use deep sleep for 10 minutes with a rule to send the IP address when they re-boot (wake up). Once in a while I just see the IP address and no other readings (BMP280) . With the DHT11 it is mostly no reading. I haven't really paid attention to the DHT22s because I like the BMP280 better, but last time I looked at the data, the DHT22s were not very reliable.. I will try to look at them more this week, everything gets dumped to a database so it is easy to track, just takes time.

I would try putting a switch in the power and another in the data line. See if interrupting one of these fixes the problem rather than restarting. You could also try grounding the RST pin to see if that works but i don't think it will do more much more than a software reset.

Could be a hardware issue, what is the setup? Picture, schematic and very important, which release of ESPEasy... There are a lot of different "ESP8266" modules and boards, not all have filtering capacitors, but if I remember correctly, my units with DHT22s have filtering caps and supercaps on the 3.3V line.

freijn
Normal user
Posts: 29
Joined: 28 Jan 2017, 17:48

Re: ESP8266 with DHT22: sometimes no values received

#4 Post by freijn » 09 Mar 2017, 09:00

Hey guys,

Ran into the same issue here.

ESP8826
2 x DS18b20
1 x DHT22

Every few days ( 10 or so) the DHT22 does not sent its data and "NAN" is displayed.
The both DS18b20 are still working then, its only the DHT22.

I found that a simple reboot ( software initiated by the menu) of the ESP does not help.
I have to take of the power from the ESP and plug it back in again.

Note: the DHT22 is on a wire of 4 meters long where the power-data resistor is on the ESP site and not on the DHT site.

In an other room I have the same setup and there the DHT22 is happy and nicely transmitting its data. Only difference is the line between de DHT and ESP is there about 10 cm.

Any hints tips idea's ? Shielded cable to the DHT ?

Many thanks in advantage

Frank

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP8266 with DHT22: sometimes no values received

#5 Post by Shardan » 09 Mar 2017, 15:45

Hello all,

this might be a problem with the DHT itself or the DHT plugin in ESPEasy.
I found that a simple reboot ( software initiated by the menu) of the ESP does not help.
I have to take of the power from the ESP and plug it back in again.
seems to point to a problem with the DHT22.

I didn't test DHT's long enough as they showed too much inaccuracy, I switched to
BMP180 / BME280 / DS18B20 / SI7021for my permanent installations.
These are running with uptimes of 1000 hours without interruption now.

It is difficult to give advice without more info.
Schematics? A pic? Which version of ESPEasy?

Some things in general:
Many issues result from power supply.
Most of the cheap wall plugs are poor or simply garbage.
I use them here, too... but i took some measurements:
Use a 5 ... 6 Volts supply and a voltage regulator like a LF-33
or LM1117V33 near the ESP. This limits influence of cheap power supply.
Place a capacitor of about 100...470 nF directly at the input of the regulator.
Place a capacitor of 220µF or more directly at the output of the regulator.
Place a capacitor of 100..220 nF ot the power pins of the ESP, as near as possible!
In general, keep capacitor connections short!
Do not use film capacitors for the nF ones! These can't take well high frequencies from the ESP or power supply.
Better choice: Ceramic types or multi layer types like X5R or X7R.
The 220µF might be an electrolytic capacitor or a X7R multi layer.

For a DHT on a "long line" it may be worth a try to place a capacitor (maybe 47µF?) at the sensor.

In general i'd suggest to get rid of DHT22 and use a SI7021 or BME280 or SI7021 instead.
Sadly this will not work on long lines.

Regards
Shardan
Regards
Shardan

freijn
Normal user
Posts: 29
Joined: 28 Jan 2017, 17:48

Re: ESP8266 with DHT22: sometimes no values received

#6 Post by freijn » 09 Mar 2017, 17:09

Hey Shardan,

ESP is on R120

Powersupply is an phone charger. I will exchange it with the one running error free.

I do like the suggestion of the capacitor near the DHT ( 47µF). I assume that one has to go over the power as well?

What do you think of the resistor between + and output of the DHT ? Near the DHT or near the ESP ?

Many thanks for your quick and wel detailed answer !

Frank

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP8266 with DHT22: sometimes no values received

#7 Post by Shardan » 09 Mar 2017, 21:56

Hello Frank,

the 47µF or similar should be an additional capacitor at the end of the cable near at the DHT22 at 3,3 V and ground.
It does not replace any of the other capacitor mentioned above.

I can't say much about the resistor as i never had some distance between DHT22 and ESP.
As it isn't a great effort you might give both positions a try.

Regards
Shardan
Last edited by Shardan on 09 Mar 2017, 21:58, edited 1 time in total.
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP8266 with DHT22: sometimes no values received

#8 Post by Shardan » 09 Mar 2017, 21:57

Sorry, double post
Regards
Shardan

freijn
Normal user
Posts: 29
Joined: 28 Jan 2017, 17:48

Re: ESP8266 with DHT22: sometimes no values received

#9 Post by freijn » 16 Mar 2017, 22:29

Hemmmm

I have used an other power supply which made things worse. Life time is now only 2-3 days where the other one had like a week.

I start playing with the capacitor now.....

bluejedi
Normal user
Posts: 35
Joined: 26 Sep 2016, 14:27

Re: ESP8266 with DHT22: sometimes no values received

#10 Post by bluejedi » 15 Jul 2017, 10:41

Missing values appears to be an issue with the DHT22. I have seen it mentioned in several temp/humidity sensor related posts on the internet (don't have any specific references).

freijn
Normal user
Posts: 29
Joined: 28 Jan 2017, 17:48

Re: ESP8266 with DHT22: sometimes no values received

#11 Post by freijn » 02 Oct 2017, 09:43

Old post new 'results' :-)

After having a summer season running error free , last week the sensor did start erroring again #$%#$%@@$#

Difference ???

Due to autumn start we turned on heating. The thermostat leads are in the same cable as the DHT22. Apperantly the input of the ESP doesn't like the switching of the thermostat ( 24 volt on off).
I think I will make a separate cable for the thermostat and keep the DHT22 in the shielded cat3 cable. Will also connect the shielding to earth now.

I thought mentioning this might help others with similair issues.

Cheers,
Frank

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP8266 with DHT22: sometimes no values received

#12 Post by grovkillen » 02 Oct 2017, 09:46

Great feedback! Thanks.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 8749
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP8266 with DHT22: sometimes no values received

#13 Post by TD-er » 12 Oct 2017, 16:58

You could also try to twist the cable.
Just like the cabling in CAT5 ethernet cables.

litris
New user
Posts: 4
Joined: 14 Feb 2018, 14:13

Re: ESP8266 with DHT22: sometimes no values received

#14 Post by litris » 14 Feb 2018, 14:45

Hi there,

I'm having the same issue when reading a DHT22 sensor from one ESP8266 with EasyESP 2.0 version flashed. I only get valid readings 1 out of 5 measures (aprox). Other's just get a "No Readings!" reply.
I'm using a pull-up resistor and the sampling period is 60 seconds. I've also tried to increase a bit the 3V3 power voltage, and to decrease the sampling frequency but with the same results.

I think it can be related with this topic:
https://github.com/adafruit/DHT-sensor- ... /issues/48

Does anybody know if this improvements have been updated to the EasyESP code? Or any rule to pull-down the line when signaling stars?

Thanks in advance,
Regards

New update.

I've downgraded the firmware to R120. The sensor is working fine, and all readings are collected.
So, it seem's to be a bug in the 2.0 release.
Last edited by litris on 16 Feb 2018, 11:40, edited 1 time in total.

litris
New user
Posts: 4
Joined: 14 Feb 2018, 14:13

Re: ESP8266 with DHT22: sometimes no values received

#15 Post by litris » 16 Feb 2018, 11:38

Update.

I've downgraded the firmware to R120. The sensor is working fine, and all readings are collected.
So, it seem's to be a bug in the 2.0 release.

TD-er
Core team member
Posts: 8749
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP8266 with DHT22: sometimes no values received

#16 Post by TD-er » 17 Feb 2018, 16:11

Can you add an issue on Github for it, with as much information as you have. (e.g. logs from ESPeasy)


Post Reply

Who is online

Users browsing this forum: No registered users and 111 guests