Giter Club home page Giter Club logo

homebridge-dacp's People

Contributors

grover avatar nitaybz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-dacp's Issues

Can't get macros to work

Here's my pertinent configuration information:

    {
        "platform": "DACP",
        "devices": [
            {
                "name": "AppleTV Remote from Homebridge",
                "pairing": "02210B1CFFAF4D98",
                "serviceName": "A8C95315B8AE7A3EE52167CAE8451B812F4204C4",

                "features": {
                    "no-volume-controls": true,
                    "alternate-playpause-switch": true,
                    "no-skip-controls": true
                }
            }
        ]
    }

When I change it to the following, Homebridge won't even start unless I remove the "pairing" & "serviceName" properties:

   {
        "platform": "DACP",
        "devices": [
            {
                "name": "AppleTV Remote from Homebridge",
                "pairing": "02210B1CFFAF4D98",
                "serviceName": "A8C95315B8AE7A3EE52167CAE8451B812F4204C4",
                "macros": {
                    "Test": [
                        "topmenu"
                    ]
                },
                "features": {
                    "no-volume-controls": true,
                    "alternate-playpause-switch": true,
                    "no-skip-controls": true
                }
            }
        ]
    }

Any ideas?

RangeError/Parsing Issue

Connects to iTunes and allows for Play/Pause functions through iOS Home only if alternate-playpause-switch is added as features. Otherwise, shows as unsupported with no functionality. Launches with errors:
error on mscu RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readIntBE (internal/buffer.js:330:3) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:927:26) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1157:10) at Request.emit (events.js:182:13) error on aeSX RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readIntBE (internal/buffer.js:330:3) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:927:26) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1157:10) at Request.emit (events.js:182:13) error on msma RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readIntBE (internal/buffer.js:330:3) at _decodeList (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:875:26) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:931:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1157:10) error on msma RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readIntBE (internal/buffer.js:330:3) at _decodeList (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:875:26) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:931:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1157:10) error on mper RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readUIntBE (internal/buffer.js:162:3) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:929:26) at _decodeList (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:879:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:931:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) Skipping 'mdbk' - don't know how to parse. length=4 Skipping 'aeCs' - don't know how to parse. length=4 Skipping 'aeIM' - don't know how to parse. length=8 Skipping 'meds' - don't know how to parse. length=4 error on mper RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readUIntBE (internal/buffer.js:162:3) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:929:26) at _decodeList (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:879:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:931:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) Skipping 'mdbk' - don't know how to parse. length=4 Skipping 'aeCs' - don't know how to parse. length=4 Skipping 'meds' - don't know how to parse. length=4 error on mper RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readUIntBE (internal/buffer.js:162:3) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:929:26) at _decodeList (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:879:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:931:19) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) Skipping 'mdbk' - don't know how to parse. length=4 Skipping 'aeCs' - don't know how to parse. length=4 Skipping 'mrpr' - don't know how to parse. length=8 Skipping 'aeRM' - don't know how to parse. length=8 Skipping 'meds' - don't know how to parse. length=4 [6/15/2018, 5:16:49 PM] [DACP] Connected to [my] Library error on asai RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8 at boundsError (internal/buffer.js:55:9) at Buffer.readIntBE (internal/buffer.js:330:3) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:927:26) at _decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19) at Object.decode (/usr/local/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10) at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29) at Request.self.callback (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1157:10) at Request.emit (events.js:182:13) [6/15/2018, 5:16:49 PM] [DACP] Creating properties connection to 10.0.10.16:3689 [6/15/2018, 5:16:49 PM] [DACP] Updating characteristics with current volume: v=88

dns service error: name conflict

Hi! getting a weird error every time I try to set up your app. Ive tried restarting and renaming things.

[2018-2-25 13:37:31] [DysonPlatform] Initializing DysonPlatform platform...
[2018-2-25 13:37:31] [DACP] Initializing DACP platform...
[2018-2-25 13:37:31] [DACP] DACP Platform Plugin Loaded - Version 0.8.0
[2018-2-25 13:37:31] [DACP] Found accessory in config: "iTunes"
[2018-2-25 13:37:31] [DACP]
[2018-2-25 13:37:31] [DACP] Skipping creation of the accessory "iTunes" because it doesn't have a pairing code or
[2018-2-25 13:37:31] [DACP] service name yet. You need to pair the device/iTunes, reconfigure and restart homebridge.
[2018-2-25 13:37:31] [DACP]
[2018-2-25 13:37:31] [DACP] Beginning remote control announcements for the accessory "iTunes".
[2018-2-25 13:37:31] [DACP]
[2018-2-25 13:37:31] [DACP]     Use passcode 8199 to pair with this remote control.
[2018-2-25 13:37:31] [DACP]
[2018-2-25 13:37:31] [DACP] Found accessory in config: "AppleTV-1"
[2018-2-25 13:37:31] [DACP]
[2018-2-25 13:37:31] [DACP] Skipping creation of the accessory "AppleTV-1" because it doesn't have a pairing code or
[2018-2-25 13:37:31] [DACP] service name yet. You need to pair the device/iTunes, reconfigure and restart homebridge.
[2018-2-25 13:37:31] [DACP]
[2018-2-25 13:37:31] [DACP] Beginning remote control announcements for the accessory "AppleTV-1".
[2018-2-25 13:37:31] [DACP]
[2018-2-25 13:37:31] [DACP]     Use passcode 3379 to pair with this remote control.
[2018-2-25 13:37:31] [DACP]

/homebridge/node_modules/mdns/lib/advertisement.js:56
  dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
         ^
