Open leendersf opened 4 years ago
Hi, which command did you use to install the plugin?
I used node node_modules/nubli/examples/pair.js and I'm on Docker.
I mean the command to install the homebridge plugin. Something like npm install homebridge-nubli
.
What the output of:
ls -l node_modules/homebridge-nubli/node_modules/
I installed it through Homebridge -> plugins -> search -> install
npm install --save homebridge-nubli@latest
And I get this warning: npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
And a lot of other warnings but I am not fast enough to copy paste..
But the plugin is installed after this as it turns up as being installed.
I managed to get all the installation logs:
USER: root DIR: /homebridge CMD: npm install --save homebridge-nubli@latest
npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
usb@1.6.2 install /homebridge/node_modules/homebridge-nubli/node_modules/usb prebuild-install --verbose || node-gyp rebuild
prebuild-install info begin Prebuild-install version 5.3.3
prebuild-install info looking for cached prebuild @ /root/.npm/_prebuilds/e72387-usb-v1.6.2-node-v72-linuxmusl-arm.tar.gz
prebuild-install http request GET https://github.com/tessel/node-usb/releases/download/v1.6.2/usb-v1.6.2-node-v72-linuxmusl-arm.tar.gz
prebuild-install http 404 https://github.com/tessel/node-usb/releases/download/v1.6.2/usb-v1.6.2-node-v72-linuxmusl-arm.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.14.1 runtime=node arch=arm libc=musl platform=linux)
make: Entering directory '/homebridge/node_modules/homebridge-nubli/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
40 | #include ~~
compilation terminated.
make: *** [libusb.target.mk:146: Release/obj.target/libusb/libusb/libusb/os/linux_udev.o] Error 1
make: Leaving directory '/homebridge/node_modules/homebridge-nubli/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/local/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.97-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /homebridge/node_modules/homebridge-nubli/node_modules/usb
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
bluetooth-hci-socket@0.5.1 install /homebridge/node_modules/homebridge-nubli/node_modules/bluetooth-hci-socket node-gyp rebuild
make: Entering directory '/homebridge/node_modules/homebridge-nubli/node_modules/bluetooth-hci-socket/build'
CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker)':
../../nan/nan.h:2298: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]
2298 | , reinterpret_cast
In file included from /root/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /root/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/root/.cache/node-gyp/12.14.1/include/node/v8.h:5995:46: note: candidate: 'v8::MaybeLocal~~
/root/.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::Local
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:1045:46: note: declared here
1045 | NAN_DEPRECATED inline v8::Local~~~
../src/BluetoothHciSocket.cpp:251:95: warning: 'v8::Local
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:1045:46: note: declared here
1045 | NAN_DEPRECATED inline v8::Local~~~
../src/BluetoothHciSocket.cpp: In member function 'void BluetoothHciSocket::emitErrnoError()':
../src/BluetoothHciSocket.cpp:269:109: warning: 'v8::Local
In file included from /root/.cache/node-gyp/12.14.1/include/node/v8-internal.h:14,
from /root/.cache/node-gyp/12.14.1/include/node/v8.h:25,
from /root/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /root/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/root/.cache/node-gyp/12.14.1/include/node/v8.h:3457:51: note: declared here
3457 | V8_DEPRECATED("Use maybe version", Local~~~~~
../src/BluetoothHciSocket.cpp:275:72: error: no matching function for call to 'v8::Function::NewInstance(int, v8::Local
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:1045:46: note: declared here
1045 | NAN_DEPRECATED inline v8::Local~~~
../src/BluetoothHciSocket.cpp:282:93: warning: 'v8::Local
In file included from ../src/BluetoothHciSocket.cpp:8:
../../nan/nan.h:1045:46: note: declared here
1045 | NAN_DEPRECATED inline v8::Local ::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo ::Callback = void ( ::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo ::Callback = void (~~~
../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()'
395 | devId = arg0->IntegerValue();
| ^
In file included from /root/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /root/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/root/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: 'v8::Maybe~~~
/root/.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()'
417 | devId = arg0->IntegerValue();
| ^
In file included from /root/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /root/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/root/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: 'v8::Maybe~~~
/root/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate expects 1 argument, 0 provided
In file included from /root/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
../src/BluetoothHciSocket.cpp: At global scope:
/root/.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::Local~~~~
../src/BluetoothHciSocket.cpp:499:1: note: in expansion of macro 'NODE_MODULE'
499 | NODE_MODULE(binding, BluetoothHciSocket::Init);
| ^~~
In file included from /root/.cache/node-gyp/12.14.1/include/node/node.h:63,
from /root/.cache/node-gyp/12.14.1/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
/root/.cache/node-gyp/12.14.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase~~~~~~~
/root/.cache/node-gyp/12.14.1/include/node/v8.h: In instantiation of 'void v8::PersistentBasemake
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/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.97-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /homebridge/node_modules/homebridge-nubli/node_modules/bluetooth-hci-socket
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@~0.1.4 (node_modules/homebridge-nubli/node_modules/noble/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.6.2 (node_modules/homebridge-nubli/node_modules/usb):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.6.2 install: prebuild-install --verbose || node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bluetooth-hci-socket@0.5.1 (node_modules/homebridge-nubli/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
You are missing the libudev.h header file to compile the usb module.
You can install it with apt install libudev-dev
.
Then try to install the plugin again and it should hopefully succeed. The warning messages are fine, you can ignore them.
Hmm but then it says:
sudo apt install libudev-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libudev-dev is already the newest version (241-7~deb10u3+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Have you run this in the docker container?
Then is says:
/homebridge # apt install libudev-dev /bin/sh: apt: not found /homebridge # sudo apt install libudev-dev sudo: apt: command not found
Which docker image did you use? It may be Alpine Linux. You could try apk add eudev
I did apk add eudev
then reinstalled the plugin.
Then tried to pair inside the docker terminal:
/homebridge # node node_modules/nubli/examples/pair.js internal/modules/cjs/loader.js:796 throw err; ^
Error: Cannot find module '/homebridge/node_modules/nubli/examples/pair.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17) at Function.Module._load (internal/modules/cjs/loader.js:686:27) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11 { code: 'MODULE_NOT_FOUND', requireStack: []
Restarting homebridge says: [3/18/2020, 8:54:47 PM] ERROR LOADING PLUGIN homebridge-nubli: [3/18/2020, 8:54:47 PM] Error: Cannot find module 'bluetooth-hci-socket' Require stack:
That's because the bluetooth module failed to build. I think it only builds on node 8. So you might need to run another homebridge instance in a docker container which uses a node 8 image.
Ref henry-spanka/nubli#2
Ooo.. to bad.. :-(
But thank you very much for your efforts Henry!!
Hello,
I have installed the plugin but when I try to pair it gives this error:
node node_modules/nubli/examples/pair.js internal/modules/cjs/loader.js:985 throw err; ^
Error: Cannot find module '/home/pi/homebridge/node_modules/nubli/examples/pair.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15) at Function.Module._load (internal/modules/cjs/loader.js:864:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
What can I do? Thank you in advance!