dht.getTemp() = 9223372036854775807

#1

Hello, All!

ESP8266.
Found some info regarding failing temperature reads from DHT11 sensor, but… nothing helps .
Problem described in the subj.
From Arduino IDE all works as expected.

Using mJS default wrapper for DHTs - gives me 9223372036854775807 for temperature and humidity.
Someone recommended to use adafruit dht js library, but this cannot be found right now (deprecated?).

So, where I am going wrong?
Missed something?

Thanks in advance for any help.

Dmitry.

#2

You are getting NAN which means there is something wrong with your sensor or the way you setup it in the code.

#3

Thanks for idea!
Actually, in my code I’ve setup sensor as:

let mydht = DHT.create(5, DHT.DHT11);

…and data wire of my DHT was connected to D5 pin, obviously.
So, after your reply I simply start to change pins on-the-fly, and… voilà!
Correct PIN was D1. (although in code it’s still configured as DHT.create(5, ... )
Strange… but, thank you! :slight_smile:

Solved.

#4

It seems you are using a NodeMCU like device. Here is the map of NodeMCU pin names to the GPIO pins

1 Like
#5

Yes. NodeMCU.
Thanks again.