Node-red-node-discovery

#1

Anyone using node-red-node-discovery? I wasn't able to install it on my Debian Pi system. Got all sorts of errors I don't understand. The docs mentioned a dependency that I needed, and that installed just fine.

0 Likes

#2

Please share the errors you got otherwise there's not much we can help with.

0 Likes

#3

This is what I got when I tried to install from the command line:

npm i node-red-node-discovery

mdns@2.3.4 install /home/fabnav/.node-red/node_modules/mdns
node-gyp rebuild

make: Entering directory '/home/fabnav/.node-red/node_modules/mdns/build'
CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
In file included from ../node_modules/nan/nan.h:190:0,
from ../src/mdns.hpp:12,
from ../src/dns_sd.cpp:1:
../node_modules/nan/nan_maybe_43_inl.h: In function 'Nan::Maybe Nan::ForceSet(v8::Localv8::Object, v8::Localv8::Value, v8::Localv8::Value, v8::PropertyAttribute)':
../node_modules/nan/nan_maybe_43_inl.h:88:15: error: 'class v8::Object' has no member named 'ForceSet'
return obj->ForceSet(GetCurrentContext(), key, value, attribs);
^~~~~~~~
In file included from ../src/mdns.hpp:12:0,
from ../src/dns_sd.cpp:1:
../node_modules/nan/nan.h: In function 'v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)':
../node_modules/nan/nan.h:817:60: warning: 'v8::Localv8::Value node::MakeCallback(v8::Isolate
, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, func, argc, argv);
^
In file included from ../src/mdns.hpp:11:0,
from ../src/dns_sd.cpp:1:
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:177:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:91:42: note: in definition of macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^~~~~~~~~~
In file included from ../src/mdns.hpp:12:0,
from ../src/dns_sd.cpp:1:
../node_modules/nan/nan.h: In function 'v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value
)':
../node_modules/nan/nan.h:831:62: warning: 'v8::Localv8::Value node::MakeCallback(v8::Isolate*, v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value)' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, symbol, argc, argv);
^
In file included from ../src/mdns.hpp:11:0,
from ../src/dns_sd.cpp:1:
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:170:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:91:42: note: in definition of macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^~~~~~~~~~
In file included from ../src/mdns.hpp:12:0,
from ../src/dns_sd.cpp:1:
../node_modules/nan/nan.h: In function 'v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, const char
, int, v8::Localv8::Value)':
../node_modules/nan/nan.h:845:62: warning: 'v8::Localv8::Value node::MakeCallback(v8::Isolate
, v8::Localv8::Object, const char*, int, v8::Localv8::Value)' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, method, argc, argv);
^
In file included from ../src/mdns.hpp:11:0,
from ../src/dns_sd.cpp:1:
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:163:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:91:42: note: in definition of macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^~~~~~~~~~
In file included from ../src/mdns.hpp:12:0,
from ../src/dns_sd.cpp:1:
../node_modules/nan/nan.h: In member function 'v8::Localv8::Value Nan::Callback::Call_(v8::Isolate
, v8::Localv8::Object, int, v8::Localv8::Value) const':
../node_modules/nan/nan.h:1463:5: warning: 'v8::Localv8::Value node::MakeCallback(v8::Isolate
, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value*)' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
));
^
In file included from ../src/mdns.hpp:11:0,
from ../src/dns_sd.cpp:1:
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:177:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/fabnav/.node-gyp/10.15.1/include/node/node.h:91:42: note: in definition of macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^~~~~~~~~~
In file included from ../src/dns_sd.cpp:7:0:
../src/txt_record_ref.hpp: In static member function 'static bool node_mdns::TxtRecordRef::HasInstance(v8::Handlev8::Value)':
../src/txt_record_ref.hpp:18:60: warning: 'v8::Localv8::Object v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Localv8::Object object = value->ToObject();
^
In file included from /home/fabnav/.node-gyp/10.15.1/include/node/node.h:63:0,
from ../src/mdns.hpp:11,
from ../src/dns_sd.cpp:1:
/home/fabnav/.node-gyp/10.15.1/include/node/v8.h:10046:15: note: declared here
Local Value::ToObject() const {
^~~~~
../src/dns_sd.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE node_mdns::exportConstants(Nan::NAN_METHOD_ARGS_TYPE)':
../src/dns_sd.cpp:314:36: warning: 'v8::Localv8::Object v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
addConstants(info[0]->ToObject());
^
In file included from /home/fabnav/.node-gyp/10.15.1/include/node/node.h:63:0,
from ../src/mdns.hpp:11,
from ../src/dns_sd.cpp:1:
/home/fabnav/.node-gyp/10.15.1/include/node/v8.h:10046:15: note: declared here
Local Value::ToObject() const {
^~~~~
dns_sd_bindings.target.mk:159: recipe for target 'Release/obj.target/dns_sd_bindings/src/dns_sd.o' failed
make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1
make: Leaving directory '/home/fabnav/.node-red/node_modules/mdns/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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.14.79-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/fabnav/.node-red/node_modules/mdns
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.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! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mdns@2.3.4 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mdns@2.3.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/fabnav/.npm/_logs/2019-02-26T19_20_48_229Z-debug.log

0 Likes

#4

Looks as if the mdns package that the node relies on isn’t yet compatible with nodejs10

If there isn’t an issue open on the node you are trying to install github page I would suggest opening an issue there

0 Likes

#5

Hi - saw this...
I have bumped up the package version and it now seems to compile and install OK on node v10 as long as the pre-reqs are installed... (still loads of warnings but no errors) pushed to npm as version 0.0.21

0 Likes

#6

Thank you both for your help. I was able to install the node, and it seems to be working. It discovered the three systems that I wanted it to discover. Very cool! The discovery happened when I deployed. I don't see any way to trigger it to ever run again. Any chance there is a way to do that?

Also, I'm seeing a bunch of warnings on the console when NR starts up. Can anything be done about this?

*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
27 Feb 18:39:03 - [info] You may ignore the warning about Bonjour compatability.
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
0 Likes

#7

It reports any changes so doesn’t need to be triggered. You may need to save the state in context but that is up to you.
No, I don’t think there is a way to remove that warning without fixing the underlying code libraries. (which hasn’t happened in over 5 years)

0 Likes

#8

Okay. Thank you.

0 Likes

#9

I'm sitting here waiting... I have three systems that are normally discovered when I deploy. I powered down one system and deployed. Two systems were discovered as expected. Next I powered back up the third system. It's been several minutes and no new discovery message is being generated. How long should I have to wait?

I got tired of waiting. I re-deployed and all three systems were discovered. At this point I'm not in agreement with your statement about not needing to be triggered.

0 Likes

#10

I have a little more information on this. When only two of my systems are powered up, I see that the discovery node generated this error: Error: dns service error: unknown. I wonder if that error is preventing it from discovering anything new?

0 Likes

#11

when was that produced ? when the 3rd powered up (and should have been discovered) ? or ... ?

0 Likes

#12

It was produced when only two of the three systems were powered up.

0 Likes