AlexandrErohin / home-assistant-tplink-router

Home Assistant component for TP-Link router administration with sensors, button reboot, switches and device tracking.
https://community.home-assistant.io/t/custom-component-tp-link-router-integration
MIT License
136 stars 16 forks source link

Extra data: line 1 column 2 (char 1) #13

Closed FredFreegroup closed 10 months ago

FredFreegroup commented 11 months ago

Hi When I try to add integration I receive error

Extra data: line 1 column 2 (char 1) chrome_Jyz04DYcz8

Firmware Version: 1.13.2 Build 230824 Rel.75032n(4555) Hardware Version: Archer C6 4.0

Tp-Link router integration for Home Assistant v1.2.4 @AlexandrErohin

Home Assistant Community Store Integration version: | 1.33.0

FredFreegroup commented 11 months ago

reloaded and restarted twice

AlexandrErohin commented 11 months ago

@FredFreegroup could you post the full integration log like this https://github.com/AlexandrErohin/home-assistant-tplink-router/issues/10#issuecomment-1854921431

FredFreegroup commented 11 months ago

Unfortunately, I don't know where to find them :( there is nothing in the integration folder /homeassistant/custom_components/tplink_router/

AlexandrErohin commented 11 months ago

@FredFreegroup Settings -> System -> Logs

FredFreegroup commented 11 months ago

I didnt see logs like in massage you show :( chrome_wI4Jr6X9wg

FredFreegroup commented 11 months ago

chrome_H15sTm8bbA

AlexandrErohin commented 11 months ago

I didnt see logs like in massage you show :( chrome_wI4Jr6X9wg

Press on the first log

FredFreegroup commented 11 months ago

found thi on search

2023-12-21 16:39:38.691 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration tplink_router which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-12-21 16:40:51.249 ERROR (SyncWorker_1) [homeassistant.components.xiaomi.device_tracker] Invalid response: [<Response [403]>] at url: [http://192.168.31.1/cgi-bin/luci/api/xqsystem/login] with data [{'username': 'admin', 'password': '***'}] 2023-12-21 16:47:21.406 ERROR (MainThread) [custom_components.tplink_router.config_flow] TplinkRouter Integration Exception - Extra data: line 1 column 2 (char 1)

FredFreegroup commented 11 months ago

chrome_BUWUBUjj0u

FredFreegroup commented 11 months ago

My router login page has no login field only password. Maybe here is the problem? chrome_TOAUgHPNDe

AlexandrErohin commented 11 months ago

My router login page has no login field only password. Maybe here is the problem? chrome_TOAUgHPNDe

No, Im afraid it has different encryption

Ill add more auth logs to the integration next days and we will test it

ramonfontes commented 11 months ago

I have the same problem with C20 and C80.

BartRuSec commented 11 months ago

I have the same problem witch Archer C7 v2 (original FW)

kugaevsky commented 10 months ago

The same issue on

Firmware version: 1.13.2 Build 230824 Rel.75032n(5255)
Hardware version: Archer C6 4.0
Flopescu commented 10 months ago

Same issue for C80. The login page does not ask for a user, only password, as in the screenshot above,

AlexandrErohin commented 10 months ago

@FredFreegroup Hi! I have added more logs for password request errors. Could you reinstall the integration, try again and post the logs?

FredFreegroup commented 10 months ago

Hi Just updated

Same error with some new text:

Unknown error for pwd - Extra data: line 1 column 2 (char 1); Response - 00005

And tere is no any new records in log

FredFreegroup commented 10 months ago

chrome_9dUkCkHXM9 The second line - I did not change the IP address, so ignore this error.

AlexandrErohin commented 10 months ago

This error means that your router has different authentication API. Since I don’t have the opportunity to test on this version of your router, you can download the client https://github.com/AlexandrErohin/TP-Link-Archer-C6U and check which requests are incorrect for authentication for this router.

FredFreegroup commented 10 months ago

router.authorize() Traceback (most recent call last): File "C:\Users\anato\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\anato\AppData\Local\Programs\Python\Python310\lib\json__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\anato\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 2 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "y:\install!Drivers\TP-LINK1042ND\TP-Link-Archer-C6U-1.3.1\tplinkrouterc6u\client.py", line 174, in _request_pwd data = response.json() File "C:\Users\anato\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Extra data: line 1 column 2 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "y:\install!Drivers\TP-LINK1042ND\TP-Link-Archer-C6U-1.3.1\tplinkrouterc6u\client.py", line 73, in authorize self._request_pwd(referer) File "y:\install!Drivers\TP-LINK1042ND\TP-Link-Archer-C6U-1.3.1\tplinkrouterc6u\client.py", line 183, in _request_pwd raise Exception('Unsupported router!') Exception: Unsupported router!

FredFreegroup commented 10 months ago

It`s not suport Archer C6 4.0

AlexandrErohin commented 10 months ago

@FredFreegroup as I said - This error means that your router has different authentication API. You may check what requests for router authentication via browser is needed and play with the client to successed login. It would be great if you could add your router support to the client

FredFreegroup commented 10 months ago

Unfortunately, I am not competent in what you wrote. I do not know how to do that. :(

AlexandrErohin commented 9 months ago

@FredFreegroup Archer MR200 v5.3 support was added, It has different api, so maybe it is similar with yours. Could you try new version of the integration and let me know

ramonfontes commented 9 months ago

document.getElementById("login-password").value; doesn't work for AC750 (C20 model) and AC80.

I can successfully run document.getElementById("pcPassword").value on AC20 but I cannot find the ID for AC80.

PS: You can usually find the id with the inspect ID: Screenshot from 2024-02-22 08-53-23

However, document.getElementById("pcPassword").value returns the clear text.

But it doesn't work with AC80 (I tried text-text, password.text, password-hidden and a mix of them): Screenshot from 2024-02-22 08-55-09

Since I don't have an encrypted password the system now gives me the following msg error: You need to use web encrypted password instead. Check the documentation!