New Install on Jessie_Issue with DHT22 Node

1,800 views
Skip to first unread message

Blue Collar Ingenuity

unread,
Nov 26, 2015, 11:15:57 AM11/26/15
to Node-RED
Here is where I'm at 
1) clean install of Rasbian Jessie (November 2015) 
2) Installed Node-red for RasberryPi 2 
3) Followed instructions for auto boot (Making Node-RED autostart on boot (optional)
4) Tested "First Flow - Blink - gpio" Working OK 
Now I'm trying to get my DHT11 reading 
1) Installed BCM2835 1.47
2) Installed npm install node-dht-sensor and npm install node-red-contrib-dht-sensor







When I run it I get 

TypeError: Failed to initialize

This is where I am confused in the instructions; 
Note that this node requires that node-dht-sensor is installed and accessible from Node Red. Since this requires accesss to low-level parts of the Raspberry Pi, you must run your flow with superuser access.
Is that my problem ? 
Jeff

Mark Setrem

unread,
Nov 26, 2015, 11:46:07 AM11/26/15
to Node-RED

Possibly, the easiest way to see is to try ;-)

I'm assuming you installed pm2 to outrun start node-red.

So you need to stop it running

pm2 stop node-red (This will temporarily stop node-red but it will still restart if you reboot)



then try starting node-red with sudo 

sudo node-red-pi --max-old-space-size=128


one thing to remember is that by default the above will look for the flows file within User directory : /root/.node-red

so if you want to pick up your existing flows file you would need to add the path afterwards


e.g

sudo node-red-pi --max-old-space-size=128 --userDir /home/pi/.node-red/



Dave C-J

unread,
Nov 26, 2015, 11:52:00 AM11/26/15
to node...@googlegroups.com

Yes probably. If you stop it running then run it from the command line as root .eg
  sudo node-red
does it then work ? If so then yes, that's the problem.

Dave C-J

unread,
Nov 26, 2015, 11:52:48 AM11/26/15
to node...@googlegroups.com

Marks answer much more complete ! So ignore mine...

Blue Collar Ingenuity

unread,
Nov 26, 2015, 8:22:41 PM11/26/15
to Node-RED
Thanks Mark, 
                    That worked! I stopped pm2 and restarted with sudo node-red-pi --max-old-space-size=128 --userDir /home/pi/.node-red/
How do you recommend I proceed with getting Nodered to autostart? Can I edit pm2 or should I remove it and try and alternate configuration? 

Jeff 

Mark Setrem

unread,
Nov 27, 2015, 3:12:17 AM11/27/15
to Node-RED
That's up to you.

The some of the alternatives start node-red on boot up.
The advantage of pm2 is it will also restart pm2 after a crash.

Either way you'll need to remove the node-red from pm2

