AlexGustafsson / homebridge-wol

A Wake on Lan plugin for Homebridge
MIT License
301 stars 30 forks source link

Homebridge will not start after installing the latest homebridge-wol update #87

Closed simonlock closed 4 years ago

simonlock commented 4 years ago

Backstory

Hi Alex I'm using your plugin with Homebridge and also Nodered and everything was working well when I pressed the buttons within the Apple Home App, I could successfully shut down my win10 pc and also wake it up using WoL.

Issue

However, I have just installed your update today and now Homebridge will not start unless I first remove my existing config homebridge-wol config.

Environment

os & os version: FreeNAS-11.2-U7 in a FreeBSD jail. node version: Node.js v13.3.0 homebridge version: Version 0.4.50 homebridge-wol version: homebridge-wol v4.0.0 Configuration My configuration looks like this:

{ "accessory": "NetworkDevice", "name": "simon-pc", "mac": "", "broadcastAddress": "172.16.28.254", "wakeGraceTime": 20, "shutdownGraceTime": 20, "ip": "172.16.28.6", "shutdownCommand": "ssh simon@simon-pc shutdown /s /f /t 0" },

Notes

Everything was working until I installed the latest homebridge-wol update.

AlexGustafsson commented 4 years ago

Could you paste the entire log given when you try to start homebridge?

simonlock commented 4 years ago

Hi Alex I'm running homebridge using pm2 and I'm struggling to discover how to integrate pm2 logs into the homebridge UI. However, I'm sure what I've pasted below is what you requested:

0|homebridge | [1/9/2020, 1:28:47 PM] ==================== 0|homebridge | [1/9/2020, 1:28:47 PM] ERROR LOADING PLUGIN homebridge-wol: 0|homebridge | [1/9/2020, 1:28:47 PM] /usr/local/lib/node_modules/homebridge-wol/lib/network-device.js:49 0|homebridge | ...config 0|homebridge | ^^^ 0|homebridge | SyntaxError: Unexpected token '...' 0|homebridge | at wrapSafe (internal/modules/cjs/loader.js:1050:16) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1098:27) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Module.require (internal/modules/cjs/loader.js:1023:19) 0|homebridge | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39) 0|homebridge | at require (internal/modules/cjs/helpers.js:72:18) 0|homebridge | at Object. (/usr/local/lib/node_modules/homebridge-wol/index.js:1:26) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1128:30) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Module.require (internal/modules/cjs/loader.js:1023:19) 0|homebridge | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39) 0|homebridge | at require (internal/modules/cjs/helpers.js:72:18) 0|homebridge | at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:72:23) 0|homebridge | at Server. (/usr/local/lib/node_modules/homebridge/lib/server.js:153:14) 0|homebridge | at Array.forEach () 0|homebridge | at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:145:22) 0|homebridge | at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:57:24) 0|homebridge | at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:32:16) 0|homebridge | at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1128:30) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Object. (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:27:21) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1128:30) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) 0|homebridge | at internal/main/run_main_module.js:17:47 0|homebridge | [1/9/2020, 1:28:47 PM] ====================

qiestuhl commented 4 years ago

Hi Alex I'm running homebridge using pm2 and I'm struggling to discover how to integrate pm2 logs into the homebridge UI. However, I'm sure what I've pasted below is what you requested:

0|homebridge | [1/9/2020, 1:28:47 PM] ==================== 0|homebridge | [1/9/2020, 1:28:47 PM] ERROR LOADING PLUGIN homebridge-wol: 0|homebridge | [1/9/2020, 1:28:47 PM] /usr/local/lib/node_modules/homebridge-wol/lib/network-device.js:49 0|homebridge | ...config 0|homebridge | ^^^ 0|homebridge | SyntaxError: Unexpected token '...' 0|homebridge | at wrapSafe (internal/modules/cjs/loader.js:1050:16) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1098:27) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Module.require (internal/modules/cjs/loader.js:1023:19) 0|homebridge | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39) 0|homebridge | at require (internal/modules/cjs/helpers.js:72:18) 0|homebridge | at Object. (/usr/local/lib/node_modules/homebridge-wol/index.js:1:26) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1128:30) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Module.require (internal/modules/cjs/loader.js:1023:19) 0|homebridge | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39) 0|homebridge | at require (internal/modules/cjs/helpers.js:72:18) 0|homebridge | at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:72:23) 0|homebridge | at Server. (/usr/local/lib/node_modules/homebridge/lib/server.js:153:14) 0|homebridge | at Array.forEach () 0|homebridge | at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:145:22) 0|homebridge | at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:57:24) 0|homebridge | at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:32:16) 0|homebridge | at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1128:30) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Object. (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:27:21) 0|homebridge | at Module._compile (internal/modules/cjs/loader.js:1128:30) 0|homebridge | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) 0|homebridge | at Module.load (internal/modules/cjs/loader.js:983:32) 0|homebridge | at Function.Module._load (internal/modules/cjs/loader.js:891:14) 0|homebridge | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) 0|homebridge | at internal/main/run_main_module.js:17:47 0|homebridge | [1/9/2020, 1:28:47 PM] ====================

Same here

AlexGustafsson commented 4 years ago

Thank you for the log. The issue has been identified and fixed in 4.1.2. If you face further issues, please open up a new issue!