Closed fraser73 closed 9 years ago
Are you sure you have all the required OpenZWave development libraries and headers?
Note: I plan on dropping the gyp build in favour of using OZW as a shared library, so in the future it will be as easy as "apt-get install libopenzwave" Στις 15 Μαϊ 2015 6:41 μ.μ., ο χρήστης "fraser73" notifications@github.com έγραψε:
I'm unable to install node-red-contrib-openzwave on a base bulid of Raspbian 2015-02-16 Wheezy. The build has only node v0.10.38 and Node-Red v0.10.6 installed on top of the install image.
Command used: sudo npm -g install node-red-contrib-openzwave Full output attached Snippit at end of output: make: *\ [Release/obj.target/openzwave/src/openzwave.o] Error 1
make: Leaving directory '/usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/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:820:12) gyp ERR! System Linux 3.18.7-v7+ gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave gyp ERR! node -v v0.10.38 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok
npm ERR! openzwave@0.0.32 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the openzwave@0.0.32 install script. npm ERR! This is most likely a problem with the openzwave package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls openzwave npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.18.7-v7+ npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "node-red-contrib-openzwave" npm ERR! cwd /tmp npm ERR! node -v v0.10.38 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0
— Reply to this email directly or view it on GitHub https://github.com/ekarak/node-red-contrib-openzwave/issues/2.
I was under the impression that npm would resolve dependancies... The problem appears to be with hid.c, here is the output from the point of first error:
CC(target) Release/obj.target/libopenzwave/deps/open-zwave/cpp/hidapi/linux/hid.o
../deps/open-zwave/cpp/hidapi/linux/hid.c: In function ‘get_device_string’:
../deps/open-zwave/cpp/hidapi/linux/hid.c:308:6: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
AR(target) Release/obj.target/deps/open-zwave/libopenzwave.a
COPY Release/libopenzwave.a
CXX(target) Release/obj.target/openzwave/src/openzwave.o
In file included from ../deps/open-zwave/cpp/src/Node.h:37:0,
from ../deps/open-zwave/cpp/src/Driver.h:37,
from ../deps/open-zwave/cpp/src/Manager.h:39,
from ../src/openzwave.cc:27:
../deps/open-zwave/cpp/src/value_classes/ValueList.h:74:55: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../deps/open-zwave/cpp/src/value_classes/ValueList.h:75:53: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../deps/open-zwave/cpp/src/value_classes/ValueList.h:79:24: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../src/openzwave.cc:38:26: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:38:26: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:38:46: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:39:30: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:39:30: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:39:50: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:40:33: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:40:33: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:40:53: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:41:31: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:41:31: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:41:51: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:42:31: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:42:31: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:42:51: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:43:34: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:43:34: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:43:54: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:44:30: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:44:30: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:44:50: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:45:31: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:45:31: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:45:51: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:46:32: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:46:32: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:46:52: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:47:33: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:47:33: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:47:53: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:48:34: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:48:34: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:48:54: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:49:32: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:49:32: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:49:52: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc:50:32: error: ‘FunctionCallbackInfo’ does not name a type
../src/openzwave.cc:50:32: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/openzwave.cc:50:52: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/openzwave.cc: In function ‘void {anonymous}::async_cb_handler(uv_asynct)’:
../src/openzwave.cc:174:20: error: ‘NewFromUtf8’ is not a member of ‘v8::String’
../src/openzwave.cc:175:47: error: invalid conversion from ‘v8::Isolate_’ to ‘int32_t {aka int}’ [-fpermissive]
/usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave/.node-gyp/0.10.38/deps/v8/include/v8.h:1396:34: error: initializing argument 1 of ‘static v8::Localv8::Integer v8::Integer::New(int32t, v8::Isolate)’ [-fpermissive]
../src/openzwave.cc:175:47: error: invalid conversion from ‘uint32t {aka unsigned int}’ to ‘v8::Isolate’ [-fpermissive]
/usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave/.node-gyp/0.10.38/deps/v8/include/v8.h:1396:34: error: initializing argument 2 of ‘static v8::Localv8::Integer v8::Integer::New(int32t, v8::Isolate)’ [-fpermissive]
../src/openzwave.cc:176:71: error: no matching function for call to ‘v8::Localv8::Object::New(v8::Isolate_&, v8::Persistentv8::Object&)’
../src/openzwave.cc:176:71: note: candidate is:
/usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave/.node-gyp/0.10.38/deps/v8/include/v8.h:4212:10: note: static v8::Localmake
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/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:820:12)
gyp ERR! System Linux 3.18.7-v7+
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave
gyp ERR! node -v v0.10.38
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! openzwave@0.0.32 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the openzwave@0.0.32 install script.
npm ERR! This is most likely a problem with the openzwave package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls openzwave
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.18.7-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "node-red-contrib-openzwave"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
The problem is not with hid.c but with src/openzwave.cc, the main C++ source binding between Node.js and OpenZWave. I suspect you have mismatching Node.JS headers in your system. You're not compiling against Node 0.12, are you?
node --version returns v0.10.38
I've tried several builds in the last couple of weeks -
CentOS 6.5 x64 VM with Openzwave installed from repo - npm install -g node-red-contrib-openzwave fails As above but with npm install of node-openzwave - node-openzwave appears to install, but doesn't actually confirm, it just finished. After this an install of node-red-contrib-openzwave fails anyway.
I've also tried with a Raspberry Pi 2 (which is my current hardware) with raspbian wheezy, as there is no openzwave repo for ARM, I installed from source, other than that I've made the same builds as with CentOS and with the same results.
How would I identify mismatching Node.JS headers? (I'm really at the edge of my Linux knowledge here.)
One thing to note is that on the system that I've installed Openzwave, MinOZW shows the network working fine, with the different devices talking to each other.
On the systems that I've installed node-openzwave, if I manually copy the files for node-contrib-openzwave into their own folder within node_modules, the zwave nodes appear, I see some of the network messages in the debug pane in node-red (not all, though), however I can't actually send any messages to the network, even something as simple as switchOn/switchOff. So something is clearly broken.
I had the same issue, the problem is that the openzwave.cc in the linked openzwave package is a bit malformed.
On several lines the generic type definitions are written as
Local < Value > args[16];
But the spaces should be removed :
Local<Value> args[16];
A quick fix for me was to get the node-openzwave source from github, remove the extra spaces, npm install it from the folder and copy it manually to the node_modules folder, next do the same for this package and remove the dependency from the packages.json
Hi Kris,
Lets try this from a different angle. I've just published https://github.com/ekarak/node-openzwave-shared . This is node-openzwave with a twist: it doesn't include, nor does it try to compile openzwave (You need to have it installed beforehand).
Please grab a copy of this node-openzwave-shared and try running
node-gyp build
(you might also need to configure gyp it you haven't done so, this is a one-off command: node-gyp configure
).
This approach will isolate compilation problems that might have been caused by OpenZWave itself. Give it a go and let me know...
works great ! thanks. only one small issue but that had to do with the install location of the openzwave library itself, i had to add /usr/local/lib to LD_LIBRARY_PATH for nodejs to find the library
Glad I helped...! I'll update the package dependency hopefully sometime in the next week. Στις 17 Μαϊ 2015 3:03 μ.μ., ο χρήστης "Kris Daniels" < notifications@github.com> έγραψε:
works great ! thanks. only one small issue but that had to do with the install location of the openswave library itself, i had to add /usr/local/lib to LD_LIBRARY_PATH for nodejs to find the library
— Reply to this email directly or view it on GitHub https://github.com/ekarak/node-red-contrib-openzwave/issues/2#issuecomment-102794532 .
Ok... I've installed OpenZwave from source using git clone, then done a make, make install (there is as far as I can tell no rpi repo with it precompiled.) I can do a MinOZW (once the LD_LIBRARY_PATH has been updated as mentioned by Kris) and that works fine.
Then I've done a git clone of your new node-openzwave-shared and done a node-gyp configure, node-gyp build. Then I ran node test.js and it scans my zwave network file.
Now I'm stuck (sorry we're at the edge of my knowledge here) I don't know what I need to do, in order to get Node Red to see node-red-contrib-openzwave, If I run Node Red now it says "[zwave] error: cannot find module 'openzwave'" (I haven't done a npm install openzwave - do I need to do this as well as installing openzwave from source?)
Sorry, I've not patched node-red-contrib-openzwave to use the new repo yet. Patience, I'm a married man! :) You need to to 'npm install /local/path/to/openzwave-shared' from within the node-red directory, this should copy node-openzwave-shared into the 'node_modules' subdirectory.
2015-05-19 15:14 GMT+03:00 fraser73 notifications@github.com:
Ok... I've installed OpenZwave from source using git clone, then done a make, make install (there is as far as I can tell no rpi repo with it precompiled.) I can do a MinOZW (once the LD_LIBRARY_PATH has been updated as mentioned by Kris) and that works fine.
Then I've done a git clone of your new node-openzwave-shared and done a node-gyp configure, node-gyp build. Then I ran node test.js and it scans my zwave network file.
Now I'm stuck (sorry we're at the edge of my knowledge here) I don't know what I need to do, in order to get Node Red to see node-red-contrib-openzwave, If I run Node Red now it says "[zwave] error: cannot find module 'openzwave'" (I haven't done a npm install openzwave - do I need to do this as well as installing openzwave from source?)
— Reply to this email directly or view it on GitHub https://github.com/ekarak/node-red-contrib-openzwave/issues/2#issuecomment-103463884 .
Elias Karakoulakis Electrical & Computer Engineer NTUA Athens Msc Information Systems, AUEB Athens KNX Advanced Partner
Thanks for your help here - I'm not meaning to pressure you for an urgent fix...
As you said I've done a: cd /usr/lib/node_modules/node-red npm install /{path to files}/node-openzwave-shared/
All seemed to work fine. node test.js works (although does complain about not being able to access options.xml - I think this is something I've seen before, so not too worried)
If I fire up Node-Red with the contents of node-red-contrib-openzwave put into their own directory under node-red (not actually npm installed, just downloaded an put there) I can see the Zwave nodes. With a zwave-input node linked to debug node I can see traffic on the network (an initial scan), but I can't issue any messages to the network using the output node. (Is this to be expected?)
Have you configured the output node to look at the correct USB port?
2015-05-19 16:10 GMT+03:00 fraser73 notifications@github.com:
Thanks for your help here - I'm not meaning to pressure you for an urgent fix...
As you said I've done a: cd /usr/lib/node_modules/node-red npm install /{path to files}/node-openzwave-shared/
All seemed to work fine. node test.js works (although does complain about not being able to access options.xml - I think this is something I've seen before, so not too worried)
If I fire up Node-Red with the contents of node-red-contrib-openzwave put into their own directory under node-red (not actually npm installed, just downloaded an put there) I can see the Zwave nodes. With a zwave-input node linked to debug node I can see traffic on the network (an initial scan), but I can't issue any messages to the network using the output node. (Is this to be expected?)
— Reply to this email directly or view it on GitHub https://github.com/ekarak/node-red-contrib-openzwave/issues/2#issuecomment-103479448 .
Elias Karakoulakis Electrical & Computer Engineer NTUA Athens Msc Information Systems, AUEB Athens KNX Advanced Partner
I've checked and double checked, the input and output node are the only one defined (/dev/ttyUSB0) I've had a look at permissions and nothing is obviously wrong. I've also looked at dmesg and no related errors are showing.
I'm running node-red-pi as -v and nothing shows up at all in the console or the debug, but Node-Red reports when I click on the inject node that the message has been successfully injected.
Just as a further update - I've downloaded and built Open Zwave Control Panel, which seems to work fine for both receiving data from and writing data to the Z-stick.
yup - I'm having the same issues here. ( I've worked a bit on node-openzwave-shared last night ) I'll just have to put my trustly old gdb in action I guess...
2015-05-20 15:22 GMT+03:00 fraser73 notifications@github.com:
Just as a further update - I've downloaded and built Open Zwave Control Panel, which seems to work fine for both receiving data from and writing data to the Z-stick.
— Reply to this email directly or view it on GitHub https://github.com/ekarak/node-red-contrib-openzwave/issues/2#issuecomment-103861653 .
Elias Karakoulakis Electrical & Computer Engineer NTUA Athens Msc Information Systems, AUEB Athens KNX Advanced Partner
ok, try updating both node-openzwave-shared and node-red-contrib-openzwave. setNodeOn/Off still doesn't work, but setValue (the most important one) works OK for me.
Try importing the example flow in http://flows.nodered.org/flow/b993a7bd7a2832edb23a (although this includes the KNX/EIB nodes which you probably won't have)
Hurrah! I can switch lights on an off again! Thanks very much for your help with this.
I do have one other issue which I hope you can help with. My Aeon Labs multisensor's output is unhandled, I'm not sure why this is, but possibly it's something to do with it being multi instance (I seem to recall having read something about this being a problem.) Below is a sample from the Node-Red console of what happens when it's movement sensor is triggered, nothing appears to be sent to the Node Red Zwave input node (which I've got linked to debug, so I can see everything that happens on the network)
2015-05-22 10:54:24.131 Detail, Node002, Received: 0x01, 0x09, 0x00, 0x04, 0x08, 0x02, 0x03, 0x30, 0x03, 0xff, 0x37 2015-05-22 10:54:24.131 Detail, 2015-05-22 10:54:24.131 Info, Node002, Received SensorBinary report: Sensor:55 State=On 2015-05-22 10:54:24.131 Detail, Node002, Refreshed Value: old value=false, new value=true, type=bool 2015-05-22 10:54:24.131 Detail, Node002, Changes to this value are not verified 2015-05-22 10:54:24.137 Detail, Node002, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x02, 0x03, 0x30, 0x03, 0xff, 0x3f 2015-05-22 10:54:24.137 Detail, 2015-05-22 10:54:24.137 Info, Node002, Received SensorBinary report: Sensor:63 State=On 2015-05-22 10:54:24.138 Detail, Node002, Refreshed Value: old value=true, new value=true, type=bool 2015-05-22 10:54:24.138 Detail, Node002, Changes to this value are not verified
It also sends a report for all sensors ever 6mins all of which are unhandled.
ok then I'm closing this and we'll deal with the MultiSensor input on a new one. Thanks!
I'm unable to install node-red-contrib-openzwave on a base bulid of Raspbian 2015-02-16 Wheezy. The build has only node v0.10.38 and Node-Red v0.10.6 installed on top of the install image.
Command used: sudo npm -g install node-red-contrib-openzwave Full output can be added, but is massive! Snippit at end of output: make: *\ [Release/obj.target/openzwave/src/openzwave.o] Error 1
make: Leaving directory '/usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave/build' gyp ERR! build error gyp ERR! stack Error:
make
failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/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:820:12) gyp ERR! System Linux 3.18.7-v7+ gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/node-red-contrib-openzwave/node_modules/openzwave gyp ERR! node -v v0.10.38 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not oknpm ERR! openzwave@0.0.32 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the openzwave@0.0.32 install script. npm ERR! This is most likely a problem with the openzwave package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls openzwave npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.18.7-v7+ npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "node-red-contrib-openzwave" npm ERR! cwd /tmp npm ERR! node -v v0.10.38 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0