Open brlnr23 opened 3 years ago
Hello! I also had the same error and found a solution for myself. I found a difference between the dht-sensor implementation and the protocol, in particular the low trigger value timeout it should be within 1-18ms. I have increased the low voltage latency from 800ms to 1000ms. changes: https://github.com/cainpsycode/node-dht-sensor/commit/50811e3ef593ed9b91a1fa2d17a1b4773bde549b
Hello! I also had the same error and found a solution for myself. I found a difference between the dht-sensor implementation and the protocol, in particular the low trigger value timeout it should be within 1-18ms. I have increased the low voltage latency from 800ms to 1000ms. changes: cainpsycode@50811e3
I too had this problem. The mentioned changes fixed my problem as well.
thanks for this hint. Since I am no c++ guy at all: am I right that I need to complile the cpp files? And if so: do you have any hints how a bloody starter is able to do so ;)
thanks for this hint. Since I am no c++ guy at all: am I right that I need to complile the cpp files? And if so: do you have any hints how a bloody starter is able to do so ;)
Yes you need rebuild native cpp code for your target platform. Just follow the instruction https://github.com/momenso/node-dht-sensor#reference-for-building-from-source
a big up to you, @cainpsycode! After some back and forth it worked for me!
If someone else wants to build it from source: I did that on my Raspberry directly. For me, there was to need to run the following command
$ sudo update-alternatives --install /usr/bin/node-gyp node-gyp /opt/node-v10.15.3-linux-armv7l/bin/node-gyp 1
Instead I need to run the following commands as sudo in the node-dht-sensor directory
$ sudo node-gyp configure
$ sudo node-gyp build
I was also missing the package node-addon-api
but a simple npm install node-addon-api
fixed it.
Once the build process has been completed I could import the self-made build via - in my case with promises -
var sensor = require("./lib").promises;
... do fancy things here
// edit: no I hope that the library does not suffer from the negativ values bug as the Python lib I used to use does ;)
a big up to you, @cainpsycode! After some back and forth it worked for me!
If someone else wants to build it from source: I did that on my Raspberry directly. For me, there was to need to run the following command
$ sudo update-alternatives --install /usr/bin/node-gyp node-gyp /opt/node-v10.15.3-linux-armv7l/bin/node-gyp 1
Instead I need to run the following commands as sudo in the node-dht-sensor directory
$ sudo node-gyp configure $ sudo node-gyp build
I was also missing the package
node-addon-api
but a simplenpm install node-addon-api
fixed it.Once the build process has been completed I could import the self-made build via - in my case with promises -
var sensor = require("./lib").promises; ... do fancy things here
// edit: no I hope that the library does not suffer from the negativ values bug as the Python lib I used to use does ;)
There is no hope. The negative values are wrong.
I fixed it, but I can't be sure if the solution is correct. @brlnr23 you can try this branch https://github.com/cainpsycode/node-dht-sensor/tree/bugfix/tmp-negative
I have the same timeout problem when I run the DHT11 sensor on 3.3V. I have changed my setup and use 5V on the sensor. But even there it happens sometimes!
I hope this problem will be solved soon in the LIB
Hi, sorry for my english, but isn't my first languege. I've read this discussion, I've try to change latency as @cainpsycode suggest, I've compiled and try, the issue there is still. Also I, with Python, have the rigth values, so isn't a probe problem. I've changed voltage to 3v3. Yet same problem. Someone have fixed this problem? Ther is a fork of project? Tks
I have searched a lot in this repository but unfortunately I couldn't find a solution for the problem I am facing.
I constantly get an error reading data from the sensor:
Error: failed to read sensor
First off 1) Using the Adafruit example script returns the values I am expecting - so it seems that its not a wiring issue 2) I am using a DHT22 sensor (as module) without a pull up resistor 3)
Raspberry Model B V2.0
/npm -v: 6.14.8
/node -v: v9.11.1
4) I have installed the package with the verbose flagnpm install node-dht-sensor --dht_verbose=true
If I run that simple script (taken from the examples) it returns an error. The logfile just says
Results in:
If I run the same script but with type 11 it returns completely wrong values, but it returns at least something
To me this looks like an issue with the DHT22 type of sensor. Any hints are welcome. I am happy to provide more information if needed