maxileith / homebridge-appletv-enhanced

Homebridge plugin that exposes Apple TVs with features that should be native to Apple HomeKit.
MIT License
125 stars 1 forks source link

Python Error #395

Open bonnorbolby opened 2 weeks ago

bonnorbolby commented 2 weeks ago

Preconditions

Current Situation

I began having issues with my Apple TV, which caused me to have to factory reset it - and my ATV Enhanced got disconnected. I went to reconnect it and suddenly I'm in a loop that I don't quite understand. Is this because I had previously connected to this ATV? Help I'm completely lost.

Logs

Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 792-21-571 │     
    └────────────┘     

[01/05/2024, 18:18:38] Homebridge v1.8.1 (HAP v0.12.0) (Homebridge A541) is running on port 51762.
[01/05/2024, 18:18:38] [Apple TV Enhanced] [I] Update check: You are using the latest version of AppleTV Enhanced (excluding betas): 1.3.1
[01/05/2024, 18:18:38] [Apple TV Enhanced] [I] Python check: Starting python check.
[01/05/2024, 18:18:38] [Apple TV Enhanced] [I] Python check: plugin dir exists.
[01/05/2024, 18:18:38] [Apple TV Enhanced] [I] Python check: Python 3.11.2 is installed and supported by the plugin.
[01/05/2024, 18:18:38] [Apple TV Enhanced] [I] Python check: Virtual environment already exists.
[01/05/2024, 18:18:38] [Apple TV Enhanced] [I] Python check: Venv is using current system python version (3.11.2).
[01/05/2024, 18:18:39] [Apple TV Enhanced] [I] Python check: Venv pip version: 24.0
[01/05/2024, 18:18:39] [Apple TV Enhanced] [I] Python check: Checking if there is an update for venv pip ...
[01/05/2024, 18:18:40] [Apple TV Enhanced] [I] Python check: Venv pip is up-to-date
[01/05/2024, 18:18:41] [Apple TV Enhanced] [I] Python check: Python requirements are satisfied.
[01/05/2024, 18:18:41] [Apple TV Enhanced] [I] Python check: Finished
[01/05/2024, 18:18:41] [Apple TV Enhanced] [I] Platform: Starting device discovery ...
[01/05/2024, 18:18:41] [PhilipsHueSyncBoxPlatform] Error while communicating with the Sync Box. Error: Error: connect EHOSTUNREACH 192.168.1.32:443
[01/05/2024, 18:18:41] [PhilipsHueSyncBoxPlatform] Error while getting the state. Please check the access token.
[01/05/2024, 18:18:47] [Apple TV Enhanced] [I] Platform: Adding Apple TV Living Room TV (A8:51:AB:96:93:4B)
[01/05/2024, 18:18:47] [Apple TV Enhanced] [I] Living Room TV (A8:51:AB:96:93:4B): verifying credentials ...
[01/05/2024, 18:18:49] [Apple TV Enhanced] [E] Living Room TV (A8:51:AB:96:93:4B): Unable to execute request L: Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 71, in error_handler
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 120, in _setup_encryption
    await pair_verifier.verify_credentials()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/auth.py", line 150, in verify_credentials
    encrypted_data = self.srp.verify1(self.credentials, server_pub_key, encrypted)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/auth/hap_srp.py", line 101, in verify1
    raise exceptions.AuthenticationError("incorrect device response")
pyatv.exceptions.AuthenticationError: incorrect device response

