Cannot get node-red-contrib-openzwave-am to run

Good evening folks,

When I try to install "node-red-contrib-openzwave-am" using the palette manager, I've the following issue:

21 Nov 19:45:00 - [info] Installing module: node-red-contrib-openzwave-am, version: 1.5.6
21 Nov 19:47:00 - [info] Installed module: node-red-contrib-openzwave-am
21 Nov 19:47:00 - [info] Added node types:
21 Nov 19:47:00 - [info] - node-red-contrib-openzwave-am:zwave-controller : TypeError: require(...).getMac is not a function (line:30)
21 Nov 19:47:00 - [info] - node-red-contrib-openzwave-am:zwave-in : TypeError: require(...).getMac is not a function (line:30)
21 Nov 19:47:00 - [info] - node-red-contrib-openzwave-am:zwave-out : TypeError: require(...).getMac is not a function (line:30)

I'm running the following:
Node-RED version: v0.20.7 (installed with npm install -g --unsafe-perm node-red)
Node.js version: v10.16.3
Darwin 17.7.0 x64 LE

Same issue with
Node-RED version: v1.0.3 (installed via git clone https://github.com/node-red/node-red.git method)
Node.js version: v10.16.3

Thanks in advance for any idea that could help me solving this issue.
Cheers,

Did you try to install the zwave node from the cli?
Ie.
cd .node-red
npm install node-red-contrib-openzwave-am

If so what was the output during install?

Yes I did. Same thing, in the end, when running node-red, I still have the same node-red output:

21 Nov 20:39:14 - [info] Waiting for missing types to be registered:
21 Nov 20:39:14 - [info]  - zwave-controller
21 Nov 20:39:14 - [info]  - zwave-in
21 Nov 20:39:14 - [info]  - zwave-out

Node-RED is working, but zwave module is not working (nodes and connections are dotted red) and the Palette Manager gives the same getMac() error.

Here's the cli output:

npm install node-red-contrib-openzwave-am

> openzwave-shared@1.5.6 preinstall /Users/MyUser/.node-red/node_modules/openzwave-shared
> node lib/install-ozw.js


> openzwave-shared@1.5.6 install /Users/MyUser/.node-red/node_modules/openzwave-shared
> node-gyp rebuild

  CXX(target) Release/obj.target/openzwave_shared/src/callbacks.o
In file included from ../src/callbacks.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave.o
In file included from ../src/openzwave.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-config.o
In file included from ../src/openzwave-config.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-driver.o
In file included from ../src/openzwave-driver.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-groups.o
In file included from ../src/openzwave-groups.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-management.o
In file included from ../src/openzwave-management.cc:17:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-network.o
In file included from ../src/openzwave-network.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-nodes.o
In file included from ../src/openzwave-nodes.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-polling.o
In file included from ../src/openzwave-polling.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-scenes.o
In file included from ../src/openzwave-scenes.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-values.o
In file included from ../src/openzwave-values.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  CXX(target) Release/obj.target/openzwave_shared/src/utils.o
In file included from ../src/utils.cc:18:
../src/openzwave.hpp:32:10: warning: non-portable path to file '"node.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "Node.h"
         ^~~~~~~~
         "node.h"
1 warning generated.
  SOLINK_MODULE(target) Release/openzwave_shared.node
+ node-red-contrib-openzwave-am@1.5.6
added 2 packages from 28 contributors and audited 168 packages in 79.606s
found 0 vulnerabilities

Continuing the discussion from Cannot get node-red-contrib-openzwave-am to run:

Same issue. Same output
Node-Red v 1.0.3
Nodejs v 13.2.0
Raspberry buster

Thanks in advance:)

I recently installed the node without any issue. Perhaps open an issue op github ?

Well, this have already been done :slight_smile: But it's quiet thereā€¦

Hello, would it be possible to explain the steps you have done to make this working?
Including the installation of the pre-requisites.
I am trying to install it on raspberry PI and have the same Error ....

TypeError: require(...).getMac is not a function (line:30)
When installing the node-red-contrib-openzwave

I am stuck... heeeelp :slightly_smiling_face:

Post the full log you get from trying to install it from the command line, including the command itself.

Isn't it what I've done?

I meant @pvandenbulcke but if his/hers is exactly the same then no need. I notice that there is at least one issue against the node that may be relevant, have you looked through all the issues to check that? None of them seem to be getting much attention though so there may not be much help there.

@Colin

Hello, here is the installation output.
No errors but in when I go to the node-red pallete manager i see error * TypeError: require(...).getMac is not a function (line:30)

I also see 2 installed nodes in the pallete manager=:
1.2.4 node-red-contrib-openzwave

  • TypeError: require(...).getMac is not a function (line:30)

node-red-contrib-openzwave-am
1.5.6

  • Type already registered
    then I see an error and the nodes are not visible in the designer

Before the installation neither node-red-contrib-openzwave-am nor node-red-contrib-openzwave were installed.

This is the command I issued:

