OpenZWave / node-red-contrib-openzwave

OpenZWave nodes for node-red
Other
49 stars 27 forks source link

help for installing OpenZwave #61

Closed Nick-smar closed 4 years ago

Nick-smar commented 6 years ago

Hi,

I'm not able to install the OpenZwave node. Not via the 'pallet' and no via CL.

Can someone please get me on the way. Thanks

Nick

pi@raspberrypi:~/.node-red $ npm install node-red-contrib-openzwave

openzwave-shared@1.4.5 preinstall /home/pi/.node-red/node_modules/.staging/openzwave-shared-32881044 node lib/install-ozw.js

openzwave-shared@1.4.5 install /home/pi/.node-red/node_modules/openzwave-shared node-gyp rebuild

make: Map '/home/pi/.node-red/node_modules/openzwave-shared/build' wordt binnengegaan CXX(target) Release/obj.target/openzwave_shared/src/callbacks.o In file included from ../src/callbacks.cc:18:0: ../src/openzwave.hpp:29:21: fatal error: Manager.h: Bestand of map bestaat niet

include "Manager.h"

                 ^

compilation terminated. openzwave_shared.target.mk:115: recept voor doel 'Release/obj.target/openzwave_shared/src/callbacks.o' is mislukt make: *** [Release/obj.target/openzwave_shared/src/callbacks.o] Fout 1 make: Map '/home/pi/.node-red/node_modules/openzwave-shared/build' wordt verlaten 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:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Linux 4.9.35-v7+ gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/pi/.node-red/node_modules/openzwave-shared gyp ERR! node -v v6.11.2 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm WARN node-red-project@0.0.1 No repository field. npm WARN node-red-project@0.0.1 No license field. npm ERR! Linux 4.9.35-v7+ npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-red-contrib-openzwave" npm ERR! node v6.11.2 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE

npm ERR! openzwave-shared@1.4.5 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the openzwave-shared@1.4.5 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the openzwave-shared 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 information on how to open an issue for this project with: npm ERR! npm bugs openzwave-shared npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls openzwave-shared npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/.node-red/npm-debug.log

robertsLando commented 6 years ago

Check issue #39 and read Readme.md instruction. Before using this node you need to have open-zwave library and also openzwave shared installed.

Here the instructions to install them on your raspberry: https://github.com/OpenZWave/node-openzwave-shared/blob/master/README-raspbian.md

Nick-smar commented 6 years ago

Thanks robertsLando,

I should have read better, but without your instructions I would not be any further. The node is installed, that's 1 thing. I haven't read anything out yet, but that will come.

My homekit node for one or another reason is not working anymore since i've installed the zwave node. I will try to re-intall that one and hope there is not conflict.

Br

Nick-smar commented 6 years ago

Maybe 1:

I don't have the zwave controller available. Any idea?

Thx image

robertsLando commented 6 years ago

That doesn't mean it isn't aviable, it has that icon because controller is not a node but it is a configuration node. You create a z-wave controller by creating a z-wave client in z-wave-in or/and z-wave out node

Nick-smar commented 6 years ago

Ok thanks,

Then I only have one issue with my Homekit node, but thats not for here.

It should be easy, but maybe I'm missing the complete point. I have an Aeon Z-Wave stick and a Fibaro Motion Sensor.

I have 'included' the sensor to the stick. This is succesfull because in Domoticz I can see they are connected. image

Beside 'looking', I did nothing in domoticz.

Now I thought I could go to Node-red, just use the Z-wave in node and every time there was movement, it would just pop up in my debug node. But my debug node stays empty.

image

In the end, I just want temperature and a signal of movement in node-red. This z-wave is the only wireless device I will have in my house automation project. The signals received here will be transmitted via modbus to my PLC. This last part I have allready done for all my other devices (homekit, logitech, roomba, ring, alexa) On this way I have information of any kind of device in my PLC making my automation project quite complete.

I have searched the web, but I can hardly find any info or exemples of this z-wave node, probably because it should be easy. Unfortunately it's not working yet, so any suggestion is verry welcome.

br

thx

EDIT: I just 'clicked' onthe fibarro sensor, and my debug node received ALL the configuration info. So the communication seems to work. Then the question now is, how can I receive the movement info and temperature cyclic?

image

Nick-smar commented 6 years ago

Ohw, now it suddenly works all the time, I just need to do something about the delay. Thank for the help, I'll figure it out now.

Br

Nick

robertsLando commented 6 years ago

I don't know if you can do so much about the delay, if that is the only one sensor you have you can set a lower pool interval but it's not a "best practise".

