huawei_mesh_router icon indicating copy to clipboard operation
huawei_mesh_router copied to clipboard

HuaWei Q2S Mesh Router Issue

Open songjave opened this issue 2 years ago • 23 comments

I have Q2S Router,I can access primary router and sub router, But ha log have some error

  • Can not update router info: Api call error, status:200; code: -2, category: unauthorized
  • Can not update router info: Failed to get index; reason: auth_general
  • Can not update NFC switch state: Failed to get index; reason: auth_general

songjave avatar Jan 16 '23 04:01 songjave

Hi! Unfortunately, there is not much information on your router model on the Internet. If I understand correctly, then your system has one primary router, and additional, moreover, additional routers differ in functionality from the primary one (unlike Huawei Mesh 3).

The integration itself has been installed, configured, works, but a lot of errors appear in the logs, right?

Have the primary and additional routers been defined as separate devices in the integration? Can I ask to send you a screenshot?

Example: image

Regarding logs, can I ask you to send debug logs of integration? To enable them, you will need to make changes to configuration.yaml and restart HA.

Changes in configuration.yaml:

logger:
  .....
  logs:
    custom_components.huawei_mesh_router: debug

You may need to click the "load full logs" button to see the debug messages

I would also ask you to send the exact model of your router (for example, for my Huawei Mesh 3, this is WS8100-23), or a screenshot of information about the device of the primary router in the integration.

Example: image

And another question: the authorization page on your primary router should be available at http://<Router IP>/html/index.html#/login. And can you go to the same authorization pages of your additional routers?

vmakeev avatar Jan 17 '23 08:01 vmakeev

Hi. I have Q2 Pro model. It's similar router right? Model WS5280-21

Rumlik avatar Jan 31 '23 21:01 Rumlik

As far as I understand, Q2S is WS5281 (main router) and PT8021 (satellites).

However, the Q2 Pro is quite similar to it. Please tell me, have you had any problems using my integration?

vmakeev avatar Feb 01 '23 13:02 vmakeev

As far as I understand, Q2S is WS5281 (main router) and PT8021 (satellites).

However, the Q2 Pro is quite similar to it. Please tell me, have you had any problems using my integration?

On Q2Pro your integration not working.

I dont have login name in login into router. Only pass. If I use your integration, I cant access to router anymore because multiple login issue

Rumlik avatar Feb 01 '23 23:02 Rumlik

It's sad. I will try to look for the owners of Q2S/Q2 Pro among my friends in order to get to know the authentication algorithm on this line of routers better.

Anyway, thanks for the feedback, I'll let you know in this issue if anything changes.

vmakeev avatar Feb 02 '23 06:02 vmakeev

P.S. by default, Huawei mesh routers use the username admin, although it is not displayed in the web interface and mobile applications.

vmakeev avatar Feb 02 '23 09:02 vmakeev

I will be happy to provide any assistance if anything is needed.

Rumlik avatar Feb 02 '23 09:02 Rumlik

@Rumlik thank you for your willingness to help, I appreciate it :)

Could you please first send me a screenshot of the authentication screen and the main page of the web interface of the primary router? (exactly the web interface, not the mobile application)

vmakeev avatar Feb 02 '23 18:02 vmakeev

@Rumlik thank you for your willingness to help, I appreciate it :)

Could you please first send me a screenshot of the authentication screen and the main page of the web interface of the primary router? (exactly the web interface, not the mobile application)

URL: http://ip-adress-router/html/index.html obrazek

Rumlik avatar Feb 02 '23 18:02 Rumlik

all routers are the same. They have the same designation and it doesn't matter which one I set as primary. All router is model WS5280 v2

Rumlik avatar Feb 02 '23 19:02 Rumlik

The interface is generally similar to the one my router uses.

However, here it is offered to use the Huawei SmartHome application for management, whereas I have AI Life.

To try to understand the authorization mechanism and the API structure of your model, I will need some JavaScript files from the router.

The easiest way is to save the authorization screen page somewhere (ctrl+s in the browser, save the web page completely). At the moment of saving the file, you do not have to be logged in to the system and do not have to enter any password.

Next to the html file itself, there will be a folder in which all the resources used by the page are saved, including .js files.

If it doesn't bother you, pack all these files (.html and the whole folder) into an archive and give me a link to it

vmakeev avatar Feb 02 '23 19:02 vmakeev

The interface is generally similar to the one my router uses.

However, here it is offered to use the Huawei SmartHome application for management, whereas I have AI Life.

