beele / homebridge-unifi-protect-camera-motion

Camera & Motion sensor support for Unifi Protect cameras in Homekit via Homebridge
Apache License 2.0
103 stars 12 forks source link

Unable to load plugin after update #66

Closed alezanott closed 4 years ago

alezanott commented 4 years ago

I'm running the plugin on HOOBS. I've also run the command npm rebuild @tensorflow/tfjs-node build-addon-from-source to rebuild Tensorflow, but nothing changed. Any clue of what's going on @beele ? Here the output:

4/8/2020, 11:00:05 Error loading plugin "homebridge-unifi-protect-camera-motion".
4/8/2020, 11:00:05 Error: The Node.js native addon module (tfjs_binding.node) can not be found at path: /home/hoobs/.hoobs/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node. 
Please run command 'npm rebuild @tensorflow/tfjs-node build-addon-from-source' to rebuild the native addon module. 
If you have problem with building the addon module, please check https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md or file an issue.
    at Object.<anonymous> (/home/hoobs/.hoobs/node_modules/@tensorflow/tfjs-node/dist/index.js:49:11)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/hoobs/.hoobs/node_modules/homebridge-unifi-protect-camera-motion/src/motion/coco/coco.js:23:25)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
4/8/2020, 11:00:05 No plugins found.
4/8/2020, 11:00:05 The requested platform "UnifiProtectMotion" was not registered by any plugin.
4/8/2020, 11:00:05 Your config.json is requesting the platform "UnifiProtectMotion" which has not been published by any installed plugins.
4/8/2020, 11:00:05 Bridge is running on port 51826.
beele commented 4 years ago

Check: https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md and reinstall the plugin

alezanott commented 4 years ago

Check: https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md and reinstall the plugin

Thank you @beele. Reinstalling the plugin will also fix the registration problem?

beele commented 4 years ago

@alezanott the registration problem is because the plugin crashed due to the missing node bindings. Once that is resolved the platform registration should work fine during startup.

alezanott commented 4 years ago

@beele I've followed the guide on that link but basically it didn't brought to nothing. Is possible that on HOOBS not is not running with root privileges, so I get this kind of error? Here part of the log where I get errors (running node configuration in verbose mode)

gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.97-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure" "--verbose"
gyp ERR! cwd /home/hoobs/.hoobs/node_modules/@tensorflow/tfjs-node
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v7.1.0
gyp ERR! not ok 
beele commented 4 years ago

@alezanott can you try with the latest beta, login on hoobs, open a terminal and execute: sudo npm i homebridge-unifi-protect-camera-motion@0.4.2-beta.9 --unsafe-perm=true I've formatted a backup pi with hoobs and after some trial and error got it running (hopefully I did not break it for non hoobs installs :/)

alezanott commented 4 years ago

Thank you @beele. Now everything is working fine! When you will release the final version of 0.4.2 will HOOBS automatically update to the correct version or do I need to uninstall the beta and then reinstall the final one?

beele commented 4 years ago

@alezanott It should be fine, I've release 0.4.2, can you try updating to it and see if it still works?

beele commented 4 years ago

Closing due to inactivity