Ape / samsungctl

Remote control Samsung televisions via a TCP/IP connection
MIT License
711 stars 191 forks source link

KU6020: Connection closed, refused and unauthorized #79

Closed kevintuhumury closed 6 years ago

kevintuhumury commented 6 years ago

Hi,

I have a KU6020 model and I tried several commands as can be seen below:

$ samsungctl --host <host> KEY_MUTE
Error: Connection refused

with port 8001:

$ samsungctl --host <host> --port 8001 KEY_MUTE
Error: Connection closed!

and by using websockets:

$ samsungctl --host <host> --port 8001 --method websocket KEY_MUTE
Traceback (most recent call last):
  File "/srv/bin/samsungctl", line 11, in <module>
    sys.exit(main())
  File "/srv/lib/python3.6/site-packages/samsungctl/__main__.py", line 101, in main
    with Remote(config) as remote:
  File "/srv/lib/python3.6/site-packages/samsungctl/remote.py", line 10, in __init__
    self.remote = RemoteWebsocket(config)
  File "/srv/lib/python3.6/site-packages/samsungctl/remote_websocket.py", line 25, in __init__
    self._read_response()
  File "/srv/lib/python3.6/site-packages/samsungctl/remote_websocket.py", line 67, in _read_response
    raise exceptions.UnhandledResponse(response)
samsungctl.exceptions.UnhandledResponse: {'event': 'ms.channel.unauthorized'}

As you can see, none of them work. Is there anything I can do to get it to work?

kevintuhumury commented 6 years ago

Also the /api/v2/ URL is available and shows some debug information. If there's anything you could use from that page, let me know.

kevintuhumury commented 6 years ago

Ok, wait. I found the last response ms.channel.unauthorized a bit strange, so I started to investigate. I just found out that the device I was executing the above commands on was denied access in the 'Mobile device list' under the 'Expert settings' in the menu of the TV.

Granting the device access, made the last command work.

arsaboo commented 5 years ago

@kevintuhumury Where exactly is this menu? I am not seeing it on my Samsung TV and am facing the same issue. Thanks!!

mariomare22 commented 5 years ago

https://www.youtube.com/watch?v=kPN8TENNyRE