Closed Richard0415 closed 7 years ago
Try this -
update home bridge-winkv2 (added a test folder) Open the Test folder and copy index.js Go to Homevridge-winkv2 > node_modiles > wink.js and paste index.js restart homebrdige
Thanks. Replaced the file and this is the output (still fails):
Jan 15 18:35:10 raspberrypi systemd[1]: Stopping Node.js HomeKit Server...
Jan 15 18:35:10 raspberrypi systemd[1]: Starting Node.js HomeKit Server...
Jan 15 18:35:11 raspberrypi systemd[1]: Started Node.js HomeKit Server.
Jan 15 18:35:11 raspberrypi homebridge[6120]: WARNING The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
Jan 15 18:35:11 raspberrypi nodejs[6120]: WARNING The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
Jan 15 18:35:11 raspberrypi nodejs[6120]: WARNING Please fix your application to use the native API of Avahi!
Jan 15 18:35:11 raspberrypi nodejs[6120]: WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
Jan 15 18:35:11 raspberrypi nodejs[6120]: WARNING The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
Jan 15 18:35:11 raspberrypi nodejs[6120]: WARNING Please fix your application to use the native API of Avahi!
Jan 15 18:35:11 raspberrypi nodejs[6120]: WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
Jan 15 18:35:11 raspberrypi homebridge[6120]: WARNING Please fix your application to use the native API of Avahi!
Jan 15 18:35:11 raspberrypi homebridge[6120]: WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
Jan 15 18:35:11 raspberrypi homebridge[6120]: WARNING The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
Jan 15 18:35:11 raspberrypi homebridge[6120]: WARNING Please fix your application to use the native API of Avahi!
Jan 15 18:35:11 raspberrypi homebridge[6120]: WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
Jan 15 18:35:14 raspberrypi homebridge[6120]: [1/15/2017, 6:35:14 PM] Loaded plugin: homebridge-chamberlain
Jan 15 18:35:14 raspberrypi homebridge[6120]: [1/15/2017, 6:35:14 PM] Registering accessory 'homebridge-chamberlain.Chamberlain'
Jan 15 18:35:14 raspberrypi homebridge[6120]: [1/15/2017, 6:35:14 PM] ---
Jan 15 18:35:15 raspberrypi homebridge[6120]: [1/15/2017, 6:35:15 PM] Loaded plugin: homebridge-denon
Jan 15 18:35:15 raspberrypi homebridge[6120]: [1/15/2017, 6:35:15 PM] Registering accessory 'homebridge-denon-marantz-avr.DenonMarantzAVR'
Jan 15 18:35:15 raspberrypi homebridge[6120]: [1/15/2017, 6:35:15 PM] ---
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] Loaded plugin: homebridge-nest
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] Registering platform 'homebridge-nest.Nest'
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] ---
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] Loaded plugin: homebridge-server
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] Registering platform 'homebridge-server.Server'
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] ---
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] ====================
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] ERROR LOADING PLUGIN homebridge-winkv2:
Jan 15 18:35:16 raspberrypi homebridge[6120]: [1/15/2017, 6:35:16 PM] /usr/lib/node_modules/homebridge-winkv2/node_modules/wink-js/index.js:5
Jan 15 18:35:16 raspberrypi homebridge[6120]: <!DOCTYPE html>
Jan 15 18:35:16 raspberrypi homebridge[6120]: ^
Jan 15 18:35:16 raspberrypi homebridge[6120]: SyntaxError: Unexpected token <
Jan 15 18:35:16 raspberrypi homebridge[6120]: at Object.exports.runInThisContext (vm.js:76:16)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at Module._compile (module.js:542:28)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at Object.Module._extensions..js (module.js:579:10)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at Module.load (module.js:487:32)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at tryModuleLoad (module.js:446:12)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at Function.Module._load (module.js:438:3)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at Module.require (module.js:497:17)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at require (internal/module.js:20:19)
Jan 15 18:35:16 raspberrypi homebridge[6120]: at Object.
Looks like you have the info in confit.json but don't have the Homebridge-wink2 in your npm folder so it's calling it but can't find it.
Not sure why but I'm digging into it now.
Do you have more than one version of npm installed?
Okay... I can't chase it down. The below is the terminal commands that I tried. I had a different terminal window open monitoring the homebridge log.
pi@raspberrypi:~ $ sudo su root@raspberrypi:/home/pi# npm install -g homebridge-winkv2 npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue /usr/lib └── homebridge-winkv2@1.0.0
root@raspberrypi:/home/pi# cd /home/pi/Downloads root@raspberrypi:/home/pi/Downloads# cp index.js /usr/lib/node_modules/homebridge-winkv2/node_modules/wink-js/ root@raspberrypi:/home/pi/Downloads# systemctl restart homebridge root@raspberrypi:/home/pi/Downloads# cd root@raspberrypi:~# npm uninstall -g homebridge-winkv2
doesn't look like I have more than one version:
pi@raspberrypi:~ $ which npm /usr/bin/npm pi@raspberrypi:~ $ sudo which npm /usr/bin/npm pi@raspberrypi:~ $ npm -version 3.10.10 pi@raspberrypi:~ $ sudo npm -version 3.10.10 pi@raspberrypi:~ $ sudo su root@raspberrypi:/home/pi# npm -version 3.10.10
So yes... I had something going on and just started from scratch. Following the only noticeable change in the test/index.js file (commenting out line 4 - require config-file), everything appears to be good on the install.
[1/25/2017, 3:10:54 PM] Loaded plugin: homebridge-winkv2 [1/25/2017, 3:10:54 PM] Registering platform 'homebridge-winkv2.Wink'
Also... I'm using node 6.9.4 - in case you wanted to know.
Thanks man.
Didn't think I should open another issue for this - but will if you'd like.
Plugin loads just fine. However, it fails once I add the info into the config file. Here's the output:
Jan 25 15:27:59 raspberrypi homebridge[2432]: SyntaxError: Unexpected end of JSON input
Jan 25 15:27:59 raspberrypi homebridge[2432]: at Object.parse (native)
Jan 25 15:27:59 raspberrypi homebridge[2432]: at IncomingMessage.
I finally got it working... Perhaps I incorrectly assumed the id and key provided by Wink would be valid. When I replaced my id and secret with the ones referenced here: https://github.com/nfarina/homebridge/issues/625#issuecomment-217748447 everything started working as it should.
Just in case the link doesn't work:
"client_id": "quirky_wink_android_app",
"client_secret": "e749124ad386a5a35c0ab554a4f2c045",
Homebridge won't recognize the plugin. Any help would be appreciated!
Jan 13 21:34:34 raspberrypi homebridge[4155]: [1/13/2017, 9:34:34 PM] ==================== Jan 13 21:34:34 raspberrypi homebridge[4155]: [1/13/2017, 9:34:34 PM] ERROR LOADING PLUGIN homebridge-winkv2: Jan 13 21:34:34 raspberrypi homebridge[4155]: [1/13/2017, 9:34:34 PM] TypeError: Path must be a string. Received null Jan 13 21:34:34 raspberrypi homebridge[4155]: at assertPath (path.js:7:11) Jan 13 21:34:34 raspberrypi homebridge[4155]: at Object.dirname (path.js:1324:5) Jan 13 21:34:34 raspberrypi homebridge[4155]: at Object. (/usr/lib/node_modules/homebridge-winkv2/node_modules/config-file/index.js:17:21)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module._compile (module.js:570:32)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Object.Module._extensions..js (module.js:579:10)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module.load (module.js:487:32)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at tryModuleLoad (module.js:446:12)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Function.Module._load (module.js:438:3)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module.require (module.js:497:17)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at require (internal/module.js:20:19)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Object. (/usr/lib/node_modules/homebridge-winkv2/node_modules/wink-js/index.js:4:14)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module._compile (module.js:570:32)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Object.Module._extensions..js (module.js:579:10)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module.load (module.js:487:32)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at tryModuleLoad (module.js:446:12)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Function.Module._load (module.js:438:3)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module.require (module.js:497:17)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at require (internal/module.js:20:19)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Object. (/usr/lib/node_modules/homebridge-winkv2/index.js:2:12)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module._compile (module.js:570:32)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Object.Module._extensions..js (module.js:579:10)
Jan 13 21:34:34 raspberrypi homebridge[4155]: at Module.load (module.js:487:32)
Jan 13 21:34:34 raspberrypi homebridge[4155]: [1/13/2017, 9:34:34 PM] ====================