maxileith / homebridge-appletv-enhanced

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

The plugin stucks in restart loop #467

Closed mkizzle2906 closed 1 day ago

mkizzle2906 commented 2 weeks ago

Preconditions

Current Situation

I used it normally until last week everything of this plugin show No Response in Home app. I check the log and it show the plugin keeps restarting. I tried remove accessories in Home app and reinstall the plugin but nothing works

Logs

Log in attach file

Configuration

{
    "name": "Apple TV Enhanced",
    "deviceStates": [
        "playing"
    ],
    "deviceStateDelay": 0,
    "avadaKedavraAppAmount": 15,
    "disableVolumeControlRemote": false,
    "setTopBox": false,
    "discover": {
        "multicast": true
    },
    "forceVenvRecreate": false,
    "logLevel": 4,
    "updateCheckLevel": "stable",
    "deviceSpecificOverrides": [
        {
            "mac": "50:DE:06:A0:7D:3D",
            "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",
    "_bridge": {
        "username": "0E:4D:27:5E:7D:3C",
        "port": 46458
    }
}

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.3

Homebridge Config UI Version

v4.56.2

Homebridge Storage Path

/var/lib/homebridge

Homebridge Apple TV Enhanced Version

1.4.0

Node Version

v20.15.0

NPM Version

10.2.4

Python Version

3.11.2

PIP Version

23.0.1

HDMI Hops

No response

Audio Output

no

Same Subnet

yes

Additional Context

homebridge-appletv-enhanced.log.txt

mkizzle2906 commented 2 weeks ago

Anyone know how to fix this ? I tried removing then reinstall the plugin, even format sd card and reinstall the whole homebridge but this error still happens

maxileith commented 2 weeks ago

Please send verbose logs.

mkizzle2906 commented 2 weeks ago

Please send verbose logs.

how can I get it ? I attach the log above

maxileith commented 2 weeks ago

Set the log level to verbose in the settings

mkizzle2906 commented 2 weeks ago

Here it is homebridge-appletv-enhanced.log.txt

philmue1988 commented 1 week ago

Facing the Same Problem as soon as i have more than 1 ATV connected

I also have the problem that my Bridge just hangs up from time to time. As soon as I delete the plugin, this no longer happens.

I also used the plugin as a child bridge

After We Starting the bridge Works normal for period of time

maxileith commented 1 week ago

@mkizzle2906 Could you please send me the output of ls -la /var/lib/homebridge/appletv-enhanced/50DE06A07D3D

mkizzle2906 commented 1 week ago

ls -la /var/lib/homebridge/appletv-enhanced/50DE06A07D3D

Here it is

total 24
drwxr-xr-x 2 pi pi 4096 Jun 22 04:19 .
drwxr-xr-x 4 pi pi 4096 Jun 22 04:29 ..
-rw-r--r-- 1 pi pi    0 Jun 22 04:19 apps.json
-rw-r--r-- 1 pi pi   38 Jun 22 04:19 common.json
-rw-r--r-- 1 pi pi  275 Jun 22 04:19 credentials.txt
-rw-r--r-- 1 pi pi    2 Jun 22 04:19 deviceStates.json
-rw-r--r-- 1 pi pi    2 Jun 22 04:19 mediaTypes.json
maxileith commented 1 week ago

Which user are you using to run homebridge?

mkizzle2906 commented 1 week ago

Which user are you using to run homebridge?

I'm using pi

maxileith commented 1 week ago

What's the content of /var/lib/homebridge/appletv-enhanced/50DE06A07D3D/appConfigs.json?

mkizzle2906 commented 1 week ago

/var/lib/homebridge/appletv-enhanced/50DE06A07D3D/

there is no appConfigs.json. There are only apps.json common.json credentials.txt deviceStates.json mediaTypes.json

mkizzle2906 commented 1 week ago

What's the content of /var/lib/homebridge/appletv-enhanced/50DE06A07D3D/appConfigs.json?

is there any way to fix it ?

maxileith commented 1 week ago

Sorry my bad, could you send the content of apps.json?

mkizzle2906 commented 1 week ago

Sorry my bad, could you send the content of apps.json?

there is nothing in that file 🥲

maxileith commented 1 week ago

Can you stop the plugin, remove the file and restart the plugin?

mkizzle2906 commented 1 week ago

Can you stop the plugin, remove the file and restart the plugin?

remove that apps.json file or the whole folder ?

mkizzle2906 commented 1 week ago

Can you stop the plugin, remove the file and restart the plugin?

hey I tried remove that folder and restart the plugin. The log shows the paring link and I follow that enter the pin, then it said add the apple tv... manually in Home app. I add it by enter the code in home app but it doesn't show the apple TV to add (the Samsung TV in the video is another plugin)

https://github.com/maxileith/homebridge-appletv-enhanced/assets/32402155/c7dc5ecc-7ec7-4247-92e9-46d56683d1a2

Here is the log homebridge-appletv-enhanced.log (1).txt

EDIT: I delete the cache appletv in homebridge and now I can add it again. Thanks !!!

maxileith commented 1 day ago

Hi @mkizzle2906,

thank you for the response. I have fixed the bug where the plugin ends up in an infinte restart loop when there are empty config files like apps.json in version v.1.4.3-0