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

Unable to install the module #117

Open
Didde3866 opened this issue Nov 13, 2024 · 16 comments
Open

Unable to install the module #117

Didde3866 opened this issue Nov 13, 2024 · 16 comments

Comments

@Didde3866
Copy link

Describe the bug
I can’t install the module
Logs
This is the error I got: HTTPConnectionPool(host='192.168.2.1', port=80): Max retries exceeded with url: /cgi/getParm?_=1731481308157 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f64a94530>: Failed to establish a new connection: [Errno 111] Connection refused'))

Additional Information (please complete the following information)

  • Router Hardware Version: Model M9 plus - firmware 1.6.4
  • Router Firmware Version: 3.8.69
  • Home Assistant Version: 2024.11.1
  • TP-Link Router Integration Component Version: 2.0.1
@AlexandrErohin
Copy link
Owner

Could you run this python code and post the output here

from tplinkrouterc6u import TPLinkDecoClient
from logging import Logger

router = TPLinkDecoClient('http://192.168.0.1', 'you_plain_password', logger=Logger('test'))

router.authorize()
firmware = router.get_firmware()
print(firmware.firmware_version)

status = router.get_status()
print(status.wired_total)

@AlexandrErohin
Copy link
Owner

You may try the new version 2.1.0

@Didde3866
Copy link
Author

Didde3866 commented Nov 16, 2024

You may try the new version 2.1.0

2.1 doen’t appaers in HACS

@Didde3866
Copy link
Author

You may try the new version 2.1.0

Now I got this error “ HTTPConnectionPool(host='192.168.2.1', port=80): Max retries exceeded with url: /cgi-bin/luci/;stok=/login?form=keys&operation=read (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7841c320>: Failed to establish a new connection: [Errno 111] Connection refused'))”
Even if I restart the router to kill all conections with it.

@AlexandrErohin
Copy link
Owner

Have you run the code?

@azizle
Copy link

azizle commented Nov 19, 2024

can you specify where to run this code?

@AlexandrErohin
Copy link
Owner

@azizle You may run it on your PC connected to your router M9

@azizle
Copy link

azizle commented Nov 20, 2024

this is what i got:

Traceback (most recent call last):
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\tplinkrouterc6u\client\c6u.py", line 150, in _request_pwd
    args = data[self._data_block]['password']
KeyError: 'result'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\\Downloads\ghntghn.py", line 6, in <module>
    router.authorize()
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\tplinkrouterc6u\client\c6u.py", line 99, in authorize
    self._request_pwd()
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\tplinkrouterc6u\client\c6u.py", line 160, in _request_pwd
    raise ClientException(error)
tplinkrouterc6u.common.exception.ClientException: TplinkRouter - TPLinkDecoClient - Unknown error for pwd! Error - 'result'; Response - {"success":true,"data":{"password":["D1E79FF1...FD","010001"],"mode":"router","username":""

@AlexandrErohin
Copy link
Owner

@azizle Do you have the latest firmware for your router? It looks like your router uses old API
Try this code

from tplinkrouterc6u import TplinkRouter
from logging import Logger

router = TplinkRouter('http://192.168.0.1', 'you_plain_password', logger=Logger('test'))

router.authorize()
firmware = router.get_firmware()
print(firmware.firmware_version)

status = router.get_status()
print(status.wired_total)

@azizle
Copy link

azizle commented Nov 21, 2024

This code works and gave an expected response (1.2.6 Build 20240619 rel.72016(4555), 6). The router is an AX72 v1.0 on the latest firmware.

@AlexandrErohin
Copy link
Owner

@azizle What the error when you add the integration?

@azizle
Copy link

azizle commented Nov 21, 2024

HTTPConnectionPool(host='192.168.0.1', port=80): Max retries exceeded with url: /cgi-bin/luci/;stok=/login?form=keys&operation=read (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f40a29d90>, 'Connection to 192.168.0.1 timed out. (connect timeout=30)'))

@AlexandrErohin
Copy link
Owner

@azizle Could you test this code?

from tplinkrouterc6u import TplinkRouterProvider
from logging import Logger

router = TplinkRouterProvider.get_client('your_router_host', 'you_plain_password', logger=Logger('test'))

router.authorize()
firmware = router.get_firmware()
print(firmware.firmware_version)

status = router.get_status()
print(status.wired_total)

@azizle
Copy link

azizle commented Nov 21, 2024

this also works, same output as before

@AlexandrErohin
Copy link
Owner

@azizle Thats mean your HA cannot connect to your router. As this code is the same what the integration uses to connect to the router. The error ConnectTimeoutError means that the problem on the network layer

@azizle
Copy link

azizle commented Nov 21, 2024

I see, HA is working fine wired to the router though so I have no clue why it's not working

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

No branches or pull requests

3 participants