Error: dns service error: name conflict
    at new Advertisement (/homebridge/node_modules/mdns/lib/advertisement.js:56:10)
    at Object.create [as createAdvertisement] (/homebridge/node_modules/mdns/lib/advertisement.js:64:10)
    at new DacpRemote (/homebridge/node_modules/homebridge-dacp/src/dacp/DacpRemote.js:29:21)
    at DacpPlatform._createRemote (/homebridge/node_modules/homebridge-dacp/src/index.js:160:24)
    at _accessories.devices.map.device (/homebridge/node_modules/homebridge-dacp/src/index.js:139:14)
    at Array.map (<anonymous>)
    at DacpPlatform.accessories (/homebridge/node_modules/homebridge-dacp/src/index.js:123:33)
    at Server._loadPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:364:20)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:308:16)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:85:36)
    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)

Accessory Name is undefined

Hi, so I installed the plugin as per instructions and configured the config file as follows (after troubleshooting it's exactly as the readme):

{
    "platform" : "DACP",
    "devices" : [
        {
            "name" : "New Remote Control"
        }
    ]
}

I get the following error now (I tried adding a name under the "platform" as it seems plugins should have a "name" but that didn't fix it. Any ideas? The error seems to do with the variable this._accessories Maybe it's not reading the name? (Line 146:5)

plugin_error

Playpause switch

If the (alternate-playpause) switch somehow off while playing (that sometimes happens), changing its state pauses playback, but switch is on by now

Can't set automation based on media Type

Hi @grover !
First of all, thank you so much for this plugin! it's very useful to me as I can set automations based on my apple TV play/paused condition and the media type...

the only problem is that I can't set media type in the conditions since the values range are very big which makes it impossible to choose the numbers 1, 2 or 3 or even any number lower than 100000:
fullsizeoutput_876

I would suggest to put a max and min limit. I'll open a pull request for that

Fehler bei erstinstallation

Apr 03 14:48:21 hbridge2 homebridge[1463]: [2018-4-3 14:48:21] [DACP] Starting DACP browser...
Apr 03 14:48:21 hbridge2 homebridge[1463]: /usr/local/lib/node_modules/homebridge-dacp/src/index.js:79
Apr 03 14:48:21 hbridge2 homebridge[1463]: const artwork = device.features['album-artwork'];
Apr 03 14:48:21 hbridge2 homebridge[1463]: ^
Apr 03 14:48:21 hbridge2 homebridge[1463]: TypeError: Cannot read property 'album-artwork' of undefined
Apr 03 14:48:21 hbridge2 homebridge[1463]: at config.devices.forEach.device (/usr/local/lib/node_modules/homebridge-dacp/src/index.js:79:38)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Array.forEach ()
Apr 03 14:48:21 hbridge2 homebridge[1463]: at DacpPlatform._enableArtworkCameras (/usr/local/lib/node_modules/homebridge-dacp/src/index.js:78:25)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at DacpPlatform._didFinishLaunching (/usr/local/lib/node_modules/homebridge-dacp/src/index.js:72:10)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at API.emit (events.js:185:15)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:98:13)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Module._compile (module.js:649:30)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Object.Module._extensions..js (module.js:660:10)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Module.load (module.js:561:32)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at tryModuleLoad (module.js:501:12)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Function.Module._load (module.js:493:3)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at Function.Module.runMain (module.js:690:10)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at startup (bootstrap_node.js:194:16)
Apr 03 14:48:21 hbridge2 homebridge[1463]: at bootstrap_node.js:666:3
Apr 03 14:48:21 hbridge2 systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Apr 03 14:48:21 hbridge2 systemd[1]: homebridge.service: Unit entered failed state.
Apr 03 14:48:21 hbridge2 systemd[1]: homebridge.service: Failed with result 'exit-code'.
Apr 03 14:48:31 hbridge2 systemd[1]: homebridge.service: Service hold-off time over, scheduling restart.
Apr 03 14:48:31 hbridge2 systemd[1]: Stopped Node.js HomeKit Server.
Apr 03 14:48:31 hbridge2 systemd[1]: Started Node.js HomeKit Server.

Fatal error while talking to Apple TV

Hey Grover,

Thanks for this plugin! I've seen some really great implementations made possible due to this and I'm finally getting the chance to try it out for myself.

I followed the guide and got everything up as expected, until I restarted homebridge after adding the pairing and serviceName. I was hit with this error:

[2018-9-15 20:22:30] [DACP] Connecting to AppleTV (192.168.1.177:3689) [2018-9-15 20:22:30] [DACP] Creating status connection to 192.168.1.177:3689 Established connection to 192.168.1.177:3689 with session ID 1636090795 Skipping '�' - don't know how to parse. length=0 Skipping '�=�' - don't know how to parse. length=1259258416 [2018-9-15 20:22:30] [DACP] Fatal error while talking to AppleTV: [2018-9-15 20:22:30] [DACP] [2018-9-15 20:22:30] [DACP] Error: Error: Missing server info response container at _withConnection (/homebridge/node_modules/homebridge-dacp/src/dacp/DacpClient.js:33:15) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) [2018-9-15 20:22:30] [DACP] [2018-9-15 20:22:30] [DACP] Attempting to reconnect to AppleTV in 204.8 seconds. [2018-9-15 20:22:30] [DACP] [AppleTV] Connection to DACP server failed: Error: Missing server info response container at _withConnection (/homebridge/node_modules/homebridge-dacp/src/dacp/DacpClient.js:33:15) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) (node:8666) UnhandledPromiseRejectionWarning: IllegalStateError: Backoff in progress. at Backoff.backoff (/homebridge/node_modules/backoff/lib/backoff.js:38:13) at _dacpClient.connect.then.catch.error (/homebridge/node_modules/homebridge-dacp/src/DacpAccessory.js:243:23) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) (node:8666) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 11)

Any idea what could be causing this? Side note: I'm using an Apple TV 2

Any help would be appreciated!

Cheers

ERROR LOADING PLUGIN homebridge-dacp

Hey,

when I install homebridge-dacp and start homebridge I get this error:

