Node-red-node-discovery

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.

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

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

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

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

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!

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)

Okay. Thank you.

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.

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?

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

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

Hi,
I've tried installing this node however it fails, apparently because the mdns package installation fails - see below. I'm running on RPi 3B+ , buster, node-red 1.0.3.

I'm trying to discover the IP addresses of my Goole Home devices from node-red.

Any assistance is most appreciated.


pi@raspberrypi:~ $ npm install mdns

usb@1.5.0 install /home/pi/node_modules/usb
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/tessel/node-usb/releases/download/1.5.0/usb_bindings-v1.5.0-node-v72-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for usb@1.5.0 and node@12.14.1 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/node_modules/usb/build'
CC(target) Release/obj.target/libusb/libusb/libusb/core.o
CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
CC(target) Release/obj.target/libusb/libusb/libusb/io.o
CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
../libusb/libusb/os/linux_udev.c:40:10: fatal error: libudev.h: No such file or directory
#include <libudev.h>
^~~~~~~~~~~
compilation terminated.
make: *** [libusb.target.mk:146: Release/obj.target/libusb/libusb/libusb/os/linux_udev.o] Error 1
make: Leaving directory '/home/pi/node_modules/usb/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:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.93-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/node_modules/usb/src/binding/usb_bindings.node" "--module_name=usb_bindings" "--module_path=/home/pi/node_modules/usb/src/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/pi/node_modules/usb
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/pi/node_modules/usb/src/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/pi/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:223:5)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Linux 4.19.93-v7+
node-pre-gyp ERR! command "/usr/bin/node" "/home/pi/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/node_modules/usb
node-pre-gyp ERR! node -v v12.14.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/pi/node_modules/usb/src/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)

bluetooth-hci-socket@0.5.1 install /home/pi/node_modules/bluetooth-hci-socket
node-gyp rebuild

