sermayoral / ha-samsungtv-encrypted

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

"[Errno -5] No address associated with hostname" when trying to get tocken #70

Closed alparo closed 3 years ago

alparo commented 3 years ago

I have a 2014 Samsung TV UE55H6650

I run following command: python3 get_token.py -ip 192.168.1.199 -port 8080

And get following error. Could you please advice what can be wrong?

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "get_token.py", line 27, in main(sys.argv[1:]) File "get_token.py", line 24, in main PySmartCrypto(ip, port) File "/usr/share/hassio/homeassistant/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 123, in init self._connection = self.connect() File "/usr/share/hassio/homeassistant/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 95, in connect websocket_response = requests.get(step4_url) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-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=1613411090974 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa5bcfb0668>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))

`

alparo commented 3 years ago

Ok. I got it. The help is wrong:

$ python3 get_token.py get_token.py -ip -port

This one hyphen is misleading. After correcting the command to: python3 get_token.py --ip 192.168.1.199 --port 8080

I could manage it to run. Maybe it would be good to update the help.