pm2 stop node-red ( if you've rebooted)
pm2 save

Blue Collar Ingenuity

unread,
Nov 30, 2015, 5:13:52 PM11/30/15
to Node-RED
Ok, 
      Working on my new install with Jessie img c/w Nodered installed. 
I ran the NPM installer as per instructions and installed Installed BCM2835 1.47
Now I can't get node-dht-sensor to install. I get the following error;

pi@raspberrypi:~/.node-red/node_modules $ npm install node-dht-sensor
npm WARN engine node-dh...@0.0.8: wanted: {"node":">=0.12 <0.13"} (current:                      {"node":"0.10.29","npm":"1.4.21"})

> node-dh...@0.0.8 install /home/pi/.node-red/node_modules/node-dht-sensor
> ./check-bcm2835

Library bcm2835 found.
make: Entering directory '/home/pi/.node-red/node_modules/node-dht-sensor/build'
  CXX(target) Release/obj.target/node-dht-sensor/node-dht-sensor.o
../node-dht-sensor.cpp:205:17: error: ‘FunctionCallbackInfo’ does not name a typ                     e
 void Read(const FunctionCallbackInfo<Value>& args) {
                 ^
../node-dht-sensor.cpp:205:37: error: expected ‘,’ or ‘...’ before ‘<’ token
 void Read(const FunctionCallbackInfo<Value>& args) {
                                     ^
../node-dht-sensor.cpp: In function ‘void Read(int)’:
../node-dht-sensor.cpp:207:30: error: no matching function for call to ‘v8::Hand                     leScope::HandleScope(v8::Isolate*&)’
     HandleScope scope(isolate);
                              ^
../node-dht-sensor.cpp:207:30: note: candidates are:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:473:3: note: v8::HandleScope::HandleSco                     pe(const v8::HandleScope&)
   HandleScope(const HandleScope&);
   ^
/usr/include/nodejs/deps/v8/include/v8.h:473:3: note:   no known conversion for                      argument 1 from ‘v8::Isolate*’ to ‘const v8::HandleScope&’
/usr/include/nodejs/deps/v8/include/v8.h:448:3: note: v8::HandleScope::HandleSco                     pe()
   HandleScope();
   ^
/usr/include/nodejs/deps/v8/include/v8.h:448:3: note:   candidate expects 0 argu                     ments, 1 provided
../node-dht-sensor.cpp:217:48: error: no matching function for call to ‘v8::Obje                     ct::New(v8::Isolate*&)’
     Local<Object> readout = Object::New(isolate);
                                                ^
../node-dht-sensor.cpp:217:48: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1724:33: note: static v8::Local<v8::Obj                     ect> v8::Object::New()
   V8EXPORT static Local<Object> New();
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1724:33: note:   candidate expects 0 ar                     guments, 1 provided
../node-dht-sensor.cpp:218:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "humidity"), Number::New(isolate,                      humidity));
                  ^
../node-dht-sensor.cpp:218:89: error: no matching function for call to ‘v8::Numb                     er::New(v8::Isolate*&, float&)’
     readout->Set(String::NewFromUtf8(isolate, "humidity"), Number::New(isolate,                      humidity));
                                                                                                              ^
../node-dht-sensor.cpp:218:89: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Num                     ber> v8::Number::New(double)
   V8EXPORT static Local<Number> New(double value);
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp:219:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "temperature"), Number::New(isola                     te, temperature));
                  ^
../node-dht-sensor.cpp:219:95: error: no matching function for call to ‘v8::Numb                     er::New(v8::Isolate*&, float&)’
     readout->Set(String::NewFromUtf8(isolate, "temperature"), Number::New(isola                     te, temperature));
                                                                                                                    ^
../node-dht-sensor.cpp:219:95: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Num                     ber> v8::Number::New(double)
   V8EXPORT static Local<Number> New(double value);
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp:220:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "isValid"), Boolean::New(isolate,                      result == 0));
                  ^
../node-dht-sensor.cpp:220:92: error: no matching function for call to ‘v8::Bool                     ean::New(v8::Isolate*&, bool)’
     readout->Set(String::NewFromUtf8(isolate, "isValid"), Boolean::New(isolate,                      result == 0));
                                                                                                                 ^
../node-dht-sensor.cpp:220:92: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:4349:17: note: static v8::Handle<v8::Bo                     olean> v8::Boolean::New(bool)
 Handle<Boolean> Boolean::New(bool value) {
                 ^
/usr/include/nodejs/deps/v8/include/v8.h:4349:17: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp:221:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "errors"), Number::New(isolate, 2                      - retry));
                  ^
../node-dht-sensor.cpp:221:88: error: no matching function for call to ‘v8::Numb                     er::New(v8::Isolate*&, int)’
     readout->Set(String::NewFromUtf8(isolate, "errors"), Number::New(isolate, 2                      - retry));
                                                                                                             ^
../node-dht-sensor.cpp:221:88: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Num                     ber> v8::Number::New(double)
   V8EXPORT static Local<Number> New(double value);
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp:223:5: error: ‘args’ was not declared in this scope
     args.GetReturnValue().Set(readout);
     ^
