ericpignet / home-assistant-tplink_router

TPLink router device tracker for Home Assistant
41 stars 28 forks source link

Archer AX1500 - cannot connect #15

Open pjrt opened 3 years ago

pjrt commented 3 years ago

I am trying to connect my AX1500 using this plugin, however it can't seem to authenticate.

My router doesn't ask for a username, just a local password (unless you decide to log in with tp-link ID).

Here are all relevant logs:

If I use admin as the username:

2020-11-15 16:45:47 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] [VR600] Loading wireless clients...
2020-11-15 16:45:47 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] Retrieving PublicKey...
2020-11-15 16:45:47 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] Failed to get AuthTokens. Retrying in 3 secs.
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] Retrieving PublicKey...
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] [EAP225] Loading wireless clients...
2020-11-15 16:45:50 ERROR (SyncWorker_11) [custom_components.tplink_router.device_tracker] AP didn't respond with JSON. Check if credentials are correct
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] [N600] Loading wireless clients...
2020-11-15 16:45:50 ERROR (SyncWorker_11) [custom_components.tplink_router.device_tracker] Error 404 from router
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] [C7] Loading wireless clients...
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] Retrieving auth tokens...
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] [C9] Loading wireless clients...
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] Retrieving auth tokens...
2020-11-15 16:45:50 ERROR (SyncWorker_11) [custom_components.tplink_router.device_tracker] Couldn't fetch auth tokens! Response was: {"data":""}
2020-11-15 16:45:50 ERROR (SyncWorker_11) [custom_components.tplink_router.device_tracker] An unknown error happened while fetching data
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] [OldC9] Loading wireless clients...
2020-11-15 16:45:50 ERROR (SyncWorker_11) [custom_components.tplink_router.device_tracker] Router didn't respond with JSON. Check if credentials are correct.
2020-11-15 16:45:50 INFO (SyncWorker_11) [custom_components.tplink_router.device_tracker] [Original] Loading wireless clients...

If I user "" (empty string) as the username:

2020-11-15 16:53:16 INFO (SyncWorker_6) [custom_components.tplink_router.device_tracker] [VR600] Loading wireless clients...
2020-11-15 16:53:16 INFO (SyncWorker_6) [custom_components.tplink_router.device_tracker] Retrieving PublicKey...
2020-11-15 16:53:16 INFO (SyncWorker_6) [custom_components.tplink_router.device_tracker] Failed to get AuthTokens. Retrying in 3 secs.
2020-11-15 16:53:19 INFO (SyncWorker_6) [custom_components.tplink_router.device_tracker] Retrieving PublicKey...
2020-11-15 16:53:19 INFO (SyncWorker_6) [custom_components.tplink_router.device_tracker] [EAP225] Loading wireless clients...
2020-11-15 16:53:19 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1347, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 331, in begin
    self.headers = self.msg = parse_headers(self.fp)
  File "/usr/local/lib/python3.8/http/client.py", line 216, in parse_headers
    line = fp.readline(_MAXLINE + 1)
  File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 410, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1347, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 331, in begin
    self.headers = self.msg = parse_headers(self.fp)
  File "/usr/local/lib/python3.8/http/client.py", line 216, in parse_headers
    line = fp.readline(_MAXLINE + 1)
  File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 63, in async_setup_legacy
    scanner = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/tplink_router/device_tracker.py", line 56, in get_scanner
    scanner = cls(config[DOMAIN])
  File "/config/custom_components/tplink_router/device_tracker.py", line 83, in __init__
    self.success_init = self._update_info()
  File "/config/custom_components/tplink_router/device_tracker.py", line 454, in _update_info
    session.post(base_url, login_data, headers=header)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 578, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

I understand the AX1500 isn't one of the tested routers, but any help would be appreciated.

pjrt commented 3 years ago

So turns out that TP-LINK puts up emulators for this routers online:

https://emulator.tp-link.com/Archer_AX1500v1.20_US_simulator/index.html

That's the AX1500. If anyone knows what I should be looking for, let me know. This ones doesn't seem to behave the same way as the others.

weado commented 3 years ago

Hello

Do you know if the TPLINK Archer axXX ( 50 in my case ) is support by this component ? Thank you !

Omirax commented 3 years ago

Hello!

I have problem with this router (ax20): https://emulator.tp-link.com/Archer_AX1800v1.20_US_simulator/index.html

This integration don't work with any AX routers.

gmow1 commented 3 years ago

Can confirm doesn't work with AX50

AlexandrErohin commented 5 months ago

If you are still looking for a Home Assistant Integration for Archer AX20 and Archer AX50 - I have one https://github.com/AlexandrErohin/home-assistant-tplink-router