postlund / pyatv

A client library for Apple TV and AirPlay devices
https://pyatv.dev
MIT License
838 stars 91 forks source link

Improve documentation on PairingError: <TlvValue.Salt: 2> #2294

Open IsakTheHacker opened 7 months ago

IsakTheHacker commented 7 months ago

What to change?

If I try to pair with a device but fail after multiple attempts (don't know exactly how many), pyatv throws:

PairingError: <TlvValue.Salt: 2>

My suggestion is to change this to something that is easier to understand, such as:

PairingError: Too many failed attempts, try again later!
postlund commented 6 months ago

This is a different error, there actually is a "backoff" error after too many attempts. What kind of device is this?

IsakTheHacker commented 6 months ago

Hmm, that's weird. I'm using a 4th generation Apple TV (not the 4K model). One additional thing of note is that the pincode actually is displayed on the screen, but I'm not able to perform pairing since the exception is thrown when calling PairingHandler.begin() in the pyatv API.

postlund commented 6 months ago

Yes, now when I look at it, it looks a bit a strange. This suggests that the Apple TV does not include the salt value but also not any error. Can you run with --debug and include the logs?

IsakTheHacker commented 6 months ago

Where should I pass the --debug option? To atvremote?

My setup is quite involved so I don't know if the same error would appear when using the command line utilities. Is it possible to turn on debug logging when using the API?

postlund commented 6 months ago

Sure, should be something like logging.getLogger("pyatv").setLevel(logging.DEBUG).