Using the following code, when I try to set a GPIO to be input to read the DHT, it resets / reboots the ESP module (I'm using Serial Monitor to watch it) and I also get a hex dump...
void getDhtSensorData() {
Serial.println("\ngetDhtSensorData() entered...");
pinMode(DHT_DATA_PIN, INPUT);
/*
Other code removed for clarity - the above line causes the reboot
*/
Serial.println("Exiting getDhtSensorData()...");
}
void getSensorData() {
Serial.println("getSensorData() entered...");
getDhtSensorData();
// getBmpSensorData();
Serial.println("Exiting getSensorData()...");
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
delay(5000);
Serial.begin(115200);
Serial.println("\n\nStarting loop()...");
Serial.println("Calling getSensorData()...");
getSensorData();
}
The first time I upload / run the code I get the following and the code loop just stops...
0x0f
csum 0x0f
~ld
Starting loop()...
Calling getSensorData()...
getSensorData() entered...
getDhtSensorData() entered...
Exiting getDhtSensorData()...
Exiting getSensorData()...
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
If I then press the reset button on the GizWits daughter board it goes into a proper repeating loop but each time I get the same as above as well as a hex dump.
If I remove the line...
pinMode(DHT_DATA_PIN, INPUT);
I've even disconnected the DHT circuitry completely but just using pinMode seems to be causing problems and I don't understand why.
Cheers,
Brian