Pair Setup fails - 'Hap' object has no attribute 'getDevicePassword'
Closed this issue · 5 comments
The problem
attempting to connect iPhone 13 to airplay2-receiver running on Mac - just testing to see if I can create a viable home-amplifier setup with this software.
[HAP]: ----- Pair-Setup [1/2]
----------------------------------------
Exception occurred during processing of request from ('192.168.50.62', 52271)
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 683, in process_request_thread
self.finish_request(request, client_address)
File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Users/kevin/work/airplay2-receiver/ap2-receiver.py", line 341, in __init__
http.server.BaseHTTPRequestHandler.__init__(self, socket, client_address, server)
File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 747, in __init__
self.handle()
File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 427, in handle
self.handle_one_request()
File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 413, in handle_one_request
method()
File "/Users/kevin/work/airplay2-receiver/ap2-receiver.py", line 487, in do_POST
self.dispatch()
File "/Users/kevin/work/airplay2-receiver/ap2-receiver.py", line 359, in dispatch
getattr(self, self.HANDLERS[self.command][path])()
File "/Users/kevin/work/airplay2-receiver/ap2-receiver.py", line 978, in handle_pair_setup
self.handle_pair_SV('setup')
File "/Users/kevin/work/airplay2-receiver/ap2-receiver.py", line 991, in handle_pair_SV
res = self.hap.pair_setup(body)
File "/Users/kevin/work/airplay2-receiver/ap2/pairing/hap.py", line 534, in pair_setup
res = self.pair_setup_m1_m2()
File "/Users/kevin/work/airplay2-receiver/ap2/pairing/hap.py", line 908, in pair_setup_m1_m2
pin = self.getDevicePassword()
AttributeError: 'Hap' object has no attribute 'getDevicePassword'
What commit exhibits the issue?
Was there a last known working commit?
No response
What type of installation are you running?
direct (via python3
)
With which python3 version do you run Receiver?
3.9.12
OS the receiver runs on
macOS
OS the sender runs
monterey
Which sender client was used
iPhone - just connecting from control center
Command invocation
python ap2-receiver.py -m myap2 --netiface=en0 --debug
Please include --debug output which helps to illustrate the problem
[AP2Handler: 192.168.50.216:7000<=>192.168.50.62:52288; Thread-2]: {'qualifier': ['txtAirPlay']}
[AP2Handler: 192.168.50.216:7000<=>192.168.50.62:52288; Thread-2]: Sending our device info
[AP2Handler: 192.168.50.216:7000<=>192.168.50.62:52288; Thread-2]: {'audioLatencies': [{'inputLatencyMicros': 0, 'outputLatencyMicros': 400000}],
'deviceID': 'f4:d4:88:87:c7:6b',
'features': 495880824111616,
'keepAliveLowPower': True,
'keepAliveSendStatsAsBody': True,
'manufacturer': 'OpenAirplay',
'model': 'Receiver',
'name': None,
'nameIsFactoryDefault': False,
'pi': 'aa5cb8df-7f14-4249-901a-5e748ce57a93',
'protocolVersion': '1.1',
'sdk': 'AirPlay;2.0.2',
'sourceVersion': '366.0',
'statusFlags': '0x4'}
[AP2Handler: 192.168.50.216:7000<=>192.168.50.62:52288; Thread-2]: POST: /pair-setup
[AP2Handler: 192.168.50.216:7000<=>192.168.50.62:52288; Thread-2]:
[AP2Handler: 192.168.50.216:7000<=>192.168.50.62:52288; Thread-2]: X-Apple-AbsoluteTime: 671507131
X-Apple-HKP: 4
X-Apple-Client-Name: The Remote
Content-Length: 9
Content-Type: application/x-apple-binary-plist
CSeq: 1
User-Agent: AirPlay/610.19.1
[HAP] logging level: DEBUG
Additional information
No response
I'm also seeing this issue. Running Ubuntu Server 21.10 with a direct install on Python 3.9.7. Testing with an iPhone. I'm happy to test anything if needed. My stack trace is basically identical to the one posted above.
Having same issue. Running Windows 11 21H2 with direct install on Python 3.10.4. Happy to hear updates.
Same issue on my side, with Macos Catalina and Python 3.9.13
same issue here, running anaconda3 on windows 10.
...
\airplay2-receiver\ap2\pairing\hap.py", line 908, in pair_setup_m1_m2
pin = self.getDevicePassword()
AttributeError: 'Hap' object has no attribute 'getDevicePassword'
i'd be glad for any hint.
Fixed with #63