Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple TV 12.1.1 compatibility #59

Closed
wants to merge 2 commits into from
Closed

Apple TV 12.1.1 compatibility #59

wants to merge 2 commits into from

Conversation

johninaustin
Copy link

Apple now validates the user agent. Use "Remote/1021".

Apple TV OS 12.1.1 now validates the user agent.  Set to "Remote/1021"
@nievamarenostrum
Copy link

where do I have to use that command, in the configure.json?

@johninaustin
Copy link
Author

You update the DacpConnection.js file, changing the User-Agent... it's part of this pull request.

@DBabs1
Copy link

DBabs1 commented Dec 18, 2018

where do I have to use that command, in the configure.json?

If anyone wants to rush this into a homebridge running on a pi, the path to the file is /usr/local/lib/node_modules/homebridge-dacp/sr/dacp/ adding the one line from Johninaustin fixes the issue after a reboot of homebridge.

@nievamarenostrum
Copy link

tested and working. Thank you!

@sidjohn1
Copy link

sidjohn1 commented Jan 3, 2019

I've also made the change and it worked like a champ!

@damianromanowski
Copy link

Can confirm this fixes #60 and probably #58 as well.

@CooperCGN
Copy link

The fix worked for me until today. I have no idea where it comes from, either the Homebridge update or the latest tvOS 12.1.2 but I suddenly get the following error in homebridge and the accessory is shown as not responding in the Home app.

[2019-1-26 09:44:01] [DACP] Starting DACP browser...
[2019-1-26 09:44:01] Homebridge is running on port 51847.
[2019-1-26 09:44:03] [DACP] The accessory Apple TV is announced as 10.0.1.38:3689.
[2019-1-26 09:44:03] [DACP] It's an AppleTV6,2 named Wohnzimmer
[2019-1-26 09:44:03] [DACP] Attempting to reconnect to Apple TV in 0.1 seconds.
[2019-1-26 09:44:03] [DACP] Connecting to Apple TV (10.0.1.38:3689)
[2019-1-26 09:44:03] [DACP] Creating status connection to 10.0.1.38:3689
Established connection to 10.0.1.38:3689 with session ID 3
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:50:9)
    at Buffer.readIntBE (internal/buffer.js:333: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:189:13)
    at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:189:13)
[2019-1-26 09:44:05] [DACP] Connected to Wohnzimmer
[2019-1-26 09:44:12] [Config] Using Form Authentication
[2019-1-26 09:44:12] [Config] Console v3.9.4 is listening on port 8086.
[2019-1-26 09:45:51] [DACP] Returning current playback state: paused

@Carl05M
Copy link

Carl05M commented Mar 5, 2019

I manually edited Dacpconnection.js as described.

The DACP switch works in Home app to control play-pause but does not report status change if play/pause activated by bluetooth AppleTV remote or iOS controller.

Log reports the same error as CooperCGN when trying to use alternate-playpause-switch.

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:58:9) at Buffer.readIntBE (internal/buffer.js:341: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:197:13) at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1161:10) at Request.emit (events.js:197:13) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-dacp/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:285:13) at IncomingMessage.emit (events.js:202:15) at endReadableNT (_stream_readable.js:1129:12) at processTicksAndRejections (internal/process/next_tick.js:76:17) [3/5/2019, 5:11:14 PM] [DACP] Connected to Lounge

Log shows playback status changing.

[3/5/2019, 5:11:43 PM] [DACP] Returning current playback state: paused [3/5/2019, 5:11:54 PM] [DACP] Setting current playback state: playing [3/5/2019, 5:11:54 PM] [DACP] Creating properties connection to 192.168.1.30:3689 [3/5/2019, 5:11:54 PM] [DACP] Playback status update done. [3/5/2019, 5:11:57 PM] [DACP] Setting current playback state: playing [3/5/2019, 5:11:57 PM] [DACP] Playback status update done. [3/5/2019, 5:12:41 PM] [DACP] Setting current playback state: playing [3/5/2019, 5:12:41 PM] [DACP] Playback status update done. [3/5/2019, 5:12:42 PM] [DACP] Setting current playback state: playing [3/5/2019, 5:12:42 PM] [DACP] Playback status update done.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants