ESP-01 SW WDT with DHT22(AM2302) sensor
Posted: Mon Feb 03, 2020 11:40 am
Hi guys,
I am new here and I please need your help.
I am using the ESP01 with the DHT22 sensor on GPIO0 and DS18b20 on GPIO2
My circuit is OK and I have a 10K pullup resistor for the two sensors
Problem is when connecting the DHT22 to GPIO0 I have a watchdog reset (stack below), On the other side everything is just fien when using GPIO2
the esp is waiting the start signal from the sensor and I think that this waiting time is causing the wdt reset.
I ve seen that using GPIO is somehow tricky but I cannot figure out how I can use it
Can you please help, I ve spent days on this issue
Thanks
here is my code
Soft WDT reset
>>>stack>>>
ctx: cont
sp: 3ffffc50 end: 3fffffc0 offset: 01b0
3ffffe00: 00001aee ffffffff 00000000 ffffffff
3ffffe10: 00000000 ffffffff 00000000 ffffffff
3ffffe20: 00000000 ffffffff 00000000 ffffffff
3ffffe30: 00000000 ffffffff 00000000 ffffffff
3ffffe40: 00000000 ffffffff 00000000 ffffffff
3ffffe50: 00000000 ffffffff 00000000 ffffffff
3ffffe60: 00000000 ffffffff 00000000 ffffffff
3ffffe70: 00000000 ffffffff 00000000 ffffffff
3ffffe80: 00000000 ffffffff 00000000 ffffffff
3ffffe90: 00000000 ffffffff 00000000 ffffffff
3ffffea0: 00000000 ffffffff 00000000 ffffffff
3ffffeb0: 00000000 ffffffff 00000000 ffffffff
3ffffec0: 00000000 ffffffff 00000000 ffffffff
3ffffed0: 00000000 ffffffff 00000000 ffffffff
3ffffee0: 00000000 ffffffff 00000000 ffffffff
3ffffef0: 00000000 ffffffff 00000000 ffffffff
3fffff00: 00000000 ffffffff 00000000 ffffffff
3fffff10: 00000000 ffffffff 00000000 ffffffff
3fffff20: 00000000 ffffffff 00000000 ffffffff
3fffff30: 00000000 ffffffff 00000000 ffffffff
3fffff40: 00000000 7fc00000 3ffee320 40202e38
3fffff50: 00000000 ffffffff 00000000 ffffffff
3fffff60: 3ffee2c8 00000000 3ffee320 3ffee350
3fffff70: 3fffdad0 7fc00000 3ffee320 402024e5
3fffff80: 3fffdad0 3ffee2f8 3ffee2c8 40202658
3fffff90: feefeffe 00000000 3ffee2f8 3ffee350
3fffffa0: 3fffdad0 00000000 3ffee320 40203938
3fffffb0: feefeffe feefeffe 3ffe8504 40100a49
<<<stack<<<
cŸÇrSöfêDHTxx test!
DHT max clock cycles: 80000
DHT timeout waiting for pulse.
I am new here and I please need your help.
I am using the ESP01 with the DHT22 sensor on GPIO0 and DS18b20 on GPIO2
My circuit is OK and I have a 10K pullup resistor for the two sensors
Problem is when connecting the DHT22 to GPIO0 I have a watchdog reset (stack below), On the other side everything is just fien when using GPIO2
the esp is waiting the start signal from the sensor and I think that this waiting time is causing the wdt reset.
I ve seen that using GPIO is somehow tricky but I cannot figure out how I can use it
Can you please help, I ve spent days on this issue
Thanks
here is my code
Code: Select all
#include "DHT.h"
#define DHTPIN 0 // Digital pin connected to the DHT sensor
/
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
// Initialize DHT sensor.
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
Serial.println(F("DHTxx test!"));
dht.begin();
}
void loop() {
// Wait a few seconds between measurements.
delay(2000);
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
Serial.print(F("% Temperature: "));
Serial.print(t);
}
Soft WDT reset
>>>stack>>>
ctx: cont
sp: 3ffffc50 end: 3fffffc0 offset: 01b0
3ffffe00: 00001aee ffffffff 00000000 ffffffff
3ffffe10: 00000000 ffffffff 00000000 ffffffff
3ffffe20: 00000000 ffffffff 00000000 ffffffff
3ffffe30: 00000000 ffffffff 00000000 ffffffff
3ffffe40: 00000000 ffffffff 00000000 ffffffff
3ffffe50: 00000000 ffffffff 00000000 ffffffff
3ffffe60: 00000000 ffffffff 00000000 ffffffff
3ffffe70: 00000000 ffffffff 00000000 ffffffff
3ffffe80: 00000000 ffffffff 00000000 ffffffff
3ffffe90: 00000000 ffffffff 00000000 ffffffff
3ffffea0: 00000000 ffffffff 00000000 ffffffff
3ffffeb0: 00000000 ffffffff 00000000 ffffffff
3ffffec0: 00000000 ffffffff 00000000 ffffffff
3ffffed0: 00000000 ffffffff 00000000 ffffffff
3ffffee0: 00000000 ffffffff 00000000 ffffffff
3ffffef0: 00000000 ffffffff 00000000 ffffffff
3fffff00: 00000000 ffffffff 00000000 ffffffff
3fffff10: 00000000 ffffffff 00000000 ffffffff
3fffff20: 00000000 ffffffff 00000000 ffffffff
3fffff30: 00000000 ffffffff 00000000 ffffffff
3fffff40: 00000000 7fc00000 3ffee320 40202e38
3fffff50: 00000000 ffffffff 00000000 ffffffff
3fffff60: 3ffee2c8 00000000 3ffee320 3ffee350
3fffff70: 3fffdad0 7fc00000 3ffee320 402024e5
3fffff80: 3fffdad0 3ffee2f8 3ffee2c8 40202658
3fffff90: feefeffe 00000000 3ffee2f8 3ffee350
3fffffa0: 3fffdad0 00000000 3ffee320 40203938
3fffffb0: feefeffe feefeffe 3ffe8504 40100a49
<<<stack<<<
cŸÇrSöfêDHTxx test!
DHT max clock cycles: 80000
DHT timeout waiting for pulse.