postlund / pyatv

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

atvremote homepod mini #2356

Closed Epik77 closed 2 months ago

Epik77 commented 3 months ago

Describe the bug

After upgrade firmware homepod mini 17.3 atvremote not works

Error log


Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/pyatv/scripts/atvremote.py", line 978, in _run_application
    return await cli_handler(loop)
  File "/usr/local/lib/python3.9/dist-packages/pyatv/scripts/atvremote.py", line 723, in cli_handler
    return await _handle_commands(args, config, storage, loop)

  File "/usr/local/lib/python3.9/dist-packages/pyatv/scripts/atvremote.py", line 862, in _handle_commands
    ret = await _handle_device_command(args, cmd, atv, storage, loop)
  File "/usr/local/lib/python3.9/dist-packages/pyatv/scripts/atvremote.py", line 916, in _handle_device_command
    return await _exec_command(atv.stream, cmd, True, *cmd_args)
  File "/usr/local/lib/python3.9/dist-packages/pyatv/scripts/atvremote.py", line 945, in _exec_command
    value = await tmp(*args)
  File "/usr/local/lib/python3.9/dist-packages/pyatv/core/facade.py", line 371, in stream_file
    await self.relay("stream_file")(
  File "/usr/local/lib/python3.9/dist-packages/pyatv/protocols/raop/__init__.py", line 356, in stream_file
    await client.initialize(self.core.service.properties)
  File "/usr/local/lib/python3.9/dist-packages/pyatv/protocols/raop/stream_client.py", line 337, in initialize
    await self._protocol.setup(self.timing_server.port, self.control_client.port)

  File "/usr/local/lib/python3.9/dist-packages/pyatv/protocols/raop/protocols/airplayv2.py", line 108, in setup
    await self._setup_base(timing_server_port)
  File "/usr/local/lib/python3.9/dist-packages/pyatv/protocols/raop/protocols/airplayv2.py", line 51, in _setup_base
    self._verifier = await verify_connection(
  File "/usr/local/lib/python3.9/dist-packages/pyatv/protocols/airplay/auth/__init__.py", line 104, in verify_connection
    has_encryption_keys = await verifier.verify_credentials()
  File "/usr/local/lib/python3.9/dist-packages/pyatv/protocols/airplay/auth/hap_transient.py", line 48, in verify_credentials
    await self.http.post("/pair-pin-start", headers=_AIRPLAY_HEADERS)
  File "/usr/local/lib/python3.9/dist-packages/pyatv/support/http.py", line 432, in post
    return await self.send_and_receive(
  File "/usr/local/lib/python3.9/dist-packages/pyatv/support/http.py", line 495, in send_and_receive
    raise exceptions.HttpError(
pyatv.exceptions.HttpError: HTTP/1.1 method POST failed with code 400: Bad Request

How to reproduce the bug?

atvremote --id XXXXXX stream_file=/opt/sound/non_definito.mp3

What is expected behavior?

play an mp3 song on the homepod mini

Operating System

Linux

Python

3.9

pyatv

0.14.5

Device

homepod mini 17.3

Additional context

No authentication is set on the device

postlund commented 3 months ago

That's interesting. Are you on the same network as the HomePod, e.g. no firewalls or VLANs in between?

Epik77 commented 3 months ago

yes they are in the same network no firewall or vlan atvremote scan: Name: Camera Model/SW: HomePod Mini, tvOS 17.3 Address: 192.168.2.75 MAC: x.x.x.x.x Deep Sleep: False Identifiers:

Epik77 commented 2 months ago

I solved it by reinstalling the home app and Follow instructions under Allow others to access your AirPlay 2-enabled speakers and TVs, pick Anyone on the same network https://pyatv.dev/support/troubleshooting/#pairing-disabled