sermayoral / ha-samsungtv-encrypted

Samsung TV Encrypted Models (H & J Series) custom component for Home Assistant
Apache License 2.0
38 stars 24 forks source link

[Errno 8] nodename nor servname provided, or not known #44

Closed FrancYescO closed 4 years ago

FrancYescO commented 4 years ago

Looks like i cannot get token from mine TV UE58H5203 (btw usually the TV just show a pop-up to accept the new device, not a pin, and i never found an app that allow remote control, but i can do some actions like share youtube videos from the phone, or send content via DLNA streming)

python3 get_token.py -ip 192.168.144.21 -port 8080
Traceback (most recent call last):
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/connection.py", line 187, in connect
    conn = self._new_conn()
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/connection.py", line 172, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10e89cb50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='p', port=8000): Max retries exceeded with url: /socket.io/1/?t=1593430870908 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10e89cb50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "get_token.py", line 27, in <module>
    main(sys.argv[1:])
  File "get_token.py", line 24, in main
    PySmartCrypto(ip, port)
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 123, in __init__
    self._connection = self.connect()
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 95, in connect
    websocket_response = requests.get(step4_url)
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/Users/francyesco/Downloads/ha-samsungtv-encrypted-master/custom_components/samsungtv_encrypted/venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='p', port=8000): Max retries exceeded with url: /socket.io/1/?t=1593430870908 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10e89cb50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
sermayoral commented 4 years ago

@FrancYescO Is your TV an encrypted TV?

FrancYescO commented 4 years ago

how can i be sure about that?

sermayoral commented 4 years ago

This project use the SmartCrypto project for getting the PIN. This part of code is not mine. Please read the SmartCrypto project information to determine if your TV model is compatible