Sometimes NodeMCU ESP8266 fails to read data from DHT11 temperature sensor. To solve this issue, just install these two libraries:-
https://github.com/adafruit/DHT-senso...
https://github.com/adafruit/Adafruit_...
Then upload any one of these codes===
1. To interface DHT11 with NodeMCU ESP8266 :- https://gist.github.com/TrickSumo/f1a...
2. Upload data of DHT11 temperature sensor to firebase using NodeMCU ESP8266:- https://gist.github.com/TrickSumo/cb6...