RTSP/1.0 method SETUP failed with code 520: Origin Error
See original GitHub issueDescribe the bug
Can’t stream anything to Homepod mini, eg tts or radio browser.
Error log
Full log: https://pastebin.com/V4u59p8v
2022-11-25 21:03:23.676 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140291987056976] RTSP/1.0 method SETUP failed with code 520: Origin Error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/apple_tv/media_player.py", line 292, in async_play_media
await self.atv.stream.stream_file(media_id)
File "/usr/local/lib/python3.10/site-packages/pyatv/core/facade.py", line 392, in stream_file
await self.relay("stream_file")(file, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/raop/__init__.py", line 352, in stream_file
await client.initialize(self.core.service.properties)
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/raop/raop.py", line 457, in initialize
await self._setup_session()
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/raop/raop.py", line 486, in _setup_session
resp = await self.rtsp.setup(
File "/usr/local/lib/python3.10/site-packages/pyatv/support/rtsp.py", line 181, in setup
return await self.exchange("SETUP", headers=headers, body=body)
File "/usr/local/lib/python3.10/site-packages/pyatv/support/rtsp.py", line 265, in exchange
resp = await self.connection.send_and_receive(
File "/usr/local/lib/python3.10/site-packages/pyatv/support/http.py", line 414, in send_and_receive
raise exceptions.HttpError(
pyatv.exceptions.HttpError: RTSP/1.0 method SETUP failed with code 520: Origin Error
How to reproduce the bug?
Go the the apple tv integration in Home Assistant Select the media player entity Browse media Select TTS Google/Microsoft (both don’t work) Keep the sample text and press play
What is expected behavior?
TTS to work 😃
Operating System
Home Assistant Container (docker on Ubuntu)
Python
3.10
pyatv
0.10.3
Device
Homepod mini, 16.1
Additional context
N/A
Issue Analytics
- State:
- Created 10 months ago
- Comments:5
Top Results From Across the Web
How to Fix "Error 520: Web Server Is Returning an Unknown ...
This problem occurs when your site lacks an HTTP status code or response body. To resolve it, make sure your DNS settings are...
Read more >Cloudflare Error 520: How to Troubleshoot and Fix It - Hostinger
It may occur either because the origin server is running a resource-intensive script or didn't interpret requests properly. Consequently, the ...
Read more >Community Tip - Fixing Error 520: Web server is returning an ...
A 520 error occurs when the connection started on the origin web server, but that the request was not completed. The most common...
Read more >How to Fix Cloudflare Error 520: Web Server is Returning an ...
Cloudflare Error 520 is a server-side diagnostic message indicating that even though a request reached the origin web server, the server ...
Read more >[Solved] Error 520: Web Server Is Returning an Unknown Error
Empty response from the origin web server that lacks an HTTP status code or response body. Now you know what caused the 520...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve done a bit more digging, using
atvremote
, and by listing features, I can see that PlayUrl is not supported. On the other hand, I can get it to play using stream_file. Is there a way to change what method the media player uses to cast to homepod?Okay so all this thing is a bit over my head, but from what I’m getting, the heartbeat fails.
pyatv/protocols/airplay/remote_control.py:82
- that_failure_func
is the only invocation ofpyatv.protocols.raop.raop.ControlClient.connection_lost
that doesn’t check for NoneThe last heartbeat I’m seeing isn’t consistent, but it’s in the first 15-ish.
Which empirically makes sense, as I’m hearing a tiny under-half-second-long purr when I hit play. Looking at the logs, I assume the first packet of data had just been sent, then the HomePod sends back the 520. Weird that it works on my Raspberry Pi but not on the Pi inside docker :-?
Anyway, that’s all my tired neuron can figure out for now, hopefully @postlund or one of the other contributors can make sense of this.