`[2018-3-24 22:49:49] ERROR LOADING PLUGIN homebridge-dacp:
[2018-3-24 22:49:49] Error: Plugin /usr/lib/node_modules/homebridge-dacp requires a HomeBridge version of >=0.4.36 which does not satisfy the current HomeBridge version of 0.4.33. You may need to upgrade your installation of HomeBridge.
    at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:56:11)
    at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:142:14)
    at Array.forEach (<anonymous>)
    at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:138:22)
    at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:56:24)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:26:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)`

I'm on homebridge 0.4.38:

screenshot 2018-03-25 15 08 32

thanks,
felix

Fatal error browsing for DACP services \ {"code":-3008

Hi.. Happy new year to you and thx for developing on this project.

Hope I‘m not raising a duplicate to another issue, but encountered this tonight when trying to setup my apple tv 4gen for homebridge.
Was able to successfully pair the apple tv but then it always would end in error saying Apple TV is down.

Thx for looking into it!

[2018-1-3 00:47:08] [DACP]
[2018-1-3 00:49:08] [DACP] Starting DACP browser...
[2018-1-3 00:49:08] [DACP] Fatal error browsing for DACP services:
[2018-1-3 00:49:08] [DACP]
[2018-1-3 00:49:08] [DACP] Error: {"code":-3008,"errno":-3008,"syscall":"getaddrinfo"}
[2018-1-3 00:49:08] [DACP]
[2018-1-3 00:49:08] [DACP] Restarting MDNS browser for DACP in 120 seconds

NodeJS LTS 8 Compatibility

Hello grover,

Could you tell me if it's compatible with the current LTS version of NodeJS. (the package.json ask for node >= 9.3.0)

If not, could it be easily ?

BR's
Nebz

"ECONNREFUSED" error occur frequently

This happens a lot:

Dec 26 19:49:04 raspberrypi homebridge[1026]: [2017-12-26 19:49:04] [DACP] Fatal error while talking to Living Room Apple TV:
Dec 26 19:49:04 raspberrypi homebridge[1026]: [2017-12-26 19:49:04] [DACP]
Dec 26 19:49:04 raspberrypi homebridge[1026]: [2017-12-26 19:49:04] [DACP]   Error: {"error":{"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"10.0.0.xx","port":3689},"options":{"encoding":null,"url":"http://Living-Room.local.:3689/ctrl-int/1/getproperty","qs":{"properties":"dacp.playingtime","session-id":1},"headers":{"Viewer-Only-Client":"1"}}}
Dec 26 19:49:04 raspberrypi homebridge[1026]: [2017-12-26 19:49:04] [DACP]
Dec 26 19:49:04 raspberrypi homebridge[1026]: [2017-12-26 19:49:04] [DACP] Attempting to reconnect to Living Room Apple TV in 0.1 seconds.
Dec 26 19:49:04 raspberrypi homebridge[1026]: [2017-12-26 19:49:04] [DACP] Failed to retrieve the current playback position. Stopping continuous updates. Error: [object Object]
Dec 26 19:49:04 raspberrypi homebridge[1026]: [2017-12-26 19:49:04] [DACP] [Living Room Apple TV] Retrieving updates from DACP server failed with error [object Object]
Dec 26 19:49:05 raspberrypi homebridge[1026]: [2017-12-26 19:49:05] [DACP] Connecting to Living-Room.local.:3689 for Living Room Apple TV
Dec 26 19:49:05 raspberrypi homebridge[1026]: [2017-12-26 19:49:05] [DACP] Connected to Living Room with session ID 1
Dec 26 19:49:06 raspberrypi homebridge[1026]: [2017-12-26 19:49:06] [DACP] The accessory Living Room Apple TV is down.
Dec 26 19:49:07 raspberrypi homebridge[1026]: [2017-12-26 19:49:07] [DACP] The accessory Living Room Apple TV is announced.
Dec 26 19:49:07 raspberrypi homebridge[1026]: [2017-12-26 19:49:07] [DACP] Attempting to reconnect to Living Room Apple TV in 0.1 seconds.
Dec 26 19:49:07 raspberrypi homebridge[1026]: [2017-12-26 19:49:07] [DACP] Connecting to Living-Room.local.:3689 for Living Room Apple TV
Dec 26 19:49:07 raspberrypi homebridge[1026]: [2017-12-26 19:49:07] [DACP] Connected to Living Room with session ID 2
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP] Fatal error while talking to Living Room Apple TV:
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP]
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP]   Error: {"error":{"code":"ECONNRESET"},"options":{"encoding":null,"url":"http://Living-Room.local.:3689/ctrl-int/1/playstatusupdate","qs":{"revision-number":3,"session-id":1},"headers":{"Viewer-Only-Client":"1"}}}
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP]
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP] Attempting to reconnect to Living Room Apple TV in 0.1 seconds.
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP] [Living Room Apple TV] Retrieving updates from DACP server failed with error [object Object]
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP] [Living Room Apple TV] Retrieving updates from DACP server failed with error [object Object]
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP] Connecting to Living-Room.local.:3689 for Living Room Apple TV
Dec 26 20:13:00 raspberrypi homebridge[1026]: [2017-12-26 20:13:00] [DACP] Connected to Living Room with session ID 1
Dec 26 20:13:01 raspberrypi homebridge[1026]: [2017-12-26 20:13:01] [DACP] The accessory Living Room Apple TV is down.
Dec 26 20:13:02 raspberrypi homebridge[1026]: [2017-12-26 20:13:02] [DACP] The accessory Living Room Apple TV is announced.
Dec 26 20:13:02 raspberrypi homebridge[1026]: [2017-12-26 20:13:02] [DACP] Attempting to reconnect to Living Room Apple TV in 0.1 seconds.
Dec 26 20:13:02 raspberrypi homebridge[1026]: [2017-12-26 20:13:02] [DACP] Connecting to Living-Room.local.:3689 for Living Room Apple TV
Dec 26 20:13:03 raspberrypi homebridge[1026]: [2017-12-26 20:13:03] [DACP] Connected to Living Room with session ID 2

