kdschlosser / samsungctl

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

UE65H6400 can´t connect #127

Open mlipovsky opened 5 years ago

mlipovsky commented 5 years ago

Hi @kdschlosser ,

i am not able to connect to my TV UE65H6400.

When i go to url 'http://192.168.15.191:8001/api/v2/' i got a response { "id": "XXXXX", "name": "[TV]Samsung LED65", "version": "2.0.24", "device": { "type": "Samsung SmartTV", "duid": "XXXXX", "model": "14_X14_BT", "modelName": "UE65H6400", "description": "Samsung TV RCR", "networkType": "wireless", "ssid": "XXXX", "ip": "192.168.15.191", "firmwareVersion": "Unknown", "name": "[TV]Samsung LED65", "id": "xxxxxx", "udn": "xxxxxxxx", "resolution": "1920x1080", "countryCode": "CZ", "msfVersion": "2.0.24", "smartHubAgreement": "true", "developerMode": "0", "developerIP": "0.0.0.0" }, "type": "Samsung SmartTV", "uri": "http://192.168.15.191:8001/api/v2/" }

When i try use your module: python3 -m samsungctl --host 192.168.15.191 --port 8001 --interactive --verbose --name mujnb

i got exception:

Unable to acquire TV's mac address
Traceback (most recent call last):
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/remote_legacy.py", line 76, in open
    self.sock.connect((self.config.host, self.config.port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/__main__.py", line 451, in <module>
    main()
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/__main__.py", line 355, in main
    with Remote(config) as remote:
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/remote.py", line 67, in __enter__
    self.open()
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/utils.py", line 24, in wrapper
    return func(*args, **kwargs)
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/remote_legacy.py", line 79, in open
    raise RuntimeError('Unable to pair with TV.. Is the TV on?!?')
RuntimeError: Unable to pair with TV.. Is the TV on?!?
rodajc commented 5 years ago

Same here. Except that modelName is UE32H6400. Yours is definitely bigger ;-( @mlipovsky Have you tried https://github.com/McKael/samtv? Just go to releases and download the executable compiled for your OS architecture. Switch on your TV, execute: ./samtvcli pair and enter the code you see on your TV with ./samtvcli pair --pin Works for me.

mlipovsky commented 5 years ago

@rodajc thanks for workaround, i'll try. But sad point is, that this package is used in home assistant (where i want to control my tv) :/

PS: yes it's bigger, but not enough :smiling_imp:

zaileion commented 5 years ago

Hi @kdschlosser ,

i am not able to connect to my TV UE65H6400.

When i go to url 'http://192.168.15.191:8001/api/v2/' i got a response { "id": "XXXXX", "name": "[TV]Samsung LED65", "version": "2.0.24", "device": { "type": "Samsung SmartTV", "duid": "XXXXX", "model": "14_X14_BT", "modelName": "UE65H6400", "description": "Samsung TV RCR", "networkType": "wireless", "ssid": "XXXX", "ip": "192.168.15.191", "firmwareVersion": "Unknown", "name": "[TV]Samsung LED65", "id": "xxxxxx", "udn": "xxxxxxxx", "resolution": "1920x1080", "countryCode": "CZ", "msfVersion": "2.0.24", "smartHubAgreement": "true", "developerMode": "0", "developerIP": "0.0.0.0" }, "type": "Samsung SmartTV", "uri": "http://192.168.15.191:8001/api/v2/" }

When i try use your module: python3 -m samsungctl --host 192.168.15.191 --port 8001 --interactive --verbose --name mujnb

i got exception:

Unable to acquire TV's mac address
Traceback (most recent call last):
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/remote_legacy.py", line 76, in open
    self.sock.connect((self.config.host, self.config.port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/__main__.py", line 451, in <module>
    main()
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/__main__.py", line 355, in main
    with Remote(config) as remote:
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/remote.py", line 67, in __enter__
    self.open()
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/utils.py", line 24, in wrapper
    return func(*args, **kwargs)
  File "/home/lipovmar/Documents/samsungctl/samsungctl-master/samsungctl/remote_legacy.py", line 79, in open
    raise RuntimeError('Unable to pair with TV.. Is the TV on?!?')
RuntimeError: Unable to pair with TV.. Is the TV on?!?

If you look at this issue Pair request over and over and permission denied in terminal it has instructions to get it working.

rodajc commented 5 years ago

@zaileion

Thanks for your reply. I tried what you describe in Pair request over and over and permission denied in terminal but it doesn't work for me.

This is the output:

Traceback (most recent call last): File "./samsungctl", line 11, in <module> load_entry_point('samsungctl==0.7.1+1', 'console_scripts', 'samsungctl')() File "/home/sil/.local/lib/python3.7/site-packages/samsungctl-0.7.1+1-py3.7.egg/samsungctl/__main__.py", line 110, in main with Remote(config) as remote: File "/home/sil/.local/lib/python3.7/site-packages/samsungctl-0.7.1+1-py3.7.egg/samsungctl/remote.py", line 11, in __init__ self.remote = RemoteWebsocket(config) File "/home/sil/.local/lib/python3.7/site-packages/samsungctl-0.7.1+1-py3.7.egg/samsungctl/remote_websocket.py", line 37, in __init__ self.connection = websocket.create_connection(url, config["timeout"]) File "/usr/lib/python3.7/site-packages/websocket/_core.py", line 514, in create_connection websock.connect(url, **options) File "/usr/lib/python3.7/site-packages/websocket/_core.py", line 226, in connect self.handshake_response = handshake(self.sock, *addrs, **options) File "/usr/lib/python3.7/site-packages/websocket/_handshake.py", line 79, in handshake status, resp = _get_resp_headers(sock) File "/usr/lib/python3.7/site-packages/websocket/_handshake.py", line 158, in _get_resp_headers status, resp_headers, status_message = read_headers(sock) File "/usr/lib/python3.7/site-packages/websocket/_http.py", line 305, in read_headers line = recv_line(sock) File "/usr/lib/python3.7/site-packages/websocket/_socket.py", line 123, in recv_line c = recv(sock, 1) File "/usr/lib/python3.7/site-packages/websocket/_socket.py", line 115, in recv "Connection is already closed.") websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed.

I stick to https://github.com/McKael/samtv.

arturleao commented 4 years ago

I also couldn't get this to work, posted an issue on the HA custom component (https://github.com/roberodin/ha-samsungtv-custom/issues/31). Long story short, I can pair and send commands using @eclair4151 SmartCrypto and it seems it was integrated in this project at some point but for some reason I couldn't figure out it's not working properly. Would be great to have one of the devs looking at this since it works just fine with SmartCrypto.

arturleao commented 4 years ago

I wrote a custom component based on SmartCrypto and ha-samsungtv-custom, working fine here! https://github.com/arturleao/samsungtv_custom