Hi Everyone,
I am learning how to get the ESP8266 to talk to the DHT22. I am using the Arduino IDE with the "Adafruit Unified Sensor" library v. 1.0.3, the "DHT sensor library" v. 1.3.4, and the ESP8266 stable package 2.4.1 running on Windows 7.
The example code File->Examples->DHT sensor library->DHTtester.ino
I compiled it and loaded it just fine. But, to my surprise, I had to send the DHT data to D4 instead of D2 as on the Arduino Uno R3. I found that by trial and error on the ESP8266 ESP-12E MakerFocus boards found on AMazon. I also got the LoLin ESP-12E boards that are not exactly the same pinout as the MakerFocus board and thus the motivation for mapping out the pins on both boards with the DHTtester code...
Both boards used D4 for "DHTPIN 2". Next, I set "DHTPIN 3" and did not immediately find that one but when I set "DHTPIN 4", I found it went to D2 on both boards. So far so good.
Then I set "DHTPIN 5" and got D1 on the LoLin board. Then I set "DHTPIN 6" and the LoLin kept rebooting or something. Then I set "DHTPIN 7" and got a "WDT Reset" (had to change serial monitor to 115200 baud).
"DHTPIN 8"... It flashed. But nothing at all, if memory serves. I tried reflashing back to the original "DHTPIN 2" but it would not longer flash!! I was starting to get a bit worried at this point.
So I tried holding down the flash button and then pressing trhe reset button on the LoLin ESP-12E and then retried flashing but kept getting the could not connect error. So I thought I had bricked the board! So I rebooted the laptop and ran arduino IDE by itself and tried again but no cigar!
FINALLY I unplugged the LoLin from the USB port and THEN held down the flash button on the board and held it down while I plugged it into the USB port and ran the upload one more time and PRAISE THE LORD!!! It flashed!
So I thought I would pass this tidbit along as it was not at all obvious to me how to bring this board back to life!!