dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.19k stars 159 forks source link

Homebridge-ring v9.12.3 and v9.12.4 plugin doesn't load #495

Closed ronzelver closed 3 years ago

ronzelver commented 3 years ago

Bug Report

Describe the Bug

The plugin doesn't load, resulting in a restart loop of Homebridge ### To Reproduce Steps to reproduce the behavior: - Start Homebridge - Attempt to ... - See error ### Expected behavior Just load and work ### Screenshots/Logs The logging shows: [11/13/2020, 16:36:28] ERROR LOADING PLUGIN homebridge-ring: [11/13/2020, 16:36:28] Error: Cannot find module 'socket.io-client' Require stack: - /usr/lib/node_modules/homebridge-ring/lib/api/location.js - /usr/lib/node_modules/homebridge-ring/lib/api/api.js - /usr/lib/node_modules/homebridge-ring/lib/api/index.js - /usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js - /usr/lib/node_modules/homebridge-ring/lib/homebridge/index.js - /usr/lib/node_modules/homebridge/lib/plugin.js - /usr/lib/node_modules/homebridge/lib/pluginManager.js - /usr/lib/node_modules/homebridge/lib/api.js - /usr/lib/node_modules/homebridge/lib/server.js - /usr/lib/node_modules/homebridge/lib/cli.js - /usr/lib/node_modules/homebridge/bin/homebridge at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15) at Function.Module._load (internal/modules/cjs/loader.js:864:27) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (/usr/lib/node_modules/homebridge-ring/lib/api/location.js:13:28) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (/usr/lib/node_modules/homebridge-ring/lib/api/api.js:14:20) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (/usr/lib/node_modules/homebridge-ring/lib/api/index.js:13:14) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (/usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:13:15) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) ### Additional context Since I've upgraded this plugin through the UI, the above error remains, even after re-installing v9.12.2 . So my Homebridge is dead now?!? ### Homebridge Ring Config Post homebridge-ring platform config _without sensitive information_ ``` { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:32", "port": 51826, "pin": "031-45-154" }, "description": "This is the configuration file of Ron Lemmens", "accessories": [ { "accessory": "NefitEasy", "name": "thermostaat", "authentication": { "serialNumber": "xxx", "accessKey": "xxx", "password": "xxx" } }, { "name": "Airco Zolder", "apiroute": "http://192.168.1.27", "system": "Default", "swingMode": "1", "disableFan": true, "fanMode": "FAN", "fanName": "Livingroom FAN", "defaultMode": "3", "response": 2000, "deadline": 60000, "retries": 5, "accessory": "Daikin-Local" }, { "accessory": "homebridge-rpitemp.RpiTemp", "name": "RPi CPU Temp", "tempid": "cpu" } ], "platforms": [ { "name": "Config", "port": 8080, "auth": "form", "theme": "dark-mode", "restart": "sudo -n systemctl restart homebridge", "temp": "/sys/class/thermal/thermal_zone0/temp", "tempUnits": "c", "sudo": true, "log": { "method": "systemd", "service": "homebridge" }, "platform": "config" }, { "platform": "LifxLan", "name": "Lifx", "broadcast": "192.168.1.255" }, { "platform": "HomeWizard", "url": "http://192.168.1.10", "password": "xxx", "filtered": [], "debug": false, "heatlinks": 0, "switchTypes": { "Ventilator badk": "fan", "Ventilator zldr": "fan", "Spiegel badk": "switch", "Preset hal": "switch", "Preset voor": "switch", "Preset achter": "switch" }, "createPresetSwitches": true, "presetNames": { "home": "Home Preset", "away": "Away Preset", "sleep": "Sleep Preset", "holiday": "Holiday Preset" }, "createSceneSwitches": false }, { "platform": "FoscamCamera", "name": "Foscam Woonkamer", "cameras": [ { "username": "xxx", "password": "xxx", "host": "192.168.1.14", "port": "88", "stay": "0", "away": "8", "night": "4", "armPreset": "Hal", "disarmPreset": "Eetkamer", "sensitivity": 2, "triggerInterval": 5, "videoConfig": { "source": "-re -i rtsp://xxx@192.168.1.14:88/videoSub", "stillImageSource": "-i http://192.168.1.14:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=xxx&pwd=xxx", "maxStreams": 2, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 30 } } ] }, { "platform": "BroadlinkRM", "name": "Broadlink RM", "accessories": [ { "name": "Ventilator lamp", "type": "light", "persistState": true, "data": { "on": "26009a00271127100c2b0c2b0d2a0c2b0c2b0c2b0c2b0c2b0c2b0c000107280f27100c2b0c2b0c2b271028102610280f2710271027ec280f27100d2a0c2b0c2b0d2a0d2a0c2b28100a2c0d2a0d0001062710280e0e2a0d2a0e290e290d2a0d2a28100c2a0d2a0d000106270e29100d2b0c2b0c2b0c2b0c2b0c2b270e0d2c0c2b0d000106271027110a2c0c2b0c2b0c2b0c2b0c2b27110b2b0c2b0c000d050000000000000000000000000000", "off": "2600ce00271027110b2b0d2a0d2a0c2b0c2b0c2b0e290d2a0c2b0d000106271027100d2a0d2a0e29271027102710280f2710271027ec271027100d2a0d2a0d2a0d2a0d2a0d2a280f0d2a0d2a0d0001062711260e0e2b0d2a0d2a0d2a0d2a0d2a27100d2a0e290d000106280e29100b2b0d2a0d2a0d2a0d2a0d2a270c102b0d2a0d000106271027110b2b0d2a0d2a0d2a0d2a0d2a27110c2a0d2a0d000106280e28110b2c0c2b0c2b0c2b0c2b0c2b27100c2b0c2b0d000106261127100c2b0c2b0d2a0c2b0c2b0d2a27100c2b0c2b0c000d0500000000000000000000" } }, { "name": "Ventilator", "type": "fan", "persistState": true, "hideSwingMode": true, "hideRotationDirection": true, "data": { "on": "2600c400280f27100b2c0c2b0b2c0d2a0c2b0c2b0c2b0c2b0c2b0b000108281026100c2b0b2c0c2c270f2710271126102710271126ec280f280f0c2b0b2c0b2c2810092d0d2a0c2b0c2b271126ec280f27100d2a0d2b092d27110a2c0d2a0d2a0d2a281026ec281027100c2b0c2b0c2a27110c2b0c2b0c2b0c2b271125ed261127100c2b0c2b0c2b27100c2b0b2c0d2a0c2b271027ec271027100c2b0c2b0b2c27100b2c0b2c0c2b0c2b271028eb270e29110a2c0c2b0c2b280f0c2b0c2b0c2b0c2b271027000d0500000000", "off": "26000201280f280f0c2b0c2b0c2b0c2b0c2b0c2b0c2b0c2b0c2b0d0001062710270e0d2c0c2b0c2b27102710280f280c2a10281026ea291027100c2b0d2a0d2a0d2a0c2b27100d2a0d2a0c2b0c000107271027100d2a0c2b0d2a0d2a0c2b27100d2a0c2b0d2a0c000107281025110d2a0d2a0d2a0d2a0c2b280f0d2a0d2a0d2a0d0001062710280f0d2a0d2a0d2a0d2a0d2a280f0d2a0d2a0d2a0d000106271027100d2a0d2a0d2a0d2a0d2a280f0d2a0d2a0d2a0d000106281026100d2a0d2a0d2a0d2a0d2a27100d2a0d2a0d2a0d000106271127100c2a0d2a0d2a0d2a0d2a27100d2a0d2a0d2a0d000106271126110c2b0c2a0d2b0c2b0c2b26110b2c0c2b0c2b0c000d05000000000000", "fanspeed30": "2600c400280f27100b2c0c2b0b2c0d2a0c2b0c2b0c2b0c2b0c2b0b000108281026100c2b0b2c0c2c270f2710271126102710271126ec280f280f0c2b0b2c0b2c2810092d0d2a0c2b0c2b271126ec280f27100d2a0d2b092d27110a2c0d2a0d2a0d2a281026ec281027100c2b0c2b0c2a27110c2b0c2b0c2b0c2b271125ed261127100c2b0c2b0c2b27100c2b0b2c0d2a0c2b271027ec271027100c2b0c2b0b2c27100b2c0b2c0c2b0c2b271028eb270e29110a2c0c2b0c2b280f0c2b0c2b0c2b0c2b271027000d0500000000", "fanspeed60": "2600ce00271027100c2b0c2b0c2b0c2b0c2b0c2b0c2b0c2b0c2b0c0001072710280f0c2b0b2c0c2b271028102610280f2711261027ec271028100a2c0c2b0c2b0c2b0d2a0c2b0c2b280f0d2a0d000106280c2b10092d0d2a0d2a0e290d2a0d2a0c2b27110d290d000106271027110c2b0c2b0c2b0c2b0c2b0c2b0c2b26110c2b0c00010727102711082e0c2b0c2b0c2b0c2b0b2c0c2b2711082e0c000107271126100c2b0c2b0c2b0c2b0c2b0c2b0c2b280f0c2b0c000107271127100a2c0c2b0c2b0c2b0c2b0c2b0c2b27100c2b0c000d0500000000000000000000", "fanspeed100": "2600f400280f2810092d0c2b0c2b0c2b0c2b0c2b0d2a0d2a0c2b0d000106271126100d2a0c2b0d2a271027102810260c2b10280f28eb28102611092d0d2a0d2a0d2a0d2a0d2a0d2a0d2a0d2a27ed26122710082e0c2b0b2c0c2b0c2b0b2c0c2b0c2b0c2b26ed280f27100c2b0c2b0b2c0c2b0b2c0b2c0c2b0b2c0c2b27ec2710280f0b2c0b2c0c2b0c2b0c2b0b2c0c2b0c2b0c2b27ec271027100b2c0b2c0d2a0c2b0c2b0c2b0d2a0d2a0c2b27ec281026100d2a0d2a0c2b0d2a0e290d2a0d2a0e290d2a28eb271028100c2a0d2b0c2b0c2b0c2b0c2b0b2c0c2b0c2b26ed271126110a2c0c2b0c2b0c2b0c2b0c2b0c2b0c2b0c2b27000d0500000000" } } ] }, { "platform": "Nut", "name": "UPS", "host": "192.168.1.1", "port": "3493", "search_time_delay": "1", "acc_delay": "100", "low_batt_threshold": "40", "polling": "120" }, { "refreshToken": "xxx", "platform": "Ring" } ] } ``` ### Environment
  • OS: Raspbian
  • Node.js: [e.g. 12.14.1] v12.16.1
  • NPM: [e.g 6.13.4] 6.14.8
  • homebridge-ring: 9.12.3 / 9.12.4
  • homebridge: 0.4.5
  • hoobs: [e.g. 0.4.50 or N/A] N/A