npm install node-red-contrib-openzwave-am

openzwave-shared@1.5.6 preinstall /home/pi/.node-red/node_modules/node-red-contrib-openzwave/node_modules/node-red-contrib-openzwave-am/node_modules/openzwave-shared
node lib/install-ozw.js

openzwave-shared@1.5.6 install /home/pi/.node-red/node_modules/node-red-contrib-openzwave/node_modules/node-red-contrib-openzwave-am/node_modules/openzwave-shared
node-gyp rebuild

make: Entering directory '/home/pi/.node-red/node_modules/node-red-contrib-openzwave/node_modules/node-red-contrib-openzwave-am/node_modules/openzwave-shared/build'
CXX(target) Release/obj.target/openzwave_shared/src/callbacks.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-config.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-driver.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-groups.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-management.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-network.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-nodes.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-polling.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-scenes.o
CXX(target) Release/obj.target/openzwave_shared/src/openzwave-values.o
CXX(target) Release/obj.target/openzwave_shared/src/utils.o
SOLINK_MODULE(target) Release/obj.target/openzwave_shared.node
COPY Release/openzwave_shared.node
make: Leaving directory '/home/pi/.node-red/node_modules/node-red-contrib-openzwave/node_modules/node-red-contrib-openzwave-am/node_modules/openzwave-shared/build'

  • node-red-contrib-openzwave-am@1.5.6
    added 5 packages from 85 contributors and audited 7 packages in 184.061s
    found 0 vulnerabilities

I have installed it using:
apt-get update && apt-get install -y libopenzwave1.5 libopenzwave1.5-dev

followed by node-red editor > manage palette > install: node-red-contrib-openzwave-am
Restarted node-red.

This is the second time libopenzwave1.5 is mentioned (other mention on my GitHub post linked above)
Here was my answer there:

I didn't found this anywhere on the documentation.
BTW, on the linked thread, you're saying "Or install it using the Node-Red Editor Palette" and this is exactly what I've done first.
Before, it was working. The only thing I remember having done in between, is uninstalling open-zwave from homebrew and installing it manually with git.
Also, libopenzwave-1.6.dylib (in /usr/local/lib/) is installed when make install open-zwave Git

So could it be a simple link to liboppenzwave which is missing somewhere?

I am not getting it (sorry not a unix pro)
I messed around to much and decided to do a complete reinstall of my raspberry pi and thus upgrading completly to latest version of raspbian

i installed node, node-red and then executed
apt-get update && apt-get install -y libopenzwave1.5 libopenzwave1.5-dev
as mentioned above and added the node-red-contrib-openzwave-am in the palette manager.
The difference now is in the palette manager I don't see any error (I said..Yes! problem fixed)
but no, when I start node-red I get the following in the console
26 Nov 21:41:01 - [info] Node-RED version: v1.0.3
26 Nov 21:41:01 - [info] Node.js version: v12.13.1
26 Nov 21:41:01 - [info] Linux 4.19.75-v7+ arm LE
26 Nov 21:41:03 - [info] Loading palette nodes
26 Nov 21:41:08 - [info] Dashboard version 2.18.0 started at /ui
26 Nov 21:41:10 - [warn] ------------------------------------------------------
26 Nov 21:41:1 - [warn] [node-red-contrib-openzwave-am/zwave] TypeError: require(...).getMac is not a function (line:30)
26 Nov 21:41:10 - [warn] ------------------------------------------------------
26 Nov 21:41:10 - [info] Settings file : /home/pi/.node-red/settings.js
26 Nov 21:41:10 - [info] Context store : 'default' [module=memory]
26 Nov 21:41:10 - [info] User directory : /home/pi/.node-red
26 Nov 21:41:10 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Nov 21:41:10 - [info] Flows file : /home/pi/.node-red/flows_domotica.json
26 Nov 21:41:10 - [info] Server now running at http://127.0.0.1:1880/
26 Nov 21:41:10 - [warn]

back to square one

Well th epackage.json is here - https://github.com/appmodule/node-red-contrib-openzwave-am/blob/master/package.json
and does seem to include a package called getmac - but it's asking for version >1 and the latest is 4. which may well have changed a lot and broken things. You may try contacting the author to see if he want to fix. Or you could try downgrading getmac to version 3 or 2 or 1 (which may be quite tricky).

Then again looking at the openzwave code it's asking for .getMac whereas the v4 code seems to expose .getMAC instead - so maybe try editing the 10-zwave.js code to that first.

Check out my issue on GitHub (linked above).
The problem will be soon take car off apparently!

meanwhile you can replace line 30 -34 with

var gm = require('getMac')
UUIDPREFIX = gm.default().replace(/:/gi, '')
1 Like

Did worked, thank you!

It should be this instead ('getmac' all in lower case):
var gm = require('getmac') UUIDPREFIX = gm.default().replace(/:/gi, '')

Sorry, it should be (add comma's):
var gm = require('getmac'); UUIDPREFIX = gm.default().replace(/:/gi, '');