BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Npm install -g node-dht-sensor fails to install

rpi
#1

Raspberry Pi Zero W connected to a 4 channel relay and an AM2302 sensor (Temp and humidity - data wired to GPIO 27).

Note: The relays work perfect in the phone app.

I have a AM2302 sensor attached to a RPi 0 W that I want to read temp and humidity from. I have tested it with test script from Adafruit and it is working displaying the temp and humidity in the terminal window.

I was following the info on the Instructables page (Raspberry Pi + Node.js + Blynk App + DHT11/DHT22/AM2302) and all went well until I got to the last line to install the node-dht-sensor. That failed with multiple errors dealing with permission to access the dev dir “/root/.node=gyp/6.9.5”.

Then the node-gyp build failed listing multiple ERR!

I could use some help and/or advice. I am not a programmer so please go easy.
Thanks in advance.
Mike

0 Likes

#2

Not really a Blynk related issue… have you Googled the error? Asked for assistance on the Instrucatables page?

0 Likes

#3

OK… I had to do my own Googling to find the instructable… and I see it is by our beloved developer @vshymanskyy :stuck_out_tongue:

However, it is also VERY old (2015) and much has changed over time. I would recommend starting with some more current instructables, using current libraries, etc.

0 Likes

#4

Thanks. That’s the hard part. Being a newbie, I don’t know who to believe and who not to believe. I do know it appears to be easier to use the Arduino for the sensor. I will have to keep plugging away.

0 Likes

#5

The RPi just offers so many more programming language options that it can be confusing… First you need to use Linux to get the thing running, then WiringPi or NodeJS or Python for Blynk, then finding examples can be tricky as the RPI and supporting software seems to change even more rapidly then good old Arduino… yep… tricky.

One way is to take your working non-Blynk NodeJS sketch, merge it with the basic Node connection sketch (you can find some ideas here) to get connected and use a NodeJS friendly blynk.virtualWrite(27, datavalue); // Display Widget on V27 instead of, or along with, whatever console output is used in the original examples.

0 Likes

#6

And if you havent already… go to the source for current NPM libraries…

0 Likes