openairplay / airplay2-receiver

AirPlay 2 Receiver - Python implementation
2.15k stars 134 forks source link

FileNotFoundError: [Errno 2] No such file or directory: './pairings/ltsk.txt' #45

Closed najihun closed 3 years ago

najihun commented 3 years ago

Build was success, but got an keypair related error as below when tried to run it.

What did I miss something ?

Generating new ed25519 keypair for b'aa5cb8df-7f14-4249-901a-5e748ce57a93' Traceback (most recent call last): File "ap2-receiver.py", line 213, in LTPK = LTPK() File "ap2-receiver.py", line 178, in init announce_id, self.ltpk = Hap(PI).configure() File "/airplay2/ap2/pairing/hap.py", line 335, in init encryption_algorithm=serialization.NoEncryption() File "/airplay2/ap2/pairing/hap.py", line 273, in set_ltsk self.set_bytes(_id, 'LTSK', _value) File "/airplay2/ap2/pairing/hap.py", line 199, in set_bytes _val File "/airplay2/ap2/pairing/hap.py", line 176, in create_entry self.json_handler.put_store(self.store) File "/airplay2/ap2/pairing/hap.py", line 155, in put_store self.save_store() File "/airplay2/ap2/pairing/hap.py", line 158, in save_store self.save_json(self.store, self.path) File "/airplay2/ap2/pairing/hap.py", line 142, in save_json with open(path, mode="w", encoding="utf-8") as f: FileNotFoundError: [Errno 2] No such file or directory: './pairings/ltsk.txt'

Hanfrey commented 3 years ago

Build was success, but got an keypair related error as below when tried to run it.

What did I miss something ?

Generating new ed25519 keypair for b'aa5cb8df-7f14-4249-901a-5e748ce57a93' Traceback (most recent call last): File "ap2-receiver.py", line 213, in LTPK = LTPK() File "ap2-receiver.py", line 178, in init announce_id, self.ltpk = Hap(PI).configure() File "/airplay2/ap2/pairing/hap.py", line 335, in init encryption_algorithm=serialization.NoEncryption() File "/airplay2/ap2/pairing/hap.py", line 273, in set_ltsk self.set_bytes(_id, 'LTSK', _value) File "/airplay2/ap2/pairing/hap.py", line 199, in set_bytes _val File "/airplay2/ap2/pairing/hap.py", line 176, in create_entry self.json_handler.put_store(self.store) File "/airplay2/ap2/pairing/hap.py", line 155, in put_store self.save_store() File "/airplay2/ap2/pairing/hap.py", line 158, in save_store self.save_json(self.store, self.path) File "/airplay2/ap2/pairing/hap.py", line 142, in save_json with open(path, mode="w", encoding="utf-8") as f: FileNotFoundError: [Errno 2] No such file or directory: './pairings/ltsk.txt'

Same error for me.

systemcrash commented 3 years ago

@najihun @Hanfrey VM/docker? In which case, try the 'fix' in https://github.com/openairplay/airplay2-receiver/issues/43#issuecomment-886277837

Hanfrey commented 3 years ago

@najihun @Hanfrey VM/docker? In which case, try the 'fix' in #43 (comment)

Hi, had now a deeper look in the fix then monday. The Volume Path in the docker-compose is wrong. sudo docker run -it --rm --device /dev/snd --env AP2IFACE=eth0 --volume /home/pi/Downloads/airplay2-receiver/pairings/:/airplay2/pairings/ --net host invano/ap2-receiver

does start the container now. I can connect, and he does plays music, but the song is distorted. Im on a Rasp 4

systemcrash commented 3 years ago

Updated README with instructions which resolve this issue.

systemcrash commented 3 years ago

see 2aa2613