Cannot unpair

Hello,

I made some test connecting with homebridge-dacp plugin with AppleTV and now I'd need to delete some "remote app" and let only one or delete all, but simply I can't.

Does anybody knows how can I make it?

Thanks :)

Accessory not supported

Hey guys. I have completed all the setup, all is running but I am getting 'Not supported in the Home app' on the accessory.

Did I miss something ? Thanks

error on aeSX RangeError [ERR_OUT_OF_RANGE]

[2018-5-12 17:59:07] [DACP] The accessory AppleTV is announced as 10.0.1.84:3689.
[2018-5-12 17:59:07] [DACP] It's an AppleTV6,2 named Apple TV
[2018-5-12 17:59:07] [DACP] Attempting to reconnect to AppleTV in 0.1 seconds.
[2018-5-12 17:59:07] [DACP] Connecting to AppleTV (10.0.1.84:3689)
[2018-5-12 17:59:07] [DACP] Creating status connection to 10.0.1.84:3689
Established connection to 10.0.1.84:3689 with session ID 2
error on aeSX
RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 8
at boundsError (internal/buffer.js:55:9)
at Buffer.readIntBE (internal/buffer.js:330:3)
at _decode (/root/.nvm/versions/node/v10.1.0/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:927:26)
at _decode (/root/.nvm/versions/node/v10.1.0/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:933:19)
at Object.decode (/root/.nvm/versions/node/v10.1.0/lib/node_modules/homebridge-dacp/src/daap/Decoder.js:963:10)
at Request.request [as _callback] (/root/.nvm/versions/node/v10.1.0/lib/node_modules/homebridge-dacp/src/dacp/DacpConnection.js:145:29)
at Request.self.callback (/root/.nvm/versions/node/v10.1.0/lib/node_modules/homebridge-dacp/node_modules/request/request.js:186:22)
at Request.emit (events.js:182:13)
at Request. (/root/.nvm/versions/node/v10.1.0/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1163:10)
at Request.emit (events.js:182:13)
at IncomingMessage. (/root/.nvm/versions/node/v10.1.0/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1086:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
[2018-5-12 17:59:08] [DACP] Connected to Apple TV

After that the Apple TV does not appear in HomeKit. Please help. Thank you!

cannot pair with iTunes or AppleTV – Help needed –

Hi there …

unfortunately I cannot pair either iTunes nor AppleTV on the latest release of homebridge-dacp.

I placed in the config.json

{ "platform": "DACP",
"devices": [ { "name": "iTunes" } ]
}

I do get a pin in the log but unfortunately I cannot pair with the given pin as iTunes either ignores
the pin or simply even do not show any new device.

But in the previous release (I think it was 0.7.8) it worked. As descripted in its installation guide, I haved just placed "New Remote Control" in the config.json file and after entering the pin in iTunes I got the code to pair it.

Any idea whats wrong here?

Comments really welcome as I wasted already 4 days for this.

thx

Auto shutdown function Appletv

Hi,

I'm reaaly happy with this plugin on my ATV 4k and i am using it as an alarm to play music on the morning to wake me up.

It will be a great idea to be able to keep holding the Topmenu button to use it in scenes for going to sleep / shut down when you are sleeping / shut it down when you leave home.

I made a macro like this :

              "macros": {
                    "Settings": [
                                    "topmenu",
                                    "wait5s",
                                    "select"]
                              }

But to get it working i need an topmenuhold macro command and why not an wait1s command too.

that will allow to shutdown the apple TV and all the devices connected through HDMI CEC.

A big thank you for this help

Specific error: Error: Could not resolve Apple-TV.local when using gets

Hi,

I am just starting out with Homebridge. When I use a dns service for faking my location on the Apple TV I get this error.

I use an Apple TV 4. The DACP Remote is successfully paired with Apple TV. And with dns set to automatic on the Apple TV it works ok.
I am using Raspberry Pi, Apple TV both connected wired to the local network.
Node js 8.94, bpm 5.6.0, Homebridge 0.4.38.

Is there a way to get it working with the getflix dns service enabled?

UPDATE: I got it working by editing the _onServiceUp method in DacpBrowser.js and setting service.host there to the ipadress of my Apple TV. Still it would even be better if it could work without modding the code.

Thanks for a great plugin,

Peter

[2018-4-12 14:15:07] [DACP] Specific error: Error: Could not resolve Apple-TV.local - Query Timed Out
[2018-4-12 14:15:07] [DACP] Failed to resolve service Apple-TV.local. using IPv4 MDNS lookups.
at Timer.listOnTimeout (timers.js:270:5)
at tryOnTimeout (timers.js:310:5)
at ontimeout (timers.js:475:11)
at Timeout.setTimeout [as _onTimeout] (/usr/local/lib/node_modules/homebridge-dacp/node_modules/mdns-resolver/dist/index.js:14:18)
[2018-4-12 14:15:07] [DACP] Specific error: Error: Could not resolve Apple-TV.local - Query Timed Out
[2018-4-12 14:15:07] [DACP] Failed to resolve service Apple-TV.local. using IPv4 MDNS lookups.
[2018-4-12 14:15:05] [Living Room Apple TV] Opened connection to Living Room Apple TV
[2018-4-12 14:15:04] Homebridge is running on port 51826.
[2018-4-12 14:15:04] [DACP] Starting DACP browser...

Error Installing on Pi 3

Not sure why I'm getting this, have installed many other plugins without issue...

pi@raspberrypi:~ $ sudo npm i homebridge-dacp

[email protected] install /home/pi/node_modules/mdns
node-gyp rebuild

gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Linux 4.14.34-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/node_modules/mdns
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-07-01T12_44_03_790Z-debug.log

Multiple airplayspeakers

Thank You so much for this Plugin.
I have several airplay speakers for my iTunes. I would like to use/control those with this plugin (or another one) is this possible?
Kind regards,

Leon

Home on iPhone 6S

Home on iPhone 6S shows both iTunes and Apple TV as unsupported accessories.

Everything looks fine in the log:
[2017-12-10 00:05:46] [DACP] Session ID 1161782168
[2017-12-10 00:05:46] [DACP] Connected to Macintosh’s Library
[2017-12-10 00:05:46] [DACP] Session ID 7
[2017-12-10 00:05:46] [DACP] Updating characteristics with current volume: v=100
[2017-12-10 00:05:46] [DACP] Connected to Apple TV (4)

Only errors on log are the well known Apple Bonjour warning:
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.

And "sys is deprecated":
(node:12731) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead.

Features

Great job and great idea to simulate a remote control to enable this on homebridge.

I would like to get a better understanding for how features work. Do we have to configure them? How are they written in the config.json?

Please provide an example.

Error when adding iTunes Device

Hello,
I'm running homebridge on mac. I've got 3 separate apple TV's running no problem, but any time i add the device for iTunes and get the following error:

For testing purposes i launched SUDO homebridge

`[2018-4-26 11:56:29] [DACP] Starting DACP browser...

/usr/local/lib/node_modules/homebridge-dacp/src/index.js:79
const artwork = device.features['album-artwork'];
^
TypeError: Cannot read property 'album-artwork' of undefined
at config.devices.forEach.device (/usr/local/lib/node_modules/homebridge-dacp/src/index.js:79:38)
at Array.forEach ()
at DacpPlatform._enableArtworkCameras (/usr/local/lib/node_modules/homebridge-dacp/src/index.js:78:25)
at DacpPlatform._didFinishLaunching (/usr/local/lib/node_modules/homebridge-dacp/src/index.js:72:10)
at API.emit (events.js:185:15)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:98:13)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)`

Here's my config:

"platforms": [
{
"platform": "HarmonyHub",
"name": "Living Room Harmony Hub"
},
{
"platform": "config",
"name": "Config",
"port": 8080,
"sudo": false
},
{
"platform": "DACP",
"devices": [
{
"name": "AppleTV-Living Room",
"pairing": "REDACTED",
"serviceName": "REDACTED",
"features": {
"no-volume-controls": true
}
},
{
"name": "AppleTV-Bedroom",
"pairing": "REDACTED",
"serviceName": "REDACTED",
"features": {
"no-volume-controls": true
}
},
{
"name": "AppleTV-Kitchen",
"pairing": "REDACTED",
"serviceName": "REDACTED",
"features": {
"no-volume-controls": true
}
},
{
"name": "iTunes"
}
]
}
]
}

