grover / homebridge-dacp

Remotely control Apple TV and iTunes via HomeKit.
MIT License
153 stars 15 forks source link

Crash when starting #28

Closed SoneeJohn closed 6 years ago

SoneeJohn commented 6 years ago

So I paired iTunes and here is my configuration file:

{
    "bridge": {
        "name": "Test bridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",

    "accessories": [
    {
        "name": "iTunes remote",
        "pairing": "D3DCD0A4DF722A6A",
        "serviceName": "422F69C188AEB1DB"
    }
  ],

    "platforms": [
    {
      "platform": "DACP",
      "devices": [
        {
          "name": "iTunes",
          "features": {
            "album-artwork": "/tmp/nowplaying.png",
            "alternate-input-controls": true

          }
        }
      ]
    }
  ]
}

But when I start Homebridge I get this output:


[2018-3-4 09:04:20] Plugin /usr/local/lib/node_modules/homebridge-dacp requires Node version of >=9.3.0 which does not satisfy the current Node version of v8.9.4. You may need to upgrade your installation of Node.
[2018-3-4 09:04:20] Loaded plugin: homebridge-dacp
[2018-3-4 09:04:20] Registering platform 'homebridge-dacp.DACP'
[2018-3-4 09:04:20] ---
[2018-3-4 09:04:20] Loaded config.json with 1 accessories and 1 platforms.
[2018-3-4 09:04:20] ---
[2018-3-4 09:04:21] Loading 1 platforms...
[2018-3-4 09:04:21] [DACP] Initializing DACP platform...
[2018-3-4 09:04:21] [DACP] DACP Platform Plugin Loaded - Version 0.9.1
[2018-3-4 09:04:21] [DACP] Found accessory in config: "iTunes"
[2018-3-4 09:04:21] [DACP] 
[2018-3-4 09:04:21] [DACP] Skipping creation of the accessory "iTunes" because it doesn't have a pairing code or
[2018-3-4 09:04:21] [DACP] service name yet. You need to pair the device/iTunes, reconfigure and restart homebridge.
[2018-3-4 09:04:21] [DACP] 
[2018-3-4 09:04:21] [DACP] Beginning remote control announcements for the accessory "iTunes".
[2018-3-4 09:04:21] [DACP] 
[2018-3-4 09:04:21] [DACP]  Use passcode 6329 to pair with this remote control.
[2018-3-4 09:04:21] [DACP] 
[2018-3-4 09:04:21] Loading 1 accessories...
/usr/local/lib/node_modules/homebridge/lib/api.js:50
  if (name.indexOf('.') == -1) {
           ^

TypeError: Cannot read property 'indexOf' of undefined
    at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:50:12)
    at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:264:42)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:86:38)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
Sonees-iMac:~ soneejohn$ sudo homebridge
/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/dns_sd.js:35
    throw ex;
    ^

Error: The module '/usr/local/lib/node_modules/homebridge/node_modules/mdns/build/Release/dns_sd_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 59. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:691:18)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/dns_sd.js:24:20)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
SoneeJohn commented 6 years ago

My bad I had my configuration file wrong.

krazyflipj commented 6 years ago

So how did you fix it? I'm having same problem

SoneeJohn commented 6 years ago

@krazyflipj it was an error on my end. I got the configuration wrong

maxgyver87 commented 5 years ago

would have been nice to see the working config.