rooi / homebridge-lightwaverf

LightwaveRF plugin for HomeBridge
9 stars 7 forks source link

Issue with LightwaveRF plug in under Homebridge 1.3.0 / HOOBs #47

Closed AKWillows closed 3 years ago

AKWillows commented 3 years ago

Have been a very long time user of this plug in - it's the main reason for me using Homebridge! So thank you!

I use HOOBs and have recently updated to version 3.3.3. At the same time, I updated Node from 10.16.0 to 14.15.5. After doing so, the Homebridge service would not start. I have reached out to HOOBs support and, from the log file, they suggested I deleted the Lightwave RF plug in. I did so, and the Homebridge Service started successfully. HOOBS support suggest that the plug in may need updating to work with Homebridge versions > 1.3.0

Log file: 07/03/2021, 12:25:34 HOOBS listening on port 8080. 07/03/2021, 12:25:37 Initializing HAP-NodeJS v0.9.2... 07/03/2021, 12:25:41 Loaded plugin 'homebridge-automation-switches' 07/03/2021, 12:25:41 [07/03/2021, 12:25:41] Registering platform 'homebridge-automation-switches.AutomationSwitches' 07/03/2021, 12:25:42 Loaded plugin 'homebridge-camera-ffmpeg' 07/03/2021, 12:25:42 [07/03/2021, 12:25:42] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg' 07/03/2021, 12:25:43 Loaded plugin 'homebridge-http-switch' 07/03/2021, 12:25:43 [07/03/2021, 12:25:43] Registering accessory 'homebridge-http-switch.HTTP-SWITCH' 07/03/2021, 12:25:43 [07/03/2021, 12:25:43] The plugin "homebridge-hue" requires Node.js version of ^14.16.0 which does not satisfy the current Node.js version of v14.15.5. You may need to upgrade your installation of Node.js - see https://git.io/JTKEF 07/03/2021, 12:25:47 Loaded plugin 'homebridge-hue' 07/03/2021, 12:25:47 [07/03/2021, 12:25:47] Registering platform 'homebridge-hue.Hue' 07/03/2021, 12:25:47 ## There is an issue with node-fibers ## 07/03/2021, 12:25:47 /home/hoobs/.hoobs/node_modules/fibers/bin/linux-arm-83-glibc/fibers.node is missing. 07/03/2021, 12:25:47 Try running this to fix the issue: /usr/local/bin/node /home/hoobs/.hoobs/node_modules/fibers/build 07/03/2021, 12:25:47 Error: Cannot find module '/home/hoobs/.hoobs/node_modules/fibers/bin/linux-arm-83-glibc/fibers' 07/03/2021, 12:25:47 Require stack: 07/03/2021, 12:25:47 - /home/hoobs/.hoobs/node_modules/fibers/fibers.js 07/03/2021, 12:25:47 - /home/hoobs/.hoobs/node_modules/wait.for/waitfor.js 07/03/2021, 12:25:47 - /home/hoobs/.hoobs/node_modules/lightwaverf/index.js 07/03/2021, 12:25:47 - /home/hoobs/.hoobs/node_modules/homebridge-lightwaverf/index.js 07/03/2021, 12:25:47 - /usr/local/lib/node_modules/@hoobs/hoobs/node_modules/homebridge/lib/plugin.js 07/03/2021, 12:25:47 - /usr/local/lib/node_modules/@hoobs/hoobs/bridge/server.js 07/03/2021, 12:25:47 - /usr/local/lib/node_modules/@hoobs/hoobs/bridge/cli.js 07/03/2021, 12:25:47 - /usr/local/lib/node_modules/@hoobs/hoobs/bin/hoobs 07/03/2021, 12:25:47 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) 07/03/2021, 12:25:47 at Function.Module._load (internal/modules/cjs/loader.js:725:27) 07/03/2021, 12:25:47 at Module.require (internal/modules/cjs/loader.js:952:19) 07/03/2021, 12:25:47 at require (internal/modules/cjs/helpers.js:88:18) 07/03/2021, 12:25:47 at Object. (/home/hoobs/.hoobs/node_modules/fibers/fibers.js:14:39) 07/03/2021, 12:25:47 at Module._compile (internal/modules/cjs/loader.js:1063:30) 07/03/2021, 12:25:47 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) 07/03/2021, 12:25:47 at Module.load (internal/modules/cjs/loader.js:928:32) 07/03/2021, 12:25:47 at Function.Module._load (internal/modules/cjs/loader.js:769:14) 07/03/2021, 12:25:47 at Module.require (internal/modules/cjs/loader.js:952:19) 07/03/2021, 12:25:47 at require (internal/modules/cjs/helpers.js:88:18) 07/03/2021, 12:25:47 at Object. (/home/hoobs/.hoobs/node_modules/wait.for/waitfor.js:7:13) 07/03/2021, 12:25:47 at Module._compile (internal/modules/cjs/loader.js:1063:30) 07/03/2021, 12:25:47 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) 07/03/2021, 12:25:47 at Module.load (internal/modules/cjs/loader.js:928:32) 07/03/2021, 12:25:47 at Function.Module._load (internal/modules/cjs/loader.js:769:14) 07/03/2021, 12:25:47 Error loading plugin "homebridge-lightwaverf" 07/03/2021, 12:25:47 Error: Missing binary. See message above. at Object. (/home/hoobs/.hoobs/node_modules/fibers/fibers.js:23:9) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (/home/hoobs/.hoobs/node_modules/wait.for/waitfor.js:7:13) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (/home/hoobs/.hoobs/node_modules/lightwaverf/index.js:7:12) at Module._compile (internal/modules/cjs/loader.js:1063:30) 07/03/2021, 12:25:47 Loaded plugin 'homebridge-lightwaverf' 07/03/2021, 12:25:48 Loaded plugin 'homebridge-nest' 07/03/2021, 12:25:48 [07/03/2021, 12:25:48] Registering platform 'homebridge-nest.Nest' 07/03/2021, 12:25:48 Loaded plugin 'homebridge-nest-cam' 07/03/2021, 12:25:48 [07/03/2021, 12:25:48] Registering platform 'homebridge-nest-cam.Nest-cam' 07/03/2021, 12:25:48 Loading 6 platforms... 07/03/2021, 12:25:48 Error loading platform requested in your config.json at position 1 07/03/2021, 12:25:48 Error: No plugin was found for the platform "LightWaveRF" in your config.json. Please make sure the corresponding plugin is installed correctly.

AKWillows commented 3 years ago

Actually, it was working until I updated Node so could it be an issue with the latest version of Node rather than Homebridge? or both?!

rooi commented 3 years ago

Hi,

I just did a quick test on node 14.16.0 and homebridge v1.3.2 and everything seems to work correctly. Could it be that homebridge-lightwaverf just needs to be re-installed on the new nod version?

Could you try: sudo npm i homebridge-lightwaverf -g --unsafe-perm

Thanks!

Roy

AKWillows commented 3 years ago

Thanks for getting back to me. I’ll try that. The problem is, the act of removing and then reinstalling the plugin means that all the LightwaveRF devices disappear from HomeKit and, more importantly, from the automations, requiring everything to be set up again. Unless you know another way?

rooi commented 3 years ago

You should be able to backup your config.json file. I think this is done automatically with the homebridge-config-ui plugin.

I use a different homebridge for each plugin by the way. I'm not sure if this is still necessary, but when homebridge just started it was needed for performance reasons. It also helps to keep things somewhat cleaner

Either way, just look up the config.json file and use the same "name" for homebridge (perhaps also "username")

{ "bridge": { "name": "Homebridge-lightwaverf", "username": "CC:22:3D:XX:XX:XX", "port": xxx, "pin": "xx-xx-xxx" }, "accessories": [], "platforms": [ { "name": "Config", "port": xxx, "platform": "config", }, { "platform": "LightWaveRF", "name": "LightWaveRF", "ip_address": "xx.xx.xx.xx", "email": "mail@domain.com", "pin": "xxx" } ] }

AKWillows commented 3 years ago

Yes I did all that before... but for the period when the plug-in is deleted HomeKit removed all the devices. When the plug-in is reinstalled, they appear again in HomeKit, but in a default room and they don’t reappear in automations. Never mind.. I’ll give it a go! Thanks for your help.

rooi commented 3 years ago

The must be annoying. The rooms are generally quite easy, but restoring all automations could be significant work.

I don't understand why it would do this when just removing the plugin. I can understand when you reset your whole homebridge setup, and I think you need to backup/restore the persist and accessories folders in those cases, but it does not help for your case.

I'll try to look into the plugin this week. I noticed a minor warning that I'll try to fix and I'll try to look into why the setup is removed.

