nstrelow / ha_philips_android_tv

Home Assistant custom component for the newer (2016+) Philips Android TVs
109 stars 28 forks source link

Connection refused #34

Open JorgeAnzola opened 4 years ago

JorgeAnzola commented 4 years ago

I'm not able to get a username/password :( I installed the reqs on my mac. I'm trying it in a Philips 65pus6121

Do you have any idea or pointing direction? Is there something missing on my TV? I have EasyLink disabled.

Starting pairing request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10f213d50>: Failed to establish a new connection: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.7/site-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='192.168.178.12', port=1926): Max retries exceeded with url: /6/pair/request (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10f213d50>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "philips.py", line 123, in <module>
    main()
  File "philips.py", line 90, in main
    pair(config)
  File "philips.py", line 41, in pair
    r = requests.post("https://" + config['address'] + ":1926/6/pair/request", json=data, verify=False)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 110, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='192.168.178.12', port=1926): Max retries exceeded with url: /6/pair/request (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10f213d50>: Failed to establish a new connection: [Errno 61] Connection refused'))
ArnoutVerbeken commented 4 years ago

Same issue here....

foxy82 commented 4 years ago

I fixed this by powering the TV off at the wall and then when it came back on it worked.

michaelkuty commented 4 years ago

Yes, same for me, just unplug/plug TV

JorgeAnzola commented 4 years ago

Tried that, but it didn't work :(

sineczek commented 4 years ago

same issue here: ConnectionRefusedError: [Errno 111] Connection refused

power cycling didn't help

EDIT: issue solved, problem was with TV, with new one everything works great

sdrasmussen commented 3 years ago

I have the same issue as OP. A power reset of the TV did not fix my issue. My TV was purchased new last year. I notice that the pairing script is trying to connect on port 1926. I did an NMAP scan of the TV and found that the following ports (TCP) are open:

5555, 6466, 6467, 8008, 8009, 8012, 8443, 9000, 9080, 10101, and 33921.

These UDP ports are open:

1782, 1900, 5353, 6050, 17332, 17505, 18134, 30697, 34570, 36945, 41967, 49158, 57958, 62677, and 64513.

The errors I am getting FEELS like it may be the issue reported here:

https://github.com/suborb/philips_android_tv/issues/22

Any idea what can be done? It does feel like the firmware on the TV may be causing this, but I don't where to start. Thanks.

nstrelow commented 3 years ago

if your port is not open, then your TV is probably using a different API. You can try using the Android ADB component.

You can also try using the philips remote app and see if that works with your TV. Should use the same API.