The above exception was the direct cause of the following exception:Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 978, in _run_application
    return await cli_handler(loop)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 723, in cli_handler
    return await _handle_commands(args, config, storage, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 851, in _handle_commands
    atv = await connect(config, loop, protocol=args.protocol, storage=storage)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/__init__.py", line 155, in connect
    await atv.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/core/facade.py", line 684, in connect
    if await setup_data.connect():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 571, in _connect
    await api.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 143, in connect
    await self._protocol.start()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 108, in start
    await error_handler(self._setup_encryption, exceptions.AuthenticationError)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 77, in error_handler
    raise fallback(str(ex)) from ex
pyatv.exceptions.AuthenticationError: incorrect device response

>>> An error occurred, full stack trace above
[01/05/2024, 18:18:49] [Apple TV Enhanced] [E] Living Room TV (A8:51:AB:96:93:4B): Error: Unable to execute request L: Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 71, in error_handler
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 120, in _setup_encryption
    await pair_verifier.verify_credentials()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/auth.py", line 150, in verify_credentials
    encrypted_data = self.srp.verify1(self.credentials, server_pub_key, encrypted)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/auth/hap_srp.py", line 101, in verify1
    raise exceptions.AuthenticationError("incorrect device response")
pyatv.exceptions.AuthenticationError: incorrect device response

The above exception was the direct cause of the following exception:Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 978, in _run_application
    return await cli_handler(loop)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 723, in cli_handler
    return await _handle_commands(args, config, storage, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 851, in _handle_commands
    atv = await connect(config, loop, protocol=args.protocol, storage=storage)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/__init__.py", line 155, in connect
    await atv.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/core/facade.py", line 684, in connect
    if await setup_data.connect():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 571, in _connect
    await api.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 143, in connect
    await self._protocol.start()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 108, in start
    await error_handler(self._setup_encryption, exceptions.AuthenticationError)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 77, in error_handler
    raise fallback(str(ex)) from ex
pyatv.exceptions.AuthenticationError: incorrect device response

>>> An error occurred, full stack trace above
    at /var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/src/lib/tools.ts:172:15
    at Generator.next (<anonymous>)
    at o (/var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/dist/lib/index.cjs:1:627)
[01/05/2024, 18:18:49] [HB Supervisor] Homebridge Process Ended. Code: 1, Signal: null
[01/05/2024, 18:18:54] [HB Supervisor] Restarting Homebridge...

Configuration

{
    "name": "Apple TV Enhanced",
    "mediaTypes": [
        "tv"
    ],
    "deviceStates": [
        "idle",
        "paused",
        "playing"
    ],
    "deviceStateDelay": 0,
    "avadaKedavraAppAmount": 15,
    "disableVolumeControlRemote": false,
    "setTopBox": false,
    "discover": {
        "multicast": true
    },
    "forceVenvRecreate": false,
    "logLevel": 3,
    "updateCheckLevel": "stable",
    "deviceSpecificOverrides": [
        {
            "overrideMediaTypes": false,
            "overrideDeviceStates": false,
            "overrideDeviceStateDelay": false,
            "deviceStateDelay": 0,
            "overrideRemoteKeysAsSwitch": false,
            "overrideAvadaKedavraAppAmount": false,
            "avadaKedavraAppAmount": 15,
            "overrideCustomInputURIs": false,
            "overrideDisableVolumeControlRemote": false,
            "disableVolumeControlRemote": false,
            "overrideSetTopBox": false,
            "setTopBox": false
        }
    ],
    "platform": "AppleTVEnhanced"
}

Operating System

Linux

Operating System: Bits

64-bit

Operating System: Distribution

Raspberry Pi OS

Operating System: Distribution Version

12 (bookworm)

Docker

no

Docker Image

None

Docker Image Tag

No response

Homebridge Version

1.8.1

Homebridge Config UI Version

4.56.2

Homebridge Storage Path

/var/lib/homebridge

Homebridge Apple TV Enhanced Version

1.3.1

Node Version

20.12.2

NPM Version

10.5.0

Python Version

3.11.2

PIP Version

23.0.1

HDMI Hops

Hue Sync Box

Audio Output

no

Same Subnet

yes

Additional Context

No response

github-actions[bot] commented 2 weeks ago

❗ Action required

There are a few problems with your opened issue. Please fix them by editing the issue:

Often the problem you are experiencing will be solved by simply making your environment compliant with the requirements (fulfilling the pre-checks).

Don't expect a reply of a maintainer until you have solved the above mentioned action items.

🔁 Rerun

After editing the issue, the checks will be run again.

Under no circumstances should the issue be adjusted untruthfully. If the issue cannot fulfill the pre-checks, your environment is simply not supported.

If you do not adjust the issue accordingly, the issue will be automatically closed after 14 days of inactivity.

github-actions[bot] commented 2 days ago

This issue is stale because it has been open for 14 days with no activity.