Doesn't load paring code and service name.

I have installed this plugin, but when I paired my Apple TV and added the codes to the config like so:
{ "platform": "DACP", "devices": [ { "name": "Apple TV", "paring": "PARING-CODE-HERE", "serviceName": "SERVICE-NAME-HERE" } ] }, the console still says:

[2018-1-5 14:44:02] [DACP] Initializing DACP platform...
[2018-1-5 14:44:02] [DACP] DACP Platform Plugin Loaded
[2018-1-5 14:44:02] [DACP] Found accessory in config: "Apple TV"
[2018-1-5 14:44:02] [DACP]
[2018-1-5 14:44:02] [DACP] Skipping creation of the accessory "Apple TV" because it doesn't have a pairing code or
[2018-1-5 14:44:02] [DACP] service name yet. You need to pair the device/iTunes, reconfigure and restart homebridge.
[2018-1-5 14:44:02] [DACP]
[2018-1-5 14:44:02] [DACP] Beginning remote control announcements for the accessory "Apple TV".
[2018-1-5 14:44:02] [DACP]
[2018-1-5 14:44:02] [DACP] Use passcode 1501 to pair with this remote control.
[2018-1-5 14:44:02] [DACP]

Why isn't it working/what have I done wrong?

PR Proposal

Hi, I'd like to submit a new branch and PR to add a sleep mode to turn the appletv off
I'm a bit new to GitHub and wondering how do i push my branch to your project?
I don't seem to have permission

remote: Permission to grover/homebridge-dacp.git denied to JamesMensah.
fatal: unable to access 'https://github.com/grover/homebridge-dacp.git/': The requested URL returned error: 403

Thanks,
James

Read title

Hi!

At First. Great Plugin. Love it :)

Is there any way to read the Song information (or now playing Information) in Terminal?

I would like to make a switch which is active while the title is not empty

Reasons? Yes!

I would like to make some Kind of theatre mode. But as Long as the movie (like on Netflix) is playing or paused! Netflix does not Support the mediatype Feature :/ anyway the only thing that change from main menu to netflix is the play/pause and the title duration and so on. Mediatype is always 0

Thanks for help

no buttons in home app

I have everything setup but get no buttons in home app.

this is in log, not sure if related

Skipping 'mdbk' - don't know how to parse. length=4
Skipping 'aeCs' - don't know how to parse. length=4
Skipping 'aeIM' - don't know how to parse. length=8
Skipping 'meds' - don't know how to parse. length=4
Skipping 'mdbk' - don't know how to parse. length=4
Skipping 'aeCs' - don't know how to parse. length=4
Skipping 'meds' - don't know how to parse. length=4
Skipping 'mdbk' - don't know how to parse. length=4
Skipping 'aeHS' - don't know how to parse. length=1
Skipping 'aeCs' - don't know how to parse. length=4
Skipping 'mrpr' - don't know how to parse. length=8
Skipping 'aeRM' - don't know how to parse. length=8
Skipping 'meds' - don't know how to parse. length=4
Skipping 'mdbk' - don't know how to parse. length=4
Skipping 'aeHS' - don't know how to parse. length=1
Skipping 'aeCs' - don't know how to parse. length=4
Skipping 'mrpr' - don't know how to parse. length=8
Skipping 'aeRM' - don't know how to parse. length=8
Skipping 'meds' - don't know how to parse. length=4
Skipping 'mdbk' - don't know how to parse. length=4
Skipping 'aeHS' - don't know how to parse. length=1
Skipping 'aeCs' - don't know how to parse. length=4
Skipping 'mrpr' - don't know how to parse. length=8
Skipping 'aeRM' - don't know how to parse. length=8
Skipping 'meds' - don't know how to parse. length=4

Command Details

I've got this plugin working insofar as I can use the alternate-playpause-switch feature to play/pause (on/off) my Apple TV via the Home App. What I am unclear on is if there is any other functionality available to me and if so-how do I utilize it.

cannot remove old (iTunes) instances

Hello. I recently decided to remove dacp plugin as I found myself not really using it. (I don't think I ever got it working correctly anyway.) I uninstalled the plugin, removed the content from config.json, as well as deleting the persist and accessories folders entirely. I also changed the name of the Homebridge instance and deleted/added back the Homebridge hub to HomeKit. But no matter what I do, the two iTunes instances continue to show up in my config-ui-x accessories dashboard.

They do not show up in my HomeKit list on my iPhone/iPad however. Just on the config-ui-x accessories dashboard.

Not sure if this is a dacp or config-ui-x issue… or something else.

Any thoughts or assistance appreciated. (Cross posted in config-ui-x also.)

Add Accessory - iTunes Artwork-2076

I am asked to enter the HomeKit setup code for iTunes Artwork-2076. It is expecting an 8 digit code. I have trawled the log file and can't seem to find anything suitable.

how to control volume?

i change the "no-volume-control" to false but i dont see any change on in the home app to change volume.
please help

thanks

Unable to get plugin working

I was able to get the plugin to appear as a Bridge in the Home app. I had to use the "alternate-playpause-switch": true value to get the AppleTV to play/pause. However, it only worked once in the Home App. After that, no play or pause. Same goes for the Eve app. I could only play/pause once. Never received any values for the metadata fields. Skip didnt work either.

Playlist switch?

I can play pause the current selected playlist in iTunes but I don't see the playlists in Home, thus I'm not able to switch between them.

How should the config looks like to let the playlist show up as a switch?

Long press on TopMenu button in Macros?

Hey, would it be possible to get the macro part of the plugin to be able to initiate a long-press of the TopMenu button?

Reason being being able to create a macro that can put an AppleTV to sleep - i.e. long press (brings up the sleep menu), normal press of Select, and the Apple TV sleeps.

Crash when starting

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)


ERROR - Plugin not registered

Hello,
i have a Problem with your plugin.
i´ve installed the Plugin with npm install -g homebridge-dacp --unsafe-perm and added

{ "platform": "DACP", "devices": [ ] }

to the config.

After restart my homebridge with sudsystemctl restart homebridge -l I got the following Problem

Mär 30 11:04:59 hbridge2 homebridge[6895]: /usr/local/lib/node_modules/homebridge/lib/api.js:122
Mär 30 11:04:59 hbridge2 homebridge[6895]: throw new Error("The requested platform '" + name + "' was not registered by any plugin.");
Mär 30 11:04:59 hbridge2 homebridge[6895]: ^
Mär 30 11:04:59 hbridge2 homebridge[6895]: Error: The requested platform 'DACP' was not registered by any plugin.
Mär 30 11:04:59 hbridge2 homebridge[6895]: at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:122:13)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:294:45)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:85:36)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at Module._compile (module.js:571:32)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at Object.Module._extensions..js (module.js:580:10)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at Module.load (module.js:488:32)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at tryModuleLoad (module.js:447:12)
Mär 30 11:04:59 hbridge2 homebridge[6895]: at Function.Module._load (module.js:439:3)
Mär 30 11:04:59 hbridge2 systemd[1]: homebridge.service: main process exited, code=exited, status=1/FAILURE
Mär 30 11:04:59 hbridge2 systemd[1]: Unit homebridge.service entered failed state.

Versions:

pi@hbridge2:~ npm -v
5.8.0
pi@hbridge2:~ $ sudo npm view homebridge-dacp version
0.9.1
pi@hbridge2:~ $ node -v
v7.10.0
pi@hbridge2:~ $ sudo npm list -g --depth=0
/usr/local/lib
├── [email protected]

Update:
If I clear the config (remove { "platform": "DACP", "devices": [ ] } homebridge starts without problems but with this notification:

Mär 30 16:43:06 hbridge2 homebridge[29973]: [2018-3-30 16:43:06] ERROR LOADING PLUGIN homebridge-dacp:
Mär 30 16:43:06 hbridge2 homebridge[29973]: [2018-3-30 16:43:06] Error: Cannot find module '../build/Release/dns_sd_bindings'
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Function.Module._resolveFilename (module.js:470:15)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Function.Module._load (module.js:418:25)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Module.require (module.js:498:17)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at require (internal/module.js:20:19)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Object. (/usr/local/lib/node_modules/homebridge-dacp/node_modules/mdns/lib/dns_sd.js:32:22)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Module._compile (module.js:571:32)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Object.Module._extensions..js (module.js:580:10)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Module.load (module.js:488:32)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at tryModuleLoad (module.js:447:12)
Mär 30 16:43:06 hbridge2 homebridge[29973]: at Function.Module._load (module.js:439:3)

[DACP] Fatal error while talking to iTunes: Error: TypeError: Cannot read property 'host' of undefined at DacpClient._withConnection (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:229:67)

Hey Mister ;)