dgreif commented 3 years ago

This should definitely work with 9.12.4. Try clearing your npm cache if trying it again doesn't work.

ronzelver commented 3 years ago

I've cleared the cache and now it gives the following error in the log:

[11/13/2020, 17:11:20] Error: The requested platform 'Ring' was not registered by any plugin. at PluginManager.getPluginForPlatform (/usr/lib/node_modules/homebridge/lib/pluginManager.js:152:23) at /usr/lib/node_modules/homebridge/lib/server.js:271:45 at Array.forEach (:null:null) at Server.loadPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:260:31) at Server.start (/usr/lib/node_modules/homebridge/lib/server.js:73:35) at cli (/usr/lib/node_modules/homebridge/lib/cli.js:88:12) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47

I've already uninstalled the plugin and re-installed it, but no success.

dgreif commented 3 years ago

That message will show up in logs that also contain the original error you posted. I've had multiple users confirm that 9.12.4 works, so I'm confident this is an issue with your npm setup. Try sudo npm i -g --unsafe-perm homebridge-ring@9.12.4

ronzelver commented 3 years ago

Sorry for the confusion, the last error was indeed also present in the initial log. However, after re-installing 9.12.4 with the command above it still comes with the 'socket.io-client' error. Is there anything else I can do?

dgreif commented 3 years ago

npm uninstall -g homebridge-ring npm cache clean --force sudo npm i -g --unsafe-perm homebridge-ring@9.12.4

ronzelver commented 3 years ago

socket error stays

ronzelver commented 3 years ago

Problem solved, I forced the Homebridge-UI-X to reload and there it still showed v9.12.3 so I re-launched the update from the UI and now it loads correctly.