make: Entering directory '/home/pi/node_modules/bluetooth-hci-socket/build'
CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
In file included from ../../nan/nan_converters.h:67,
from ../../nan/nan.h:222,
from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan_converters_43_inl.h: In static member function 'static Nan::imp::ToFactoryBasev8::Boolean::return_t Nan::imp::ToFactoryv8::Boolean::convert(v8::Localv8::Value)':
../../nan/nan_converters_43_inl.h:18:51: warning: 'v8::MaybeLocalv8::Boolean v8::Value::ToBoolean(v8::Localv8::Context) const' is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
val->To ## TYPE(isolate->GetCurrentContext())
^
../../nan/nan_converters_43_inl.h:22:1: note: in expansion of macro 'X'
X(Boolean)
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/v8-internal.h:14,
from /home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:25,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:2568:59: note: declared here
V8_WARN_UNUSED_RESULT MaybeLocal ToBoolean(
^~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro 'V8_DEPRECATED'
declarator attribute((deprecated(message)))
^~~~~~~~~~
In file included from ../../nan/nan_converters.h:67,
from ../../nan/nan.h:222,
from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan_converters_43_inl.h: In static member function 'static Nan::imp::ValueFactoryBase::return_t Nan::imp::ToFactory::convert(v8::Localv8::Value)':
../../nan/nan_converters_43_inl.h:37:57: warning: 'v8::Maybe v8::Value::BooleanValue(v8::Localv8::Context) const' is deprecated: BooleanValue can never throw. Use Isolate version. [-Wdeprecated-declarations]
return val->NAME ## Value(isolate->GetCurrentContext());
^
../../nan/nan_converters_43_inl.h:40:1: note: in expansion of macro 'X'
X(bool, Boolean)
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/v8-internal.h:14,
from /home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:25,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:2606:51: note: declared here
V8_WARN_UNUSED_RESULT Maybe BooleanValue(
^~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro 'V8_DEPRECATED'
declarator attribute((deprecated(message)))
^~~~~~~~~~
In file included from ../../nan/nan_new.h:189,
from ../../nan/nan.h:223,
from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan_implementation_12_inl.h: In static member function 'static Nan::imp::FactoryBasev8::StringObject::return_t Nan::imp::Factoryv8::StringObject::New(v8::Localv8::String)':
../../nan/nan_implementation_12_inl.h:356:37: error: no matching function for call to 'v8::StringObject::New(v8::Localv8::String&)'
return v8::StringObject::New(value).Asv8::StringObject();
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:5426:23: note: candidate: 'static v8::Localv8::Value v8::StringObject::New(v8::Isolate*, v8::Localv8::String)'
static Local New(Isolate* isolate, Local value);
^~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:5426:23: note: candidate expects 2 arguments, 1 provided
In file included from ../../nan/nan_new.h:189,
from ../../nan/nan.h:223,
from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan_implementation_12_inl.h:356:58: error: expected primary-expression before '>' token
return v8::StringObject::New(value).Asv8::StringObject();
^
../../nan/nan_implementation_12_inl.h:356:60: error: expected primary-expression before ')' token
return v8::StringObject::New(value).Asv8::StringObject();
^
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
../../nan/nan.h:2232:62: warning: cast between incompatible function types from 'void ()(uv_work_t)' {aka 'void ()(uv_work_s)'} to 'uv_after_work_cb' {aka 'void ()(uv_work_s, int)'} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
In file included from /usr/include/c++/8/cassert:44,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_object_wrap.h:26,
from ../../nan/nan.h:55,
from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan_object_wrap.h: In destructor 'virtual Nan::ObjectWrap::~ObjectWrap()':
../../nan/nan_object_wrap.h:24:25: error: 'class Nan::Persistentv8::Object' has no member named 'IsNearDeath'
assert(persistent().IsNearDeath());
^~~~~~~~~~~
../../nan/nan_object_wrap.h: In static member function 'static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfoNan::ObjectWrap&)':
../../nan/nan_object_wrap.h:127:26: error: 'class Nan::Persistentv8::Object' has no member named 'IsNearDeath'
assert(wrap->handle_.IsNearDeath());
^~~~~~~~~~~
../src/BluetoothHciSocket.cpp: In static member function 'static void BluetoothHciSocket::Init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)':
../src/BluetoothHciSocket.cpp:128:82: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
target->Set(Nan::New("BluetoothHciSocket").ToLocalChecked(), tmpl->GetFunction());
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:5995:46: note: candidate: 'v8::MaybeLocalv8::Function v8::FunctionTemplate::GetFunction(v8::Localv8::Context)'
V8_WARN_UNUSED_RESULT MaybeLocal GetFunction(
^~~~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:5995:46: note: candidate expects 1 argument, 0 provided
../src/BluetoothHciSocket.cpp: In member function 'void BluetoothHciSocket::poll()':
../src/BluetoothHciSocket.cpp:251:95: warning: 'v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value*)' is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(Nan::New(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
^
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:980:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../src/BluetoothHciSocket.cpp:251:95: warning: 'v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value*)' is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(Nan::New(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
^
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:980:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../src/BluetoothHciSocket.cpp: In member function 'void BluetoothHciSocket::emitErrnoError()':
../src/BluetoothHciSocket.cpp:269:109: warning: 'v8::Localv8::Value v8::Object::Get(v8::Localv8::Value)' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local errorConstructor = Local::Cast(globalObj->Get(Nan::New("Error").ToLocalChecked()));
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/v8-internal.h:14,
from /home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:25,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:3457:51: note: declared here
V8_DEPRECATED("Use maybe version", Local Get(Local key));
^~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro 'V8_DEPRECATED'
declarator attribute((deprecated(message)))
^~~~~~~~~~
../src/BluetoothHciSocket.cpp:275:72: error: no matching function for call to 'v8::Function::NewInstance(int, v8::Localv8::Value [1])'
Local error = errorConstructor->NewInstance(1, constructorArgs);
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:4176:44: note: candidate: 'v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context, int, v8::Localv8::Value) const'
V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(
^~~~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:4176:44: note: candidate expects 3 arguments, 2 provided
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:4179:44: note: candidate: 'v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context) const'
V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(
^~~~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:4179:44: note: candidate expects 1 argument, 2 provided
../src/BluetoothHciSocket.cpp:282:93: warning: 'v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value
)' is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(Nan::New(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
^
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:980:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../src/BluetoothHciSocket.cpp:282:93: warning: 'v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value*)' is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(Nan::New(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
^
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:980:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../src/BluetoothHciSocket.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindRaw(Nan::NAN_METHOD_ARGS_TYPE)':
../src/BluetoothHciSocket.cpp:395:34: error: no matching function for call to 'v8::Value::IntegerValue()'
devId = arg0->IntegerValue();
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: 'v8::Maybe v8::Value::IntegerValue(v8::Localv8::Context) const'
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate expects 1 argument, 0 provided
../src/BluetoothHciSocket.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindUser(Nan::NAN_METHOD_ARGS_TYPE)':
../src/BluetoothHciSocket.cpp:417:34: error: no matching function for call to 'v8::Value::IntegerValue()'
devId = arg0->IntegerValue();
^
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: 'v8::Maybe v8::Value::IntegerValue(v8::Localv8::Context) const'
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate expects 1 argument, 0 provided
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
../src/BluetoothHciSocket.cpp: At global scope:
/home/pi/.cache/node-gyp/12.14.1/include/node/node.h:560:43: warning: cast between incompatible function types from 'void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void ()(v8::Localv8::Object)'} to 'node::addon_register_func' {aka 'void ()(v8::Localv8::Object, v8::Localv8::Value, void)'} [-Wcast-function-type]
(node::addon_register_func) (regfunc),
^
/home/pi/.cache/node-gyp/12.14.1/include/node/node.h:594:3: note: in expansion of macro 'NODE_MODULE_X'
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/BluetoothHciSocket.cpp:499:1: note: in expansion of macro 'NODE_MODULE'
NODE_MODULE(binding, BluetoothHciSocket::Init);
^~~~~~~~~~~
In file included from /home/pi/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&)]':
/home/pi/.cache/node-gyp/12.14.1/include/node/node_object_wrap.h:84:78: required from here
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfonode::ObjectWrap::Callback' {aka 'void (
)(const v8::WeakCallbackInfonode::ObjectWrap&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo&)'} [-Wcast-function-type]
reinterpret_cast(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]':
../../nan/nan_object_wrap.h:66:61: required from here
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfoNan::ObjectWrap::Callback' {aka 'void (
)(const v8::WeakCallbackInfoNan::ObjectWrap&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo&)'} [-Wcast-function-type]
make: *** [binding.target.mk:107: Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1
make: Leaving directory '/home/pi/node_modules/bluetooth-hci-socket/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:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.93-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/pi/node_modules/bluetooth-hci-socket
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

mdns@2.5.1 install /home/pi/node_modules/mdns
node-gyp rebuild

make: Entering directory '/home/pi/node_modules/mdns/build'
CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
In file included from ../src/dns_sd.cpp:1:
../src/mdns.hpp:32:10: fatal error: dns_sd.h: No such file or directory
#include <dns_sd.h>
^~~~~~~~~~
compilation terminated.
make: *** [dns_sd_bindings.target.mk:174: Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1
make: Leaving directory '/home/pi/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:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.93-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/pi/node_modules/mdns
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@0.1.4 (node_modules/xpc-connection):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for xpc-connection@0.1.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.5.0 (node_modules/usb):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.5.0 install: node-pre-gyp install --fallback-to-build
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bluetooth-hci-socket@0.5.1 (node_modules/bluetooth-hci-socket):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bluetooth-hci-socket@0.5.1 install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mdns@2.5.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mdns@2.5.1 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/pi/.npm/_logs/2020-02-04T15_07_08_472Z-debug.log

Did you install the prerequisites? https://flows.nodered.org/node/node-red-node-discovery

Yes, they installed without issue.

pi@raspberrypi:~ $ sudo apt-get install libavahi-compat-libdnssd-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libavahi-compat-libdnssd-dev is already the newest version (0.7-4+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Looks like you might need to install libudev-dev too.

Many thanks Colin, that worked !. my coding skills are very limited.

Perhaps dceejay could update the installation prequisites in npm.

One other thing - I expected the discovery node to have a configurable polling interval, however it appears to run just once. Maybe it only responds to announcements ?
Am I missing something ?

Answering my own question - the discovery node responds only to changes in service state, I depowered and repowered a google home unit and the discovery node sent two corresponding messages. :+1:

Noted - will add to pre-reqs. thanks

1 Like