Closed alanyeah closed 2 months ago
Looks like a problem with pyatv to me, not with pyatv-mqtt-bridge. Could it be that this is the same problem? If not please open a ticket there, I can't offer support for pyatv here. If you have problems directly with pyatv-mqtt-bridge and pyatv works, please contact me again.
Hello,
I have installed the pyatv-mqtt-bridge. I can not connect to my Apple TV 4K (gen 3), tvOS 18.0.
1. I get this MSG:
`# pyatv-mqtt-bridge
[info][192.168.0.133] Setup device… [info][192.168.0.133] [node-pyatv][38] Start listeing to events from device ATV [info][192.168.0.133] [node-pyatv][38] atvscript -s 192.168.0.133 -i xxxx --airplay-credentials xxxxx push_updates [info][192.168.0.133] [node-pyatv][38] stderr: Traceback (most recent call last): File "/usr/local/bin/atvscript", line 5, in
from pyatv.scripts.atvscript import main
[info][192.168.0.133] [node-pyatv][38] Traceback (most recent call last):
File "/usr/local/bin/atvscript", line 5, in
from pyatv.scripts.atvscript import main
[error][192.168.0.133] Push Error: Error: Got stderr output from pyatv: Traceback (most recent call last): File "/usr/local/bin/atvscript", line 5, in
from pyatv.scripts.atvscript import main
File "/usr/local/bin/atvscript", line 5, in
from pyatv.scripts.atvscript import main
[info][192.168.0.133] [node-pyatv][38] stderr: File "/usr/local/lib/python3.12/site-packages/pyatv/init.py", line 26, in
from pyatv.protocols import PROTOCOLS
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/init.py", line 10, in
from pyatv.protocols import airplay as airplay_proto
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/airplay/init.py", line 28, in
from pyatv.protocols import mrp
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/init.py", line 60, in
from pyatv.protocols.mrp import messages, protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/messages.py", line 9, in
from pyatv.protocols.mrp import protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/init.py", line 9, in
from . import AudioFadeMessage_pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/AudioFadeMessage_pb2.py", line 15, in
from pyatv.protocols.mrp.protobuf import PlayerPath_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_PlayerPathpb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/PlayerPath_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import Origin_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_Origin pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/Origin_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import DeviceInfoMessage_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_DeviceInfoMessagepb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/DeviceInfoMessage_pb2.py", line 24, in
pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_ProtocolMessagepb2.ProtocolMessage.RegisterExtension(deviceInfoMessage)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'ProtocolMessage' has no attribute 'RegisterExtension'
[info][192.168.0.133] [node-pyatv][38] File "/usr/local/lib/python3.12/site-packages/pyatv/init.py", line 26, in
from pyatv.protocols import PROTOCOLS
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/ init__.py", line 10, in
from pyatv.protocols import airplay as airplay_proto
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/airplay/ init.py", line 28, in
from pyatv.protocols import mrp
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/ init.py", line 60, in
from pyatv.protocols.mrp import messages, protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/messages.py", line 9, in
from pyatv.protocols.mrp import protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/ init.py", line 9, in
from . import AudioFadeMessage_pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/AudioFadeMessage_pb2.py", line 15, in
from pyatv.protocols.mrp.protobuf import PlayerPath_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_PlayerPathpb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/PlayerPath_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import Origin_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_Origin pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/Origin_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import DeviceInfoMessage_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_DeviceInfoMessage__pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/DeviceInfoMessage_pb2.py", line 24, in
pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_ProtocolMessage pb2.ProtocolMessage.RegisterExtension(deviceInfoMessage)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'ProtocolMessage' has no attribute 'RegisterExtension'
[error][192.168.0.133] Push Error: Error: Got stderr output from pyatv: File "/usr/local/lib/python3.12/site-packages/pyatv/init.py", line 26, in
from pyatv.protocols import PROTOCOLS
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/init.py", line 10, in
from pyatv.protocols import airplay as airplay_proto
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/airplay/init.py", line 28, in
from pyatv.protocols import mrp
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/init.py", line 60, in
from pyatv.protocols.mrp import messages, protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/messages.py", line 9, in
from pyatv.protocols.mrp import protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/init.py", line 9, in
from . import AudioFadeMessage_pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/AudioFadeMessage_pb2.py", line 15, in
from pyatv.protocols.mrp.protobuf import PlayerPath_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_PlayerPathpb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/PlayerPath_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import Origin_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_Origin pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/Origin_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import DeviceInfoMessage_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_DeviceInfoMessage__pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/DeviceInfoMessage_pb2.py", line 24, in
pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_ProtocolMessage__pb2.ProtocolMessage.RegisterExtension(deviceInfoMessage)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'ProtocolMessage' has no attribute 'RegisterExtension'
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/init.py", line 10, in
from pyatv.protocols import airplay as airplay_proto
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/airplay/init.py", line 28, in
from pyatv.protocols import mrp
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/init.py", line 60, in
from pyatv.protocols.mrp import messages, protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/messages.py", line 9, in
from pyatv.protocols.mrp import protobuf
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/init.py", line 9, in
from . import AudioFadeMessage_pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/AudioFadeMessage_pb2.py", line 15, in
from pyatv.protocols.mrp.protobuf import PlayerPath_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_PlayerPathpb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/PlayerPath_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import Origin_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_Origin pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/Origin_pb2.py", line 14, in
from pyatv.protocols.mrp.protobuf import DeviceInfoMessage_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_DeviceInfoMessage__pb2
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protobuf/DeviceInfoMessage_pb2.py", line 24, in
pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_ProtocolMessage__pb2.ProtocolMessage.RegisterExtension(deviceInfoMessage)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'ProtocolMessage' has no attribute 'RegisterExtension'
[info][192.168.0.133] [node-pyatv][38] atvscript exited with code: 1 [info][192.168.0.133] [node-pyatv][38] Listening with atvscript exited with code 1 [info][192.168.0.133] [node-pyatv][38] Wait 15s and restart listeing to events from device ATV`
2. Then I run
atvscript -s 192.168.0.133 -i xxxx --airplay-credentials xxxxx push_updates
I get this MSG:
{"result": "success", "datetime": "2024-09-23T21:09:21.929638+08:00", "power_state": "on"} {"result": "success", "datetime": "2024-09-23T21:09:21.930630+08:00", "output_devices": [{"name": "ATV", "identifier": "00E1A884-250C-408B-A317-7117C8E2AE7C"}]} {"result": "failure", "datetime": "2024-09-23T21:09:21.930630+08:00", "error": "Exception in callback _ProactorReadPipeTransport._loop_reading()", "exception": "'_ProactorReadPipeTransport' object has no attribute '_empty_waiter'", "stacktrace": "Traceback (most recent call last):\n File \"C:\\Users\\hlalh\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\asyncio\\proactor_events.py\", line 306, in _loop_reading\n self._read_fut = self._loop._proactor.recv_into(self._sock, self._data)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\hlalh\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\asyncio\\windows_events.py\", line 483, in recv_into\n self._register_with_iocp(conn)\n File \"C:\\Users\\hlalh\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\asyncio\\windows_events.py\", line 704, in _register_with_iocp\n _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)\nOSError: [WinError 6] \u53e5\u67c4\u65e0\u6548\u3002\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\Users\\hlalh\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\asyncio\\events.py\", line 88, in _run\n self._context.run(self._callback, *self._args)\n File \"C:\\Users\\hlalh\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\asyncio\\proactor_events.py\", line 316, in _loop_reading\n self._fatal_error(exc, 'Fatal read error on pipe transport')\n File \"C:\\Users\\hlalh\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\asyncio\\proactor_events.py\", line 132, in _fatal_error\n self._force_close(exc)\n File \"C:\\Users\\hlalh\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\asyncio\\proactor_events.py\", line 135, in _force_close\n if self._empty_waiter is not None and not self._empty_waiter.done():\n ^^^^^^^^^^^^^^^^^^\nAttributeError: '_ProactorReadPipeTransport' object has no attribute '_empty_waiter'\n"} {"result": "success", "datetime": "2024-09-23T21:09:21.957126+08:00", "hash": "com.apple.avkit.298.d363b7c0", "media_type": "video", "device_state": "playing", "title": "\u3010AI\u8d85\u52064K\u00b7\u8d85\u8d8aCD\u7684\u73b0\u573a\u3011\u9676\u5586\u5531\u8df3\u5b8c\u7f8e\u6f14\u7ece\u4eca\u5929\u6ca1\u56de\u5bb6", "artist": null, "album": null, "genre": null, "total_time": 266, "position": 147, "shuffle": "off", "repeat": "off", "series_name": null, "season_number": null, "episode_number": null, "content_identifier": null, "app": "Cheers", "app_id": "app.svn.Cheers"} {"result": "success", "datetime": "2024-09-23T21:09:21.957126+08:00", "push_updates": "finished"} {"result": "failure", "datetime": "2024-09-23T21:09:21.969128+08:00", "error": "Task was destroyed but it is pending!"}
The real id and airplayCredentials are replaced with xxxx above.