To try to understand the authorization mechanism and the API structure of your model, I will need some JavaScript files from the router.

The easiest way is to save the authorization screen page somewhere (ctrl+s in the browser, save the web page completely). At the moment of saving the file, you do not have to be logged in to the system and do not have to enter any password.

Next to the html file itself, there will be a folder in which all the resources used by the page are saved, including .js files.

If it doesn't bother you, pack all these files (.html and the whole folder) into an archive and give me a link to it

I have AI Life too. I think, first was only SmartHome app. I've never used any other app either. It's possible that at first it was and then they combined it into one. But I'm not sure.

Rumlik avatar Feb 02 '23 19:02 Rumlik

Huawei Q2Pro.zip

Rumlik avatar Feb 02 '23 19:02 Rumlik

Huawei Q2Pro.zip

It's what you need? :)

Rumlik avatar Feb 02 '23 19:02 Rumlik

Proof that I have an AI life app :) Screenshot_20230202-202731 Screenshot_20230202-202710

Rumlik avatar Feb 02 '23 19:02 Rumlik

It's what you need? :)

Yes, exactly.

http://<router-ip-address>/api/system/useraccount

If you follow this link, the Json will load something like the following:

[
  {
    "DBpromptinfo": "",
    "username": "admin",
    "userlevel": 2,
    "LoginWifiSsidSame": false,
    "enableprompt": false,
    "promptinfo": "",
    "DBenableprompt": false,
    "FirstLogin": 1,
    "IsWifiOpen": false,
    "SyncWifiPwd": 0,
    "ID": "InternetGatewayDevice.UserInterface.X_Web.UserInfo.1."
  }
]

Tell me, do you also have the value "admin" in the "username" field?

vmakeev avatar Feb 02 '23 19:02 vmakeev

It's what you need? :)

Yes, exactly.

http://<router-ip-address>/api/system/useraccount

If you follow this link, the Json will load something like the following:

[
  {
    "DBpromptinfo": "",
    "username": "admin",
    "userlevel": 2,
    "LoginWifiSsidSame": false,
    "enableprompt": false,
    "promptinfo": "",
    "DBenableprompt": false,
    "FirstLogin": 1,
    "IsWifiOpen": false,
    "SyncWifiPwd": 0,
    "ID": "InternetGatewayDevice.UserInterface.X_Web.UserInfo.1."
  }
]

Tell me, do you also have the value "admin" in the "username" field?

yes

Rumlik avatar Feb 02 '23 19:02 Rumlik

Сan I ask you to send debug logs of integration? To enable them, you will need to make changes to configuration.yaml and restart HA.

Changes in configuration.yaml:

logger:
  .....
  logs:
    custom_components.huawei_mesh_router: debug

You may need to click the "load full logs" button to see the debug messages

vmakeev avatar Feb 02 '23 19:02 vmakeev

I have your integration turned off or excacly not set. Because if I set it, it will block access to the router administration. So I have to set it back up, I suppose? :)

Rumlik avatar Feb 02 '23 20:02 Rumlik

If it doesn't bother you :)

Just please enable debugging logs BEFORE starting the setup

vmakeev avatar Feb 02 '23 20:02 vmakeev

Sorry, this is fully log for your integration. I hope :D huawei log.txt

Rumlik avatar Feb 02 '23 20:02 Rumlik

Authentication success Session cookies stored

Yeah, so the login is still performed correctly, that's good

Error during logout: Cannot perform POST request at ..... cause of Client OS Error(None, 'Can not write request body for .....); code: -3, category: request_error Cannot perform GET request at .... cause of Server Disconnected Error('Server disconnected'); code: -3, category: request_error Cannot perform GET request at .... cause of Client OS Error(32, 'Broken pipe'); code: -3, category: request_error

And it looks like a ban from the router, but it's not accurate. I will search and read the documentation, thank you for your help!

vmakeev avatar Feb 02 '23 20:02 vmakeev

Authentication success Session cookies stored

Yeah, so the login is still performed correctly, that's good

Error during logout: Cannot perform POST request at ..... cause of Client OS Error(None, 'Can not write request body for .....); code: -3, category: request_error Cannot perform GET request at .... cause of Server Disconnected Error('Server disconnected'); code: -3, category: request_error Cannot perform GET request at .... cause of Client OS Error(32, 'Broken pipe'); code: -3, category: request_error

And it looks like a ban from the router, but it's not accurate. I will search and read the documentation, thank you for your help!

Hi there, have you any new news about this? Thank you

Rumlik avatar Mar 03 '23 11:03 Rumlik