Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connessione non riuscita #638

Open
spetros100 opened this issue Dec 8, 2023 · 6 comments
Open

Connessione non riuscita #638

spetros100 opened this issue Dec 8, 2023 · 6 comments

Comments

@spetros100
Copy link

Buongiorno è da un paio di settimane che non riesco a collegare le lampadine smart tapo all'integrazione.
Ho usato questa integrazione per un anno e mai dato problemi, ma da due settimane non funziona più.
questi sono gli errori che mi escono.

Connessione non riuscita.
Logger: custom_components.tapo.config_flow
Source: custom_components/tapo/config_flow.py:118
Integration: TP-Link Tapo (documentation, issues)
First occurred: 8 dicembre 2023 alle ore 09:36:46 (4 occurrences)
Last logged: 8 dicembre 2023 alle ore 10:09:31

Failed to setup cannot connect
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.1.56', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/tapo/config_flow.py", line 215, in _try_setup_api
await client.initialize()
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 70, in initialize
await self._guess_protocol()
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 247, in _guess_protocol
response = await self.execute_raw_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 79, in execute_raw_request
return (await self._protocol.send_request(request)).map(lambda x: x.result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 41, in send_request
response = await self._send_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 61, in _send_request
await self._login_with_version(self._credential)
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 80, in _login_with_version
session_or_error = await self._passthrough.handshake(self._url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake
response = await self._http.async_make_post(url, json=request_body)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post
async with self.session.post(
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 574, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1000, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.56:80 ssl:default [Connect call failed ('192.168.1.56', 80)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user
tapo_client = await self._try_setup_api(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api
raise CannotConnect from error
custom_components.tapo.errors.CannotConnect

@petretiandrea
Copy link
Owner

Have you update the integration? Which version are you using? Some of tapo device changes its protocol due to recent firmware upgrade

@ekemer-ha
Copy link

ekemer-ha commented Dec 11, 2023

Having a similar issue with 510 bulbs for the last couple weeks (it could be a firmware update, but not sure about it)

Traceback (most recent call last):
  File "/config/custom_components/tapo/config_flow.py", line 192, in _get_first_data_from_api
    (await tapo_client.get_device_info())
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 96, in get_device_info
    return (await self._protocol.send_request(get_info_request)).map(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/klap_protocol.py", line 49, in send_request
    response = await self._send_request(request, retry)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/klap_protocol.py", line 59, in _send_request
    new_session = await self.perform_handshake()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/klap_protocol.py", line 104, in perform_handshake
    seeds = await self.perform_handshake1(new_local_seed)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/klap_protocol.py", line 176, in perform_handshake1
    "Server response doesn't match our expected hash on ip %s but an authentication with blank credentials matched"
TypeError: not all arguments converted during string formatting

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/tapo/config_flow.py", line 119, in async_step_user
    device_data = await self._get_first_data_from_api(tapo_client)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo/config_flow.py", line 199, in _get_first_data_from_api
    raise CannotConnect from error
custom_components.tapo.errors.CannotConnect

@spetros100
Copy link
Author

Hai aggiornato l'integrazione? Che versione stai usando? Alcuni dispositivi tapo modificano il protocollo a causa del recente aggiornamento del firmware

sto usando l' ultima versione v2.12.1. ho riprovato ma nulla, esce sempre lo stesso errore

@petretiandrea
Copy link
Owner

Hai aggiornato l'integrazione? Che versione stai usando? Alcuni dispositivi tapo modificano il protocollo a causa del recente aggiornamento del firmware

sto usando l' ultima versione v2.12.1. ho riprovato ma nulla, esce sempre lo stesso errore

The latest version is 2.12.2 try it

Copy link

github-actions bot commented Feb 1, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Feb 1, 2024
@Vicrah
Copy link

Vicrah commented Apr 24, 2024

Hi, I’ve been having the same problem too.

For the past few days, my H100 hasn’t been recognized by that integration.
I didn’t change anything. I also tried to rollback to a previous backup, but without any success…

Here’s the log:

Questo errore ha avuto origine da un'integrazione personalizzata.

Registratore: custom_components.tapo.config_flow
Fonte: custom_components/tapo/config_flow.py:143
Integrazione: TP-Link Tapo (documentazione, problemi)
Prima occorrenza: 23:13:20 (1 occorrenze)
Ultima registrazione: 23:13:20

Failed to setup cannot connect
Traceback (most recent call last):
  File "/config/custom_components/tapo/config_flow.py", line 317, in _async_get_device
    await device.update()
  File "/usr/local/lib/python3.12/site-packages/plugp100/new/tapodevice.py", line 79, in update
    await component.update(state)
  File "/usr/local/lib/python3.12/site-packages/plugp100/new/components/hub_children_component.py", line 47, in update
    await child_device.update()
  File "/usr/local/lib/python3.12/site-packages/plugp100/new/tapodevice.py", line 79, in update
    await component.update(state)
  File "/usr/local/lib/python3.12/site-packages/plugp100/new/components/smart_door_component.py", line 15, in update
    self.is_open = current_state["is_open"]
                   ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'is_open'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/tapo/config_flow.py", line 143, in async_step_user
    device = await self._async_get_device(user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo/config_flow.py", line 322, in _async_get_device
    raise CannotConnect from error
custom_components.tapo.errors.CannotConnect

I also tried to install the Matter integration to bypass the problem, but I also have trouble with that installation…

2024-04-24 23:19:46.816 WARNING (MainThread) [supervisor.addons.addon] core_matter_server is already running!
2024-04-24 23:21:46.818 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Matter Server to start, took more than 120 seconds

Please help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants