Closed eos1d3 closed 8 years ago
May be wdt reset is caused in https://github.com/chaeplin/PietteTech_DHT-8266/blob/master/examples/DHT_esp8266/DHT_esp8266.ino#L39-L48
Is data line of dht22 pulled up with a register ?
I use pin D4 or D1 of which pull_up is available. So the resistor is not needed for data line.
Just find the problem, it is cause by Serial.begin(115200);
Use 9600 and it seems fine for both examples.
The question is: why don't you have problem?
Oh Serial. Can you try this ?
Serial.begin(115200);
while (!Serial) {
yield(); // wait for serial port to connect.
}
I use generic esp module with ftdi friend.
Hi,
@9600 and @115200, the while loop keeps on looping until you send a key to serial and then it will continue to dht parts without wdt.
Found the root of cause now! It is the breadboard! When I do not use it and connect the 3 pins with wires directly. It works fine now.
PS: It seems not only one breadboard has problem. I have another which is used to connect NodeMCU to an ILI9341 LCD. When both of them are on breadboard, there are wdt errors and also errors in SPI bus with running serial @ 115200. If one of them is removed from breadboard and connect with wires directly, there is no problem. So the noise from breadboard is not small.
I will buy a NodeMCU.
If you have a multimeter, check those breadboards with beep function of multimeter.
The NodeMCU is the best ESP8266 tool. You have to get one.
Just had random test with the holes in the breadboards. No problem at all. The resistance is less than 2 ohm (including the metermeter wire).
It is the noise, no bad contact because if I lower the serial, it works.
What is Serial/USB chip of your board ? CP2102 or CH340G ?
Get only NodeMCU DevKit 1.0. This is the best. It uses CP2102.
@eos1d3 Thank you. I prefer CP2102 cause I am on Mac.
@eos1d3 yes, you called?
With further test. the WDT problem was caused by one of the breadboards. With another shorter breadboard, there is no WDT problem (Serial @115200).
PS: DHT22 does not need to wait for 2 seconds to work. It seems Arduino system or ESP8266 have some problem if it is initialized to early.
I have my DHT22 implement using STM8L which also confirm DHT22 needs to wait only 450ms. For Arduino, delay at least 450 ms after CPU startup and initialize DHT22. Then you will find the first read is good. (Unlike normal suggestion to initialize DHT22 and then wait 2 seconds)
For subsequent read, a delay of >450 ms also works
It seems the DHT22 initialization must be done after 450ms of ESP8266 startup. If you start initialization of DHT22 immediately, even 4 seconds delay does not help and will get bad results!
This is tested from my own DHT22 implementation for ESP8266 which is ported from my STML codes.
@eos1d3 Thank you
Arduino IDE 1.6.5, NodeMCU 1.0 @80MHz, DHT22
I get many wdt reset for both DHT_example and DHT_esp8266. And readings will be available after the third acquire for DHT_example. Before this, all readings are zero.