../node-dht-sensor.cpp: At global scope:
../node-dht-sensor.cpp:226:21: error: ‘FunctionCallbackInfo’ does not name a typ                     e
 void ReadSpec(const FunctionCallbackInfo<Value>& args) {
                     ^
../node-dht-sensor.cpp:226:41: error: expected ‘,’ or ‘...’ before ‘<’ token
 void ReadSpec(const FunctionCallbackInfo<Value>& args) {
                                         ^
../node-dht-sensor.cpp: In function ‘void ReadSpec(int)’:
../node-dht-sensor.cpp:228:30: error: no matching function for call to ‘v8::Hand                     leScope::HandleScope(v8::Isolate*&)’
     HandleScope scope(isolate);
                              ^
../node-dht-sensor.cpp:228:30: note: candidates are:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:473:3: note: v8::HandleScope::HandleSco                     pe(const v8::HandleScope&)
   HandleScope(const HandleScope&);
   ^
/usr/include/nodejs/deps/v8/include/v8.h:473:3: note:   no known conversion for                      argument 1 from ‘v8::Isolate*’ to ‘const v8::HandleScope&’
/usr/include/nodejs/deps/v8/include/v8.h:448:3: note: v8::HandleScope::HandleSco                     pe()
   HandleScope();
   ^
/usr/include/nodejs/deps/v8/include/v8.h:448:3: note:   candidate expects 0 argu                     ments, 1 provided
../node-dht-sensor.cpp:230:9: error: ‘args’ was not declared in this scope
     if (args.Length() < 2) {
         ^
../node-dht-sensor.cpp:231:15: error: ‘class v8::Isolate’ has no member named ‘T                     hrowException’
      isolate->ThrowException(Exception::TypeError(
               ^
../node-dht-sensor.cpp:232:10: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
          String::NewFromUtf8(isolate, "Wrong number of arguments")));
          ^
../node-dht-sensor.cpp:236:22: error: ‘args’ was not declared in this scope
     int sensorType = args[0]->Uint32Value();
                      ^
../node-dht-sensor.cpp:238:18: error: ‘class v8::Isolate’ has no member named ‘T                     hrowException’
         isolate->ThrowException(Exception::TypeError(
                  ^
../node-dht-sensor.cpp:239:10: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
          String::NewFromUtf8(isolate, "Specified sensor type is invalid")));
          ^
../node-dht-sensor.cpp:246:19: error: ‘class v8::Isolate’ has no member named ‘T                     hrowException’
          isolate->ThrowException(Exception::TypeError(
                   ^
../node-dht-sensor.cpp:247:11: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
           String::NewFromUtf8(isolate, "Failed to initialize")));
           ^
../node-dht-sensor.cpp:261:48: error: no matching function for call to ‘v8::Obje                     ct::New(v8::Isolate*&)’
     Local<Object> readout = Object::New(isolate);
                                                ^
../node-dht-sensor.cpp:261:48: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1724:33: note: static v8::Local<v8::Obj                     ect> v8::Object::New()
   V8EXPORT static Local<Object> New();
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1724:33: note:   candidate expects 0 ar                     guments, 1 provided
../node-dht-sensor.cpp:262:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "humidity"), Number::New(isolate,                      humidity));
                  ^
../node-dht-sensor.cpp:262:89: error: no matching function for call to ‘v8::Numb                     er::New(v8::Isolate*&, float&)’
     readout->Set(String::NewFromUtf8(isolate, "humidity"), Number::New(isolate,                      humidity));
                                                                                                              ^
../node-dht-sensor.cpp:262:89: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Num                     ber> v8::Number::New(double)
   V8EXPORT static Local<Number> New(double value);
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp:263:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "temperature"), Number::New(isola                     te, temperature));
                  ^
../node-dht-sensor.cpp:263:95: error: no matching function for call to ‘v8::Numb                     er::New(v8::Isolate*&, float&)’
     readout->Set(String::NewFromUtf8(isolate, "temperature"), Number::New(isola                     te, temperature));
                                                                                                                    ^
../node-dht-sensor.cpp:263:95: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Num                     ber> v8::Number::New(double)
   V8EXPORT static Local<Number> New(double value);
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp:264:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "isValid"), Boolean::New(isolate,                      result == 0));
                  ^
../node-dht-sensor.cpp:264:92: error: no matching function for call to ‘v8::Bool                     ean::New(v8::Isolate*&, bool)’
     readout->Set(String::NewFromUtf8(isolate, "isValid"), Boolean::New(isolate,                      result == 0));
                                                                                                                 ^
