bpmurray / node-red-contrib-dht-sensor

Node-RED node to process DHT11/22 sensor data
Apache License 2.0
7 stars 8 forks source link

problems installing node-red-contrib-dht-sensor #13

Closed Waterbrain closed 6 years ago

Waterbrain commented 6 years ago

Hello: When I run sudo npm install --unsafe-perm -g node-red-contrib-dht-sensor it apparently installs well:

pi@invernadero:~/.node-red $ sudo npm install --unsafe-perm -g node-red-contrib-dht-sensor

> node-dht-sensor@0.0.34 preinstall /usr/lib/node_modules/.staging/node-dht-sensor-98fd5960
> ./check-lib.sh

Library bcm2835 found.

> node-dht-sensor@0.0.34 install /usr/lib/node_modules/node-red-contrib-dht-sensor/node_modules/node-dht-sensor
> node-gyp configure

> node-dht-sensor@0.0.34 postinstall /usr/lib/node_modules/node-red-contrib-dht-sensor/node_modules/node-dht-sensor
> node-gyp build

make: se entra en el directorio '/usr/lib/node_modules/node-red-contrib-dht-sensor/node_modules/node-dht-sensor/build'
  CXX(target) Release/obj.target/node_dht_sensor/node-dht-sensor.o
  CXX(target) Release/obj.target/node_dht_sensor/dht-sensor.o
  SOLINK_MODULE(target) Release/obj.target/node_dht_sensor.node
  COPY Release/node_dht_sensor.node
make: se sale del directorio '/usr/lib/node_modules/node-red-contrib-dht-sensor/node_modules/node-dht-sensor/build'
/usr/lib
└─┬ node-red-contrib-dht-sensor@1.0.1 
  └─┬ node-dht-sensor@0.0.34 
    └── nan@2.8.0 

But when I run sudo service nodered start, this appears in the node network logs:

20 Mar 08:21:07 - [info] Server now running at http://127.0.0.1:1880/ 
20 Mar 08:21:09 - [info] Starting flows 
1521530469152 Available Firmata 
1521530469427 Available RaspberryPi-IO 
1521530469456 Available Firmata 
1521530469522 Available RaspberryPi-IO 
20 Mar 08:21:09 - [info] Started flows 
2018-03-20 08:21:09 initCheckPermitted: 
+---------------------------------------------------------+ 
|Sorry, you don't have permission to run this program.    | 
|Try running as root, e.g. precede the command with sudo. | 
+---------------------------------------------------------+ 
20 Mar 08:21:09 - [red] Uncaught Exception: 
20 Mar 08:21:09 - Error: pigpio error -1 in gpioInitialise 
    at Error (native) 
    at initializePigpio (/home/pi/.node-red/node_modules/pigpio/pigpio.js:11:12) 
    at new Gpio (/home/pi/.node-red/node_modules/pigpio/pigpio.js:25:3) 
    at new DigitalOutput (/home/pi/.node-red/node_modules/raspi-gpio/dist/index.js:79:25) 
nodered.service: Main process exited, code=exited, status=1/FAILURE 
nodered.service: Unit entered failed state. 
nodered.service: Failed with result 'exit-code'. 
nodered.service: Service hold-off time over, scheduling restart. 

The system:


Raspberry pi 3

Raspbian Stretch with desktop

uname -a
Linux invernadero 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux

npm version: 3.10.10

Node-RED version: v0.18.4 

Node.js  version: v6.13.1```

But when I would appreciate some help.
bpmurray commented 6 years ago

My guess is that you have an older version of the BCM2835 library installed. As you can see from your install log, it's identified as being present and it may well be before v1.5. This is discussed in the documentation - if you have an old version, update it, remove the DHT node and reinstall. Otherwise you will have to run node as root.

Waterbrain commented 6 years ago

As you can see in my post it is already started with sudo sudo service nodered start And the installation of the bmc has been like this:

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.55.tar.gz
tar zxvf bcm2835-1.55.tar.gz 
cd bcm2835-1.55/
./configure
make
sudo make check
sudo make install
cd

And what's worse, I have to completely reinstall all the software. There is no way to avoid those error messages ... Which I'm doing right now. Thank you.

bpmurray commented 6 years ago

I had a look around and thus.is not caused by the sensor code. It's something to do with pigpio - take a look at https://github.com/fivdi/pigpio/issues/31