WeMos D1 Cannot Read DHT 11. Help!

Try hooking up a simple LED/resistor and confirming the correct pin designations with digitalWrite() commands

How come?

I’m also met the problem.
i can’t find the correct pin on my Wemos D1.
at last ,i change the
#define DHTPIN 2 // what digital pin we're connected to
into
#define DHTPIN D2 // what digital pin we're connected to
IT WORKED!

But it’s not really the way to fix your problem. You should use GPIO numbers not WeMos labels in your sketch. WeMos site has a lookup table to convert their D references to real GPIO numbers.

If you stick with D references you will have problems as you move on to more advanced features of Blynk like their API etc. Even without Blynk you should avoid the D references and compile your sketch as generic ESP8266 as it makes you code more portable between different MCU’s.

2 Likes