../node-dht-sensor.cpp:264:92: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:4349:17: note: static v8::Handle<v8::Bo                     olean> v8::Boolean::New(bool)
 Handle<Boolean> Boolean::New(bool value) {
                 ^
/usr/include/nodejs/deps/v8/include/v8.h:4349:17: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp:265:18: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
     readout->Set(String::NewFromUtf8(isolate, "errors"), Number::New(isolate, 2                      - retry));
                  ^
../node-dht-sensor.cpp:265:88: error: no matching function for call to ‘v8::Numb                     er::New(v8::Isolate*&, int)’
     readout->Set(String::NewFromUtf8(isolate, "errors"), Number::New(isolate, 2                      - retry));
                                                                                                             ^
../node-dht-sensor.cpp:265:88: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Num                     ber> v8::Number::New(double)
   V8EXPORT static Local<Number> New(double value);
                                 ^
/usr/include/nodejs/deps/v8/include/v8.h:1377:33: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp: At global scope:
../node-dht-sensor.cpp:270:23: error: ‘FunctionCallbackInfo’ does not name a typ                     e
 void Initialize(const FunctionCallbackInfo<Value>& args) {
                       ^
../node-dht-sensor.cpp:270:43: error: expected ‘,’ or ‘...’ before ‘<’ token
 void Initialize(const FunctionCallbackInfo<Value>& args) {
                                           ^
../node-dht-sensor.cpp: In function ‘void Initialize(int)’:
../node-dht-sensor.cpp:272:30: error: no matching function for call to ‘v8::Hand                     leScope::HandleScope(v8::Isolate*&)’
     HandleScope scope(isolate);
                              ^
../node-dht-sensor.cpp:272:30: note: candidates are:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:473:3: note: v8::HandleScope::HandleSco                     pe(const v8::HandleScope&)
   HandleScope(const HandleScope&);
   ^
/usr/include/nodejs/deps/v8/include/v8.h:473:3: note:   no known conversion for                      argument 1 from ‘v8::Isolate*’ to ‘const v8::HandleScope&’
/usr/include/nodejs/deps/v8/include/v8.h:448:3: note: v8::HandleScope::HandleSco                     pe()
   HandleScope();
   ^
/usr/include/nodejs/deps/v8/include/v8.h:448:3: note:   candidate expects 0 argu                     ments, 1 provided
../node-dht-sensor.cpp:274:9: error: ‘args’ was not declared in this scope
     if (args.Length() < 2) {
         ^
../node-dht-sensor.cpp:275:18: error: ‘class v8::Isolate’ has no member named ‘T                     hrowException’
         isolate->ThrowException(Exception::TypeError(
                  ^
../node-dht-sensor.cpp:276:10: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
          String::NewFromUtf8(isolate, "Wrong number of arguments")));
          ^
../node-dht-sensor.cpp:280:10: error: ‘args’ was not declared in this scope
     if (!args[0]->IsNumber() || !args[1]->IsNumber()) {
          ^
../node-dht-sensor.cpp:281:18: error: ‘class v8::Isolate’ has no member named ‘T                     hrowException’
         isolate->ThrowException(Exception::TypeError(
                  ^
../node-dht-sensor.cpp:282:10: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
          String::NewFromUtf8(isolate, "Invalid arguments")));
          ^
../node-dht-sensor.cpp:286:22: error: ‘args’ was not declared in this scope
     int sensorType = args[0]->Uint32Value();
                      ^
../node-dht-sensor.cpp:288:15: error: ‘class v8::Isolate’ has no member named ‘T                     hrowException’
      isolate->ThrowException(Exception::TypeError(
               ^
../node-dht-sensor.cpp:289:10: error: ‘NewFromUtf8’ is not a member of ‘v8::Stri                     ng’
          String::NewFromUtf8(isolate, "Specified sensor type is not supported")                     ));
          ^
../node-dht-sensor.cpp:298:70: error: no matching function for call to ‘v8::Bool                     ean::New(v8::Isolate*&, bool)’
     args.GetReturnValue().Set(Boolean::New(isolate, initialize() == 0));
                                                                      ^
../node-dht-sensor.cpp:298:70: note: candidate is:
In file included from /usr/include/nodejs/src/node.h:62:0,
                 from ../node-dht-sensor.cpp:1:
/usr/include/nodejs/deps/v8/include/v8.h:4349:17: note: static v8::Handle<v8::Bo                     olean> v8::Boolean::New(bool)
 Handle<Boolean> Boolean::New(bool value) {
                 ^
/usr/include/nodejs/deps/v8/include/v8.h:4349:17: note:   candidate expects 1 ar                     gument, 2 provided
../node-dht-sensor.cpp: In function ‘void Init(v8::Handle<v8::Object>)’:
../node-dht-sensor.cpp:314:40: error: no matching function for call to ‘SetMetho                     d(v8::Handle<v8::Object>&, const char [5], void (&)(int))’
   NODE_SET_METHOD(exports, "read", Read);
                                        ^
../node-dht-sensor.cpp:314:40: note: candidate is:
In file included from ../node-dht-sensor.cpp:1:0:
/usr/include/nodejs/src/node.h:112:6: note: template<class target_t> void node::                     SetMethod(target_t, const char*, v8::InvocationCallback)
 void SetMethod(target_t obj, const char* name,
      ^
/usr/include/nodejs/src/node.h:112:6: note:   template argument deduction/substi                     tution failed:
../node-dht-sensor.cpp:314:40: note:   cannot convert ‘Read’ (type ‘void(int)’)                      to type ‘v8::InvocationCallback {aka v8::Handle<v8::Value> (*)(const v8::Argumen                     ts&)}’
   NODE_SET_METHOD(exports, "read", Read);
                                        ^
../node-dht-sensor.cpp:315:48: error: no matching function for call to ‘SetMetho                     d(v8::Handle<v8::Object>&, const char [9], void (&)(int))’
   NODE_SET_METHOD(exports, "readSpec", ReadSpec);
                                                ^
../node-dht-sensor.cpp:315:48: note: candidate is:
In file included from ../node-dht-sensor.cpp:1:0:
/usr/include/nodejs/src/node.h:112:6: note: template<class target_t> void node::                     SetMethod(target_t, const char*, v8::InvocationCallback)
 void SetMethod(target_t obj, const char* name,
      ^
/usr/include/nodejs/src/node.h:112:6: note:   template argument deduction/substi                     tution failed:
../node-dht-sensor.cpp:315:48: note:   cannot convert ‘ReadSpec’ (type ‘void(int                     )’) to type ‘v8::InvocationCallback {aka v8::Handle<v8::Value> (*)(const v8::Arg                     uments&)}’
   NODE_SET_METHOD(exports, "readSpec", ReadSpec);
                                                ^
../node-dht-sensor.cpp:316:52: error: no matching function for call to ‘SetMetho                     d(v8::Handle<v8::Object>&, const char [11], void (&)(int))’
   NODE_SET_METHOD(exports, "initialize", Initialize);
                                                    ^
../node-dht-sensor.cpp:316:52: note: candidate is:
In file included from ../node-dht-sensor.cpp:1:0:
/usr/include/nodejs/src/node.h:112:6: note: template<class target_t> void node::                     SetMethod(target_t, const char*, v8::InvocationCallback)
 void SetMethod(target_t obj, const char* name,
      ^
/usr/include/nodejs/src/node.h:112:6: note:   template argument deduction/substi                     tution failed:
../node-dht-sensor.cpp:316:52: note:   cannot convert ‘Initialize’ (type ‘void(i                     nt)’) to type ‘v8::InvocationCallback {aka v8::Handle<v8::Value> (*)(const v8::A                     rguments&)}’
   NODE_SET_METHOD(exports, "initialize", Initialize);
                                                    ^
node-dht-sensor.target.mk:80: recipe for target 'Release/obj.target/node-dht-sen                     sor/node-dht-sensor.o' failed
make: *** [Release/obj.target/node-dht-sensor/node-dht-sensor.o] Error 1
make: Leaving directory '/home/pi/.node-red/node_modules/node-dht-sensor/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:                     23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:                     12)
gyp ERR! System Linux 4.1.13-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/.node-red/node_modules/node-dht-sensor
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! node-dh...@0.0.8 install: `./check-bcm2835`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-dh...@0.0.8 install script.
npm ERR! This is most likely a problem with the node-dht-sensor package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./check-bcm2835
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-dht-sensor
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.1.13-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-dht-sensor"
npm ERR! cwd /home/pi/.node-red/node_modules
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/.node-red/node_modules/npm-debug.log
npm ERR! not ok code 0

Mark Setrem

unread,
Dec 1, 2015, 2:57:51 PM12/1/15
to Node-RED
Have you tried to install an earlier version?

e.g

npm install node-dh...@0.07

Blue Collar Ingenuity

unread,
Dec 1, 2015, 3:09:15 PM12/1/15
to node...@googlegroups.com
Hey Mark, 
               I have a lot to learn. How would one know older versions are available ? it doesn't seem that clear on github. Does it not just make sense to install the most current version of node.js,nodered and npm? or will I still run into version issues? 
Jeff 


--
http://nodered.org
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/ioduU-SCx3s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Setrem

unread,
Dec 1, 2015, 4:59:05 PM12/1/15
to Node-RED
If you then look at the github page for the node-dht-sensor

Look at the open issues, you'll see someone had almost the identical issue as you 

and the author wrote:"You should not use node-dh...@0.0.8 with older versions of node (i.e. before v12) that´s why you are getting these errors."

Then if you look at the github page of the node-red-contrib-dht-sensor

the package.json file lists the dependencies on other "libraries" that the node-red-node requires.
(it should also enable npm to auto install the dependencies as well)

this shows: 

"dependencies": {
     "node-dht-sensor": "*"
  }

the star means any version.

So the author of the node-red-node says it should be OK to use an earlier version (as there would be a minimum version specified if they know there was a problem)
And the author of the required node-dht-sensor suggests to install a version before 0.0.8


You could upgrade the version of nodejs following the instructions here:  http://nodered.org/docs/hardware/raspberrypi.html#upgrading
Personally I wouldn't go to the latest version of node.js - see the big yellow box on this page http://nodered.org/docs/getting-started/installation.html
You are likely to get different errors with other nodes. 

But you could install v0.12.x  I'm happily running some v.0.10.x and some v.0.12.x nodejs versions on various RaspberryPis and have only once hit a problem like this.




Nicholas O'Leary

unread,
Dec 1, 2015, 5:07:28 PM12/1/15
to Node-RED Mailing LIst
It isn't ideal that node-red-contrib-dht-sensor has such a liberal approach to the underlying module version. If node-dht-sensor were to release a major version change, which could introduce breaking API changes, then it would break the node-red node.

With our core nodes we try to be as specific as possible with dependency versions so we can properly manage version changes.

From what you've said, I think it is very questionable that node-dht-sensor made a release that would break existing users on node 0.10.x but only changed the last digit of their version string - that isn't proper semantic versioning (see semver.org).

Regardless, this is academic for you Jeff. I'm sorry you've had the issues you have had. I think you've hit a bit of a perfect storm of problems - each of which is explainable in isolation, but the sum total has made it a frustrating experience for you.

The fact the apt-installed version of node.js is so back level (0.10.x) is a real shame - but also completely out of our hands (nor is it the RPi guys fault - they take from Debian Jessie).


NIck

--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

Dave C-J

unread,
Dec 2, 2015, 4:17:58 AM12/2/15
to node...@googlegroups.com
I have raised a pull request against the contrib node to pin the dependancy back to version 0.0.6 that does compile on node v0.10.x.

In the interim you can install a copy from here

      cd ~/.node-red

I have tested that against a clean Pi preinstall. (after adding the bcm library of course).
You have to run node-red as root but apart from that it works ok.

Blue Collar Ingenuity

unread,
Dec 4, 2015, 1:45:09 PM12/4/15
to Node-RED
Thanks Dave for your effort! 
                                          I stuck with it have NR running with current version of node.js. I am happy as I have my Neurio energy reporting to EMONCMS and also getting temp/humid from my DHT11. 

Now I am working on my auto start that will allow these all to run with no errors. I'm back to following the PM2 instructions. I've tested several start strings with no success. Some how I need to get 
 
sudo node-red-pi --max-old-space-size=128 --userDir /home/pi/.node-red

into PM2 as it is the only start up that enables the bcm8235 (if that makes sense) 

Jeff  

Dave C-J

unread,
Dec 4, 2015, 2:33:41 PM12/4/15
to node...@googlegroups.com

Try sudo pm2.....

Julian Knight

unread,
Dec 4, 2015, 6:32:39 PM12/4/15
to Node-RED
You should be able to do this with just systemd. See my attempt in Peter's debugging thread.

Blue Collar Ingenuity

unread,
Dec 4, 2015, 6:45:57 PM12/4/15
to node...@googlegroups.com
Close but no go ? 
pi@raspberrypi:~ $ pm2 start node-red-pi /usr/bin/node-red --node-args="--max-old-space-size=128" -- -v
[PM2] Starting node-red-pi in fork_mode (1 instance)
[PM2] Done.
┌─────────────┬────┬──────┬──────┬────────┬─────────┬────────┬─────────────┬──────────┐
│ App name    │ id │ mode │ pid  │ status │ restart │ uptime │ memory      │ watching │
├─────────────┼────┼──────┼──────┼────────┼─────────┼────────┼─────────────┼──────────┤
│ node-red-pi │ 0  │ fork │ 2362 │ online │ 0       │ 0s     │ 16.586 MB   │ disabled │
└─────────────┴────┴──────┴──────┴────────┴─────────┴────────┴─────────────┴──────────┘
 Use `pm2 show <id|name>` to get more details about an app
pi@raspberrypi:~ $ pm2 list
┌─────────────┬────┬──────┬─────┬─────────┬─────────┬────────┬────────┬──────────┐
│ App name    │ id │ mode │ pid │ status  │ restart │ uptime │ memory │ watching │
├─────────────┼────┼──────┼─────┼─────────┼─────────┼────────┼────────┼──────────┤
│ node-red-pi │ 0  │ fork │ 0   │ errored │ 14      │ 0      │ 0 B    │ disabled │
└─────────────┴────┴──────┴─────┴─────────┴─────────┴────────┴────────┴──────────┘


On Fri, Dec 4, 2015 at 2:33 PM, Dave C-J <dce...@gmail.com> wrote:

Try sudo pm2.....

--
http://nodered.org
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/ioduU-SCx3s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.

Blue Collar Ingenuity

unread,
Dec 4, 2015, 6:48:16 PM12/4/15
to node...@googlegroups.com
Opps ...the sudo produced this 

pi@raspberrypi:~ $ sudo pm2 start node-red-pi /usr/bin/node-red --node-args="--max-old-space-size=128" -- -v
[PM2] restartProcessId process id 0
[PM2] Process successfully started
┌─────────────┬────┬──────┬──────┬─────────┬─────────┬────────┬─────────────┬──────────┐
│ App name    │ id │ mode │ pid  │ status  │ restart │ uptime │ memory      │ watching │
├─────────────┼────┼──────┼──────┼─────────┼─────────┼────────┼─────────────┼──────────┤
│ node-red-pi │ 0  │ fork │ 2646 │ online  │ 28      │ 0s     │ 15.777 MB   │ disabled │
│ .node-red   │ 1  │ fork │ 0    │ errored │ 28      │ 0      │ 0 B         │ disabled │
└─────────────┴────┴──────┴──────┴─────────┴─────────┴────────┴─────────────┴──────────┘
 Use `pm2 show <id|name>` to get more details about an app
pi@raspberrypi:~ $ pm2 list
┌─────────────┬────┬──────┬─────┬─────────┬─────────┬────────┬────────┬──────────┐
│ App name    │ id │ mode │ pid │ status  │ restart │ uptime │ memory │ watching │
├─────────────┼────┼──────┼─────┼─────────┼─────────┼────────┼────────┼──────────┤
│ node-red-pi │ 0  │ fork │ 0   │ errored │ 28      │ 0      │ 0 B    │ disabled │
└─────────────┴────┴──────┴─────┴─────────┴─────────┴────────┴────────┴──────────┘

Blue Collar Ingenuity

unread,
Dec 4, 2015, 7:01:56 PM12/4/15
to Node-RED
Hi Julian, 
              Thought I'd give it a try....I got the failed save and then get this error;
pi@raspberrypi:~ $ sudo systemctl daemon-reload && sudo systemctl enable nr-live2
Failed to execute operation: No such file or directory

Jeff 
Reply all
Reply to author
Forward
0 new messages