lukasroegner / homebridge-apple-tv-remote

Plugin for controlling Apple TVs in homebridge.
MIT License
132 stars 13 forks source link

Cannot connect to Apple TV #23

Closed Deteorek closed 4 years ago

Deteorek commented 4 years ago

After Homebridge start I've got this error "[4/15/2020, 6:41:34 PM] [AppleTvPlatform] [TV Room] Error while connecting: Error: Apple TV not found while scanning."

My apple tv is successful pairing with "appletv pair" command and all credentials copied to config.json. Apple TV is running and connected to lan by cable. What could be wrong?

lukasroegner commented 4 years ago

Sometimes, the Apple TV is not found in the first round of scanning. The plugin continuously retries to find the Apple TV in the network. You should see the retries in the logs.

Deteorek commented 4 years ago

After 10 hours continuous working of Homebridge still the same error :-( Apple TV has reserved ip address and is full operational with online connection.

lukasroegner commented 4 years ago

Did you search for the Apple TV with appletv pair on the host machine of homebridge? Does the host machine of homebridge have access to the network or is there any firewall settings?

Deteorek commented 4 years ago

Yes, but I cannot find it so I ran this command on my mac. My host machine with homebridge is raspberry pi with lan and internet access.

lukasroegner commented 4 years ago

I would suggest to run appletv pair on the Raspberry, just to make sure that there is no issue with the LAN connectivity (run npm install -g node-appletv-x on the Raspberry to install the appletv command line tool)

Deteorek commented 4 years ago

OK. So the problem was VPN runing on the Raspberry. When I turned it off I could detect Apple TV. Do you think there is any way for the plugin to work when VPN is enabled?

lukasroegner commented 4 years ago

No. The underlying library for communication with the Apple TV has no option to specify the network interface.

Deteorek commented 4 years ago

OK. Thank you for your help and great work with your plugin.