Let me know how it goes and if you need further help.

Roy

AKWillows commented 3 years ago

Thanks so much for your assistance

Andybishop commented 3 years ago

I had a similar issue when updating Ubuntu and node, ended up restoring my VM and having to change all my Lightwave devices from default room and setup automations again. I also noticed the Lightwave plugin no longer shows up when searching the Hoobs plug-in section.

AKWillows commented 3 years ago

Strange it no longer appears in the Hoobs plug ins list... so did you just install from the terminal prompt as mentioned above?

Andybishop commented 3 years ago

I ended up just restoring it from my Veeam backups, not looked into it much since. Just glad to have it back up and running and setup again. If I search plug-in's now it still doesn't show up.

Andybishop commented 3 years ago

think it might be Hoobs being screwy... if I search for homebridge-lightwaverf it shows... if I search lightwave, LightWaveRF or homebridge nothing shows..

AKWillows commented 3 years ago

That’s reassuring. Thanks.

rooi commented 3 years ago

Hi,

Unfortunately I could not reproduce the lost room and automation settings. This makes it difficult to try and fix it.

It does seem I've found the cause for the node-fibers error from your log. It seems to be caused by the node-lightwaverf dependency which included wait.for. It turns out this was not used, so I could easily remove it and everything kept working.

Reinstalling homebridge-lightwaverf should solve the problem. I did have some trouble with remnants from fibers that I had to lookup and remove, but this could be due to the development setup I'm using.

Could you uninstall homebridge-lightwaverf and verify that it is no longer present using: ls /usr/local/lib/node_modules/

Also check that LightwaveRF is removed. If it is there use: sudo npm uninstall -g node-lightwaverf

After everything is clean, you can reinstall using: sudo npm i homebridge-lightwaverf -g --unsafe-perm

Then verify that the following show no remnants of fibers ls /usr/local/lib/node_modules/homebridge-lightwaverf/node_modules

Could you then please check if the error is gone when (re)starting homebridge?

Thx!

EDIT: BTW I've change the node-lightwaverf sources, see: https://github.com/rooi/node-lightwaverf/commit/bf12951feb885ba9601f2ae9d99890b9a99bc91e

rooi commented 3 years ago

I just noticed a homebridge setting that help with disappearing LightwaveRF devices. Homebridge config uit -> Homebridge settings -> Keep accessories of uninstalled plugins Perhaps it works for your case as well

AKWillows commented 3 years ago

Ah brilliant. I will give it a go. Apologies that I’ve not had a chance this weekend to get the plug in deleted and reinstalled.

rooi commented 3 years ago

No problem. Just to let you know. I've improved a couple of other things and published v0.3.0. I'll try to get the plugin verified by homebridge.

AKWillows commented 3 years ago

I'm afraid I'm still struggling! I followed all the instructions you gave above, (although the uninstall commands I think should have been homebridge-lightwaverf rather than node-lightwaverf!). Updated Hoobs and Node and all the other plug ins.

When I use the install command you give above, it doesn't really work... the Lightwave RF plug in does not show up in Hoobs in the UI nor does it load when Hoobs is restarted. If I try to install using Hoobs, the only version it can find is the older one (not v0.3.0 or 0.3.1) so I'm back where I started - I tried installing that one just in case it got the recently updated version, but it doesn't. I'll reflash my SD from a backup I made to get me up and running again and will maybe wait until you have the plugin Hoobs certified :-(

rooi commented 3 years ago

Thanks for trying!

I am not sure how the hoobs plugins work, but it seems the plugins get updated only after some time. The statistics show pushed 2 days ago: https://plugins.hoobs.org I noticed weather plus also does not show the latest update on hoobs that was published 2 days ago on nom: https://plugins.hoobs.org/plugin/homebridge-weather-plus https://www.npmjs.com/package/homebridge-weather-plus

I think the new versions 0.3.1 will be shown on hoobs after the next update. I've removed all dependencies, so I'm confident that the intial problem should be solved. I understand it is quite a hassle. I'll monitor when the update is shown on hoobs, to understand that process as well and mention in in here. Hopefully you or someone else is able to give a test on hoobs to see if it has improved.

Thanks

rooi commented 3 years ago

I just noticed 0.3.1 is on hoobs

rooi commented 3 years ago

0.4.1 should solve any hoobs problems, if you still experience any issues. feel free to reopen this one or open a new one