Nick-smar commented 6 years ago

Ok, almost embarrassed, but now my node-red doesn't start anymore ...

I had the flow running like the screenshot here above. I disconnected the AEON stickto make some easy adaptions via Domoticz in the fibaro motion sensor (with that interface it's easy to change settings of the devices)

After that, I re-connected the stick into the PI. Because I've read you best do a restart after connecting it I rebooted the pi. Normally my node-red starts automatically, but it was not available via the webserver. So I started it manually but now I get error messages.

It makes no difference if the stick is connected or not.

This are the screenshots:

If I just enter NODE-RED image


pi@raspberrypi:~ $ node-red 17 Jul 13:31:49 - [info]

Welcome to Node-RED

17 Jul 13:31:49 - [info] Node-RED version: v0.18.7 17 Jul 13:31:49 - [info] Node.js version: v4.2.1 17 Jul 13:31:49 - [info] Linux 4.9.35-v7+ arm LE 17 Jul 13:31:50 - [info] Loading palette nodes 17 Jul 13:31:56 - [info] node-red-contrib-openzwave: 1.2.4 17 Jul 13:31:56 - [info] openzwave-shared: 1.4.5 17 Jul 13:31:57 - [info] Dashboard version 2.4.3 started at /ui 17 Jul 13:31:58 - [warn] ------------------------------------------------------ 17 Jul 13:31:58 - [warn] [node-red-node-serialport/serialport] Error: Module version mismatch. Expected 46, got 48. (line:6) 17 Jul 13:31:58 - [warn] [node-red-contrib-modbustcp/modbus tcp] SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode 17 Jul 13:31:58 - [warn] [node-red-contrib-homekit/homekit] Error: Module version mismatch. Expected 46, got 48. 17 Jul 13:31:58 - [warn] ------------------------------------------------------ 17 Jul 13:31:58 - [info] Settings file : /home/pi/.node-red/settings.js 17 Jul 13:31:58 - [info] User directory : /home/pi/.node-red 17 Jul 13:31:58 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable 17 Jul 13:31:58 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json 17 Jul 13:31:58 - [info] Server now running at http://127.0.0.1:1880/ 17 Jul 13:31:58 - [warn]


Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials.

You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

17 Jul 13:31:58 - [info] Starting flows Initialising OpenZWave 1.4.79 binary addon for Node.JS. OpenZWave Security API is ENABLED ZWave device db : /usr/etc/openzwave User settings path : /home/pi/.node-red Option Overrides : --Logging false --ConsoleOutput false --QueueLogLevel 6 --DriverMaxAttempts 3 --NetworkKey 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 2018-07-17 13:31:59.059 Error, Cannot find a path to the configuration files at /usr/etc/openzwave/, Using /etc/openzwave/ instead... 2018-07-17 13:31:59.060 Info, Reading /etc/openzwave/options.xml for Options 2018-07-17 13:31:59.060 Warning, Failed to Parse /home/pi/.node-red/options.xml: Failed to open file Error: Driver.cpp:6727 - Failed to Read Network Key


If I enter NODE-RED START image


pi@raspberrypi:~ $ node-red start 17 Jul 13:31:11 - [info]

Welcome to Node-RED

17 Jul 13:31:11 - [info] Node-RED version: v0.18.7 17 Jul 13:31:11 - [info] Node.js version: v4.2.1 17 Jul 13:31:11 - [info] Linux 4.9.35-v7+ arm LE 17 Jul 13:31:12 - [info] Loading palette nodes 17 Jul 13:31:18 - [info] node-red-contrib-openzwave: 1.2.4 17 Jul 13:31:18 - [info] openzwave-shared: 1.4.5 17 Jul 13:31:19 - [info] Dashboard version 2.4.3 started at /ui 17 Jul 13:31:20 - [warn] ------------------------------------------------------ 17 Jul 13:31:20 - [warn] [node-red-node-serialport/serialport] Error: Module version mismatch. Expected 46, got 48. (line:6) 17 Jul 13:31:20 - [warn] [node-red-contrib-modbustcp/modbus tcp] SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode 17 Jul 13:31:20 - [warn] [node-red-contrib-homekit/homekit] Error: Module version mismatch. Expected 46, got 48. 17 Jul 13:31:20 - [warn] ------------------------------------------------------ 17 Jul 13:31:20 - [info] Settings file : /home/pi/.node-red/settings.js 17 Jul 13:31:20 - [info] User directory : /home/pi/.node-red 17 Jul 13:31:20 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable 17 Jul 13:31:20 - [info] Flows file : /home/pi/.node-red/start 17 Jul 13:31:20 - [info] Server now running at http://127.0.0.1:1880/ 17 Jul 13:31:20 - [warn]


Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials.

You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

17 Jul 13:31:20 - [info] Starting flows Initialising OpenZWave 1.4.79 binary addon for Node.JS. OpenZWave Security API is ENABLED ZWave device db : /usr/etc/openzwave User settings path : /home/pi/.node-red Option Overrides : --Logging true --ConsoleOutput true --QueueLogLevel 6 --DriverMaxAttempts 3 --NetworkKey 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 2018-07-17 13:31:20.532 Error, Cannot find a path to the configuration files at /usr/etc/openzwave/, Using /etc/openzwave/ instead... 2018-07-17 13:31:20.534 Info, Reading /etc/openzwave/options.xml for Options 2018-07-17 13:31:20.535 Warning, Failed to Parse /home/pi/.node-red/options.xml: Failed to open file 2018-07-17 13:31:20.544 Always, OpenZwave Version 1.4.79 Starting Up 2018-07-17 13:31:20.545 Warning, Invalid Network Key. Does not contain 16 Bytes - Contains 1 2018-07-17 13:31:20.545 Warning, Raw Key: 0x10 2018-07-17 13:31:20.546 Warning, Parsed Key: 2018-07-17 13:31:20.546 Warning, 1) - 0x10 2018-07-17 13:31:20.547 Error, Exception: Driver.cpp:6727 - 103 - Failed to Read Network Key Error: Driver.cpp:6727 - Failed to Read Network Key


It must have something to do with the network key, but I have no idea what. It's not changed on the stick and is still the default key.

I have read the file /etc/openzwave/options.xml, but there is no info there.

My Linux knowledge is almost nothing, so it's very easy to get stuck in all this stuff. That's whats happening now....

robertsLando commented 6 years ago

Try this:

node-red-stop
cd ~/.node-red 
sudo rm flows_raspberrypi_cred.json
node-red-start

This should remove the stored credentials file and automatically recreate one once node-red boots, after running node-red-start command you will have to insert the network key another time in the client configuration.

For next time my suggestion is to shutdown raspberry before remving the z-stick sudo shutdown -h now than disconnect and reconnect the power cable to start the raspberry

Nick-smar commented 6 years ago

So much thanks for your help...

Now I'm in a infinite loop, this stays comming up.....

Welcome to Node-RED

17 Jul 14:20:44 - [info] Node-RED version: v0.18.7 17 Jul 14:20:44 - [info] Node.js version: v4.2.1 17 Jul 14:20:44 - [info] Linux 4.9.35-v7+ arm LE 17 Jul 14:20:46 - [info] Loading palette nodes 17 Jul 14:20:51 - [info] node-red-contrib-openzwave: 1.2.4 17 Jul 14:20:51 - [info] openzwave-shared: 1.4.5 17 Jul 14:20:52 - [info] Dashboard version 2.4.3 started at /ui 17 Jul 14:20:53 - [warn] ------------------------------------------------------ 17 Jul 14:20:53 - [warn] [node-red-node-serialport/serialport] Error: Module version mismatch. Expected 46, got 48. (line:6) 17 Jul 14:20:53 - [warn] [node-red-contrib-modbustcp/modbus tcp] SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode 17 Jul 14:20:53 - [warn] [node-red-contrib-homekit/homekit] Error: Module version mismatch. Expected 46, got 48. 17 Jul 14:20:53 - [warn] ------------------------------------------------------ 17 Jul 14:20:53 - [info] Settings file : /home/pi/.node-red/settings.js 17 Jul 14:20:53 - [info] User directory : /home/pi/.node-red 17 Jul 14:20:53 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable 17 Jul 14:20:53 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json 17 Jul 14:20:53 - [info] Server now running at http://127.0.0.1:1880/ 17 Jul 14:20:53 - [warn]

Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials. You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

17 Jul 14:20:53 - [info] Starting flows Initialising OpenZWave 1.4.79 binary addon for Node.JS. OpenZWave Security API is ENABLED ZWave device db : /usr/etc/openzwave User settings path : /home/pi/.node-red Option Overrides : --Logging false --ConsoleOutput false --QueueLogLevel 6 --DriverMaxAttempts 3 --NetworkKey 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 2018-07-17 14:20:53.870 Error, Cannot find a path to the configuration files at /usr/etc/openzwave/, Using /etc/openzwave/ instead... 2018-07-17 14:20:53.871 Info, Reading /etc/openzwave/options.xml for Options 2018-07-17 14:20:53.871 Warning, Failed to Parse /home/pi/.node-red/options.xml: Failed to open file Error: Driver.cpp:6727 - Failed to Read Network Key nodered.service: main process exited, code=exited, status=103/n/a Unit nodered.service entered failed state. nodered.service holdoff time over, scheduling restart. Stopping Node-RED graphical event wiring tool.... Starting Node-RED graphical event wiring tool.... Started Node-RED graphical event wiring tool.. 17 Jul 14:20:57 - [info]

image

robertsLando commented 6 years ago

Try to also delete the flow file, so run: cd ~/.node-red && sudo rm flows_raspberrypi*

ATTENTION: This will delete all your flows in node, If the flow was easy and you remeber how to rebuild it do this than let me know

Nick-smar commented 6 years ago

Thanks man,

it's back running :) after every adaptation I do a backup, luckily, because I have spend ages getting my flow all streamlined with my application.

I hope I can now smoothly go further with ZWave and not too many issues anymore.

Just because this all seems so easy for you, any idea whats going on with my homekit node? If not, I'll go searching via another topic. image

Thanks again!

robertsLando commented 6 years ago

That kind of error usually happens when you have installed node dependencies for one version of node and then update your version of node to something with an incompatible version.

To fix this you should do to node red dir (cd ~/.node-red) remove node_modules (rm -r node_modules) directory and than reinstall all modules by typing npm install command but I never tried this with node-red.

I suggest you to remove and reinstall single errored modules (homekit and serial port)

npm uninstall node-red-contrib-homekit 
npm uninstall node-red-contrib-modbustcp 
npm uninstall node-red-node-serialport

npm install node-red-contrib-homekit --save
npm install node-red-contrib-modbustcp --sve
npm install node-red-node-serialport --save

TIP: Instead of homekit node I usually use Homebridge. Check it out ;)

Nick-smar commented 6 years ago

Hi, unfortunattely, I did it again.

Yesterday I messed everything up big time, so for my own healthI just restarted with a complete new RPI image (yess, I'm that kind of linux expert)

This time I was able to install everything concerning zwave quite fast following the above instructions. After that I saw in Node-red that the zwave nodes where available. So I just imported my backup programm in node-red. I think it went wrong there. I believe, but I'm not sure, the Z-wave is encrypted and that it was not a good idea to restart with a backup.

If I want to start NODE-RED it is restarting time after time whith everytime this text in the terminal

Welcome to Node-RED
===================
22 Oct 19:12:49 - [info] Node-RED version: v0.19.4
22 Oct 19:12:49 - [info] Node.js  version: v8.12.0
22 Oct 19:12:49 - [info] Linux 4.14.71-v7+ arm LE
22 Oct 19:12:50 - [info] Loading palette nodes
22 Oct 19:12:54 - [info] node-red-contrib-openzwave: 1.2.4
22 Oct 19:12:54 - [info] openzwave-shared: 1.4.6
22 Oct 19:12:56 - [info] Settings file  : /home/pi/.node-red/settings.js
22 Oct 19:12:56 - [info] Context store  : 'default' [module=memory]
22 Oct 19:12:56 - [info] User directory : /home/pi/.node-red
22 Oct 19:12:56 - [warn] Projects disabled : editorTheme.projects.enabled=false
22 Oct 19:12:56 - [info] Flows file     : /home/pi/.node-red/flows_raspberrypi.json
22 Oct 19:12:56 - [info] Server now running at http://127.0.0.1:1880/
22 Oct 19:12:56 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
22 Oct 19:12:56 - [info] Starting flows
Initialising OpenZWave 1.4.79 binary addon for Node.JS.
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
22 Oct 19:12:59 - [info]

And then it just restarts with the same text. Any idea for a quick fix?

Thanks

Nick

Nick-smar commented 6 years ago

Nevermind, I wass able to delete all my flows with:

pi@raspberrypi:~/.node-red $ rm flows_raspberrypi.json

Any idea though? Is it in my z-WAVE stick that I have an encription or is it really in the program? Just to know if i should reset te stick or restart my program code

==> It's in the code, because it allready blocks when I just import my code. I don't really understand where it blocks, because the zwave in block is configured quite basic. So maybe my installation proces went not that good.

robertsLando commented 6 years ago

The problem is related to credentials file, once you import the backup try to remove the secret network key from the z wave node than deploy and reinsert it

Nick-smar commented 6 years ago

Hi,

Not sure what you mean with 'remove the secret network key'.

image

Next step is simply to reset the stick, but then I need to reconfigure and also reset every zwave device. So if there is one more thing to try?

br

ekarak commented 4 years ago

resolving old issue