from time to time I get this error and DACP stops working. Homebridge is still running though.
When I close iTunes and open it again, everything is back working.
I'm not sure if it is about when the iMac is going to sleep and wake up.
Homebridge is running on a Raspi.

As always, thanks a a lot.

[2018-3-5 11:19:58] [DACP] [2018-3-5 11:19:58] [DACP] Fatal error while talking to iTunes: [2018-3-5 11:19:58] [DACP] [2018-3-5 11:19:58] [DACP] Error: TypeError: Cannot read property 'host' of undefined at DacpClient._withConnection (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:229:67) at DacpClient.getProperty (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:153:23) at SpeakerService._getMute (/usr/local/lib/node_modules/homebridge-dacp/src/SpeakerService.js:98:41) at Characteristic.Mute.emit (events.js:127:13) at Characteristic.Mute.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:162:10) at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:756:20) at Array.forEach (<anonymous>) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:720:8) at HAPServer.emit (events.js:127:13) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10) at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:127:13) at endReadableNT (_stream_readable.js:1101:12) at process._tickCallback (internal/process/next_tick.js:114:19) [2018-3-5 11:19:58] [DACP] [2018-3-5 11:19:58] [DACP] Returning current playback state: paused [2018-3-5 11:21:00] [DACP] Fatal error while talking to iTunes: [2018-3-5 11:21:00] [DACP] [2018-3-5 11:21:00] [DACP] Error: TypeError: Cannot read property 'host' of undefined at DacpClient._withConnection (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:229:67) at DacpClient.getProperty (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:153:23) at SpeakerService._getVolume (/usr/local/lib/node_modules/homebridge-dacp/src/SpeakerService.js:72:41) at Characteristic.Volume.emit (events.js:127:13) at Characteristic.Volume.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:162:10) at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:756:20) at Array.forEach (<anonymous>) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:720:8) at HAPServer.emit (events.js:127:13) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10) at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:127:13) at endReadableNT (_stream_readable.js:1101:12) at process._tickCallback (internal/process/next_tick.js:114:19) [2018-3-5 11:21:00] [DACP] [2018-3-5 11:21:00] [DACP] Fatal error while talking to iTunes: [2018-3-5 11:21:00] [DACP] [2018-3-5 11:21:00] [DACP] Error: TypeError: Cannot read property 'host' of undefined at DacpClient._withConnection (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:229:67) at DacpClient.getProperty (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:153:23) at SpeakerService._getMute (/usr/local/lib/node_modules/homebridge-dacp/src/SpeakerService.js:98:41) at Characteristic.Mute.emit (events.js:127:13) at Characteristic.Mute.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:162:10) at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:756:20) at Array.forEach (<anonymous>) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:720:8) at HAPServer.emit (events.js:127:13) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10) at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:127:13) at endReadableNT (_stream_readable.js:1101:12) at process._tickCallback (internal/process/next_tick.js:114:19) [2018-3-5 11:21:00] [DACP] [2018-3-5 11:21:00] [DACP] Returning current playback state: paused [2018-3-5 11:21:11] [DACP] Fatal error while talking to iTunes: [2018-3-5 11:21:12] [DACP] [2018-3-5 11:21:12] [DACP] Error: TypeError: Cannot read property 'host' of undefined at DacpClient._withConnection (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:229:67) at DacpClient.getProperty (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:153:23) at SpeakerService._getVolume (/usr/local/lib/node_modules/homebridge-dacp/src/SpeakerService.js:72:41) at Characteristic.Volume.emit (events.js:127:13) at Characteristic.Volume.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:162:10) at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:756:20) at Array.forEach (<anonymous>) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:720:8) at HAPServer.emit (events.js:127:13) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10) at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:127:13) at endReadableNT (_stream_readable.js:1101:12) at process._tickCallback (internal/process/next_tick.js:114:19) [2018-3-5 11:21:12] [DACP] [2018-3-5 11:21:12] [DACP] Fatal error while talking to iTunes: [2018-3-5 11:21:12] [DACP] [2018-3-5 11:21:12] [DACP] Error: TypeError: Cannot read property 'host' of undefined at DacpClient._withConnection (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:229:67) at DacpClient.getProperty (/usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:153:23) at SpeakerService._getMute (/usr/local/lib/node_modules/homebridge-dacp/src/SpeakerService.js:98:41) at Characteristic.Mute.emit (events.js:127:13) at Characteristic.Mute.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:162:10) at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:756:20) at Array.forEach (<anonymous>) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:720:8) at HAPServer.emit (events.js:127:13) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10) at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:127:13) at endReadableNT (_stream_readable.js:1101:12) at process._tickCallback (internal/process/next_tick.js:114:19) [2018-3-5 11:21:12] [DACP] [2018-3-5 11:21:12] [DACP] Returning current playback state: paused

Input Controls Missing

Updated to 0.9 last night and tried enabling input controls but had no controls show up in Eve or Home. I've tried unpairing and re-pairing, as well as setting up a separate Apple TV to avoid any accessory cache, but still haven't gotten the input controls to show up at all. Here's my config:

        {
            "platform": "DACP",
            "devices": [
                {
                    "name": "Bedroom Apple TV",
                    "pairing": "VALID",
                    "serviceName": "VALID",
                    "features": {
                        "no-volume-controls": true,
                        "alternate-playpause-switch": true,
                        "alternate-input-controls": true,
                        "album-artwork": "/tmp/nowplaying.png"
                    }
                }
            ]
        }

I tried many other configs to try and get something to show up, but was never able to. Here are some example feature configs I've tried:

"features": {
    "no-volume-controls": true,
    "alternate-input-controls": true
}

"features": {
    "alternate-input-controls": true
}

"features": {
    "input-controls": true
}

"features": {
    "input-controls": ["menu", "topmenu"]
}

Thanks for any support you can provide!

problem installing homebridge-dacp

I am receiving the following error logs after installing homebridge-dacp

an 2 21:12:45 raspberrypi homebridge[668]: [1/2/2018, 9:12:45 PM] ====================
Jan 2 21:12:46 raspberrypi homebridge[668]: [1/2/2018, 9:12:46 PM] ERROR LOADING PLUGIN homebridge-dacp:
Jan 2 21:12:46 raspberrypi homebridge[668]: [1/2/2018, 9:12:46 PM] /usr/local/lib/node_modules/homebridge-dacp/src/dacp/DacpClient.js:22
Jan 2 21:12:46 raspberrypi homebridge[668]: async login(options) {
Jan 2 21:12:46 raspberrypi homebridge[668]: ^^^^^
Jan 2 21:12:46 raspberrypi homebridge[668]: SyntaxError: Unexpected identifier
Jan 2 21:12:46 raspberrypi homebridge[668]: at Object.exports.runInThisContext (vm.js:76:16)
Jan 2 21:12:46 raspberrypi homebridge[668]: at Module._compile (module.js:542:28)
Jan 2 21:12:46 raspberrypi homebridge[668]: at Object.Module._extensions..js (module.js:579:10)
Jan 2 21:12:46 raspberrypi homebridge[668]: at Module.load (module.js:487:32)
Jan 2 21:12:46 raspberrypi homebridge[668]: at tryModuleLoad (module.js:446:12)
Jan 2 21:12:46 raspberrypi homebridge[668]: at Function.Module._load (module.js:438:3)
Jan 2 21:12:46 raspberrypi homebridge[668]: at Module.require (module.js:497:17)
Jan 2 21:12:46 raspberrypi homebridge[668]: at require (internal/module.js:20:19)
Jan 2 21:12:46 raspberrypi homebridge[668]: at Object. (/usr/local/lib/node_modules/homebridge-dacp/src/DacpAccessory.js:6:20)
Jan 2 21:12:46 raspberrypi homebridge[668]: at Module._compile (module.js:570:32)
Jan 2 21:12:46 raspberrypi homebridge[668]: [1/2/2018, 9:12:46 PM] ====================

I uninstalled and reinstalled, verified outdated modules and everything is ok.

Any idea?

Cannot read property 'indexOf' of undefined after pairing (tvOS11.3)

I am trying to get homebridge-dacp to work with my AppleTV runnign tvOS11.3.

I have added

           {
	      "platform": "DACP",
	      "devices": [
	        {
	          "name": "AppleTV",
	          "features": {
	            "alternate-playpause-switch": true
	          }
	        }
	      ]
	    }

and used the passcode to successfully pair it with AppleTV.

I was asked to insert

        {
        	"name": "AppleTV",
        	"pairing": "6B413D0D21623AEC",
        	"serviceName": "ACB0F206EF58248D18A4FC4362CFEEB3050D312E"
        }

into the accessories array.

On restart, homebridge crash with the following TypeError:

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:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

screen shot 2018-04-01 at 16 52 33

Play pause on Apple TV via Home not working

I can't get this to work, I've managed to connect the remote to my Apple TV, everything looks fine in the logs but nothing is happening on my tv. I've enabled alternate-playpause-switch:


"devices": [
                {
                    "name": "New Remote Control",
                    "pairing": "xxxx",
                    "serviceName": "xxxx",
                    "features": {
                        "no-volume-controls": true,
                        "alternate-playpause-switch": true
                    }
                }
            ]

Feb 09 12:42:53 pihole homebridge[3603]: [2018-2-9 12:42:53] [DACP] Setting current playback state: paused
Feb 09 12:42:53 pihole homebridge[3603]: [2018-2-9 12:42:53] [DACP] Playback status update done.

My ATV is on the 10.3 beta, might that be the issue?

How to use the TV/Home button

Hi, is there any way to use the TV/Home button with this plugin? With the Play/Pause button it sometimes do not turn on my TV depending if the Apple TV was already on or just playing music through the AVR with the TV off, instead the TV/Home button always send the HDMI signal to turn on the TV and change the input.

IllegalStateError: Backoff in progress.

I'm attempting to use homebridge-dacp with an Apple TV 4K. Setting up the pairing works, but then I get this…

Any ideas?

Thanks!

[2017-12-12 20:55:30] [DACP] The accessory Homebridge Apple TV Remote is announced.
[2017-12-12 20:55:30] [DACP] Attempting to reconnect to Homebridge Apple TV Remote in 0.1 seconds.
[2017-12-12 20:55:30] [DACP] The accessory Homebridge Apple TV Remote is announced.

/opt/node/lib/node_modules/homebridge-dacp/node_modules/precond/lib/checks.js:15
    throw error;
    ^
IllegalStateError: Backoff in progress.
    at Backoff.backoff (/opt/node/lib/node_modules/homebridge-dacp/node_modules/backoff/lib/backoff.js:38:13)
    at DacpAccessory.accessoryUp (/opt/node/lib/node_modules/homebridge-dacp/src/DacpAccessory.js:131:19)
    at _accessories.forEach.accessory (/opt/node/lib/node_modules/homebridge-dacp/src/index.js:68:19)
    at Array.forEach (<anonymous>)
    at DacpPlatform._onServiceUp (/opt/node/lib/node_modules/homebridge-dacp/src/index.js:66:23)
    at emitOne (events.js:116:13)
    at DacpBrowser.emit (events.js:211:7)
    at Browser._browser.on.service (/opt/node/lib/node_modules/homebridge-dacp/src/dacp/DacpBrowser.js:22:12)
    at emitTwo (events.js:126:13)
    at Browser.emit (events.js:214:7)

Not Supported by Home

I got the plugin up and running and paired. But since it's not possible to control the Apple TV from the Home app directly. Is it possible to get the Play/Pause function to work like a switch in the Home app?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.