ha-asusrouter icon indicating copy to clipboard operation
ha-asusrouter copied to clipboard

[Device support] RT-AX55 with latest firmware (3.0.0.4.386_52303) not working

Open ryang3d opened this issue 10 months ago • 1 comments

Anything you want to mention?

Was working on previous firmware, but unable to connect with recent firmware update. Currently using this router as an access point. Running latest AsusRouter 0.31.0 integration.

Error from Home Assistant:

Unknown error of type '<class 'asusrouter.error.AsusRouterConnectionError'>' during connection to 192.168.1.2: ('Cannot connect to 192.168.1.2. Failed in _send_request', None)

Your device model

RT-AX55

Firmware type

Stock

Firmware version

3.0.0.4.386_52303-ga31a98b

Does everything work well?

No

ryang3d avatar May 01 '24 21:05 ryang3d

I have similar error with my RT-AC68U after updating to Merlin 386.12_4.

2024-05-11 17:11:49.395 DEBUG (MainThread) [custom_components.asusrouter.config_flow] Setup initiated
2024-05-11 17:11:49.395 DEBUG (MainThread) [asusrouter.asusrouter] Initializing a new interface to `10.XX.XX.X4`
2024-05-11 17:11:49.395 DEBUG (MainThread) [asusrouter.connection] Initializing a new connection to `10.XX.XX.X4`
2024-05-11 17:11:49.395 DEBUG (MainThread) [asusrouter.connection] Using session `<aiohttp.client.ClientSession object at 0x7fd03714f860>`
2024-05-11 17:11:49.397 DEBUG (MainThread) [asusrouter.connection] Using `http` and port `80`
2024-05-11 17:11:49.397 DEBUG (MainThread) [custom_components.asusrouter.bridge] Connecting to the API
2024-05-11 17:11:49.397 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_connect
2024-05-11 17:11:49.397 DEBUG (MainThread) [asusrouter.connection] Initializing connection to 10.XX.XX.X4
2024-05-11 17:11:49.397 DEBUG (MainThread) [asusrouter.connection] Requesting authorization
2024-05-11 17:11:49.415 DEBUG (MainThread) [asusrouter.connection] Received authorization response
2024-05-11 17:11:49.416 DEBUG (MainThread) [asusrouter.connection] Connected to 10.XX.XX.X4
2024-05-11 17:11:49.416 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_get_identity
2024-05-11 17:11:49.416 DEBUG (MainThread) [asusrouter.modules.identity] Collecting device identity
2024-05-11 17:11:49.416 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_hook: nvram_get(serial_no);nvram_get(label_mac);nvram_get(lan_hwaddr);nvram_get(wan_hwaddr);nvram_get(productid);nvram_get(productid);nvram_get(firmver);nvram_get(buildno);nvram_get(extendno);nvram_get(rc_support);nvram_get(ss_support);nvram_get(led_val);
2024-05-11 17:11:49.416 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_load: Endpoint.HOOK
2024-05-11 17:11:49.416 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.HOOK | hook=nvram_get(serial_no);nvram_get(label_mac);nvram_get(lan_hwaddr);nvram_get(wan_hwaddr);nvram_get(productid);nvram_get(productid);nvram_get(firmver);nvram_get(buildno);nvram_get(extendno);nvram_get(rc_support);nvram_get(ss_support);nvram_get(led_val);
2024-05-11 17:11:49.416 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.433 DEBUG (MainThread) [asusrouter.asusrouter] Response 200 received from Endpoint.HOOK
2024-05-11 17:11:49.433 DEBUG (MainThread) [asusrouter.modules.endpoint] Reading data from endpoint Endpoint.HOOK
2024-05-11 17:11:49.437 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module inside the event loop by custom integration 'asusrouter' at custom_components/asusrouter/bridge.py, line 149: await self.api.async_connect() (offender: /usr/local/lib/python3.12/site-packages/asusrouter/modules/endpoint/__init__.py, line 59: submodule = importlib.import_module(module_name)), please create a bug report at https://github.com/Vaskivskyi/ha-asusrouter/issues
2024-05-11 17:11:49.438 DEBUG (MainThread) [asusrouter.modules.identity] Identity collected
2024-05-11 17:11:49.439 DEBUG (MainThread) [asusrouter.modules.identity] Identity read
2024-05-11 17:11:49.439 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.DEVICEMAP | None
2024-05-11 17:11:49.439 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.453 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.ETHERNET_PORTS | None
2024-05-11 17:11:49.453 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.500 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.FIRMWARE | None
2024-05-11 17:11:49.500 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.525 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.HOOK | None
2024-05-11 17:11:49.525 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.528 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.NETWORKMAPD | None
2024-05-11 17:11:49.528 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.531 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.ONBOARDING | None
2024-05-11 17:11:49.531 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.543 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.PORT_STATUS | node_mac=all
2024-05-11 17:11:49.543 DEBUG (MainThread) [asusrouter.connection] Sending request to 10.XX.XX.X4
2024-05-11 17:11:49.546 ERROR (MainThread) [custom_components.asusrouter.config_flow] Unknown error of type '<class 'asusrouter.error.AsusRouterConnectionError'>' during connection to `10.XX.XX.X4`: ('Cannot connect to 10.XX.XX.X4. Failed in `_send_request`', None)
2024-05-11 17:11:49.546 DEBUG (MainThread) [custom_components.asusrouter.bridge] Cleaning up
2024-05-11 17:11:49.546 DEBUG (MainThread) [asusrouter.connection] Resetting connection to 10.XX.XX.X4

Looking at other reported issues it looks like older 386.XX firmware could what connects them. @Vaskivskyi could there be some difference introduced for newer FW, that is incompatible with older ones?

johny-mnemonic avatar May 11 '24 15:05 johny-mnemonic

Hello, guys. Sorry for the late reply. Currently, I don't have any time to check GitHub regularly due to some personal reasons

Does it occur only on HTTP connection or HTTPS as well? From the release logs, I don't see anything that could cause issues, so we'll need to troubleshoot it step-by-step. Also, I don't have devices with 386 support to test it by myself ☹

Vaskivskyi avatar May 19 '24 15:05 Vaskivskyi

I haven't tried to setup HTTPS on any of my routers, so can't comment on that. How can we help you with the debugging? Could you create some version with additional logging in the connection logic?

Also not sure if it could be related, but there is this warning for some async connection logic:

WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module inside the event loop by custom integration 'asusrouter' at custom_components/asusrouter/bridge.py, line 149: await self.api.async_connect()

Could it be something has changed in HA regarding async, which breaks how you connect to routers? They say to create bug report to fix this, so maybe fixing it would do no harm and might actually fix the issue if we are lucky :-)

johny-mnemonic avatar May 20 '24 20:05 johny-mnemonic

I've a similar problem with RT-AC88U -> https://github.com/Vaskivskyi/ha-asusrouter/issues/828 Switching to HTTPS solved the issue for me.

ijavid avatar May 20 '24 20:05 ijavid

Oh well. I can confirm, that enabling HTTPS on the router and using it in the integration works. One would expect more issues with HTTPS, but in this case it seems like HTTP is the broken one...

johny-mnemonic avatar May 20 '24 21:05 johny-mnemonic

Hello, guys. Please, check whether you get any more info than just Cannot connect to xxx.xxx.xxx.xxx with integration version 0.32.0 when HTTP fails

P.S. HTTPS is and has always been more stable connection with AsusWRT. No idea why, to be honest. I will add a recommendation for HTTPS to the README

Vaskivskyi avatar May 25 '24 06:05 Vaskivskyi

Here is a log from 0.32.0:

2024-05-31 21:25:32.154 DEBUG (MainThread) [custom_components.asusrouter.config_flow] Setup initiated
2024-05-31 21:25:32.154 DEBUG (MainThread) [asusrouter.asusrouter] Initializing a new interface to `10.XX.XX.X4`
2024-05-31 21:25:32.154 DEBUG (MainThread) [asusrouter.connection] Initializing a new connection to `10.XX.XX.X4`
2024-05-31 21:25:32.154 DEBUG (MainThread) [asusrouter.connection] Using session `<aiohttp.client.ClientSession object at 0x7f792cb65be0>`
2024-05-31 21:25:32.155 DEBUG (MainThread) [asusrouter.connection] Using `http` and port `80`
2024-05-31 21:25:32.155 DEBUG (MainThread) [custom_components.asusrouter.bridge] Connecting to the API
2024-05-31 21:25:32.155 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_connect
2024-05-31 21:25:32.155 DEBUG (MainThread) [asusrouter.connection] Initializing connection to 10.XX.XX.X4
2024-05-31 21:25:32.155 DEBUG (MainThread) [asusrouter.connection] Requesting authorization
2024-05-31 21:25:32.170 DEBUG (MainThread) [asusrouter.connection] Received authorization response
2024-05-31 21:25:32.170 DEBUG (MainThread) [asusrouter.connection] Connected to 10.XX.XX.X4
2024-05-31 21:25:32.170 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_get_identity
2024-05-31 21:25:32.170 DEBUG (MainThread) [asusrouter.modules.identity] Collecting device identity
2024-05-31 21:25:32.170 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_hook: nvram_get(serial_no);nvram_get(label_mac);nvram_get(lan_hwaddr);nvram_get(wan_hwaddr);nvram_get(productid);nvram_get(productid);nvram_get(firmver);nvram_get(buildno);nvram_get(extendno);nvram_get(rc_support);nvram_get(ss_support);nvram_get(led_val);
2024-05-31 21:25:32.170 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_load: Endpoint.HOOK
2024-05-31 21:25:32.171 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.HOOK | hook=nvram_get(serial_no);nvram_get(label_mac);nvram_get(lan_hwaddr);nvram_get(wan_hwaddr);nvram_get(productid);nvram_get(productid);nvram_get(firmver);nvram_get(buildno);nvram_get(extendno);nvram_get(rc_support);nvram_get(ss_support);nvram_get(led_val);
2024-05-31 21:25:32.171 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.185 DEBUG (MainThread) [asusrouter.asusrouter] Response 200 received from Endpoint.HOOK
2024-05-31 21:25:32.185 DEBUG (MainThread) [asusrouter.modules.endpoint] Reading data from endpoint Endpoint.HOOK
2024-05-31 21:25:32.188 DEBUG (MainThread) [asusrouter.modules.identity] Identity collected
2024-05-31 21:25:32.189 DEBUG (MainThread) [asusrouter.modules.identity] Identity read
2024-05-31 21:25:32.189 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.DEVICEMAP | None
2024-05-31 21:25:32.189 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.204 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.ETHERNET_PORTS | None
2024-05-31 21:25:32.204 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.251 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.FIRMWARE | None
2024-05-31 21:25:32.251 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.255 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.FIRMWARE_NOTE | None
2024-05-31 21:25:32.256 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.259 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.FIRMWARE_NOTE_AIMESH | None
2024-05-31 21:25:32.259 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.263 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.HOOK | None
2024-05-31 21:25:32.263 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.267 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.NETWORKMAPD | None
2024-05-31 21:25:32.267 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.271 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.ONBOARDING | None
2024-05-31 21:25:32.271 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.282 DEBUG (MainThread) [asusrouter.asusrouter] Triggered method async_api_query: Endpoint.PORT_STATUS | node_mac=all
2024-05-31 21:25:32.282 DEBUG (MainThread) [asusrouter.connection] Sending `RequestType.POST` request to `10.XX.XX.X4`
2024-05-31 21:25:32.285 ERROR (MainThread) [custom_components.asusrouter.config_flow] Unknown error of type '<class 'asusrouter.error.AsusRouterConnectionError'>' during connection to `10.XX.XX.X4`: ('Cannot connect to `10.XX.XX.X4` on port `80`. Failed in `_send_request` with error: `Server disconnected`', None)
2024-05-31 21:25:32.285 DEBUG (MainThread) [custom_components.asusrouter.bridge] Cleaning up
2024-05-31 21:25:32.285 DEBUG (MainThread) [asusrouter.connection] Resetting connection to 10.XX.XX.X4

With https it works fine.

BTW: Why is this integration claiming Shelly devices as if they belongs to it? 🧐

johny-mnemonic avatar May 31 '24 19:05 johny-mnemonic

@johny-mnemonic, hello. #839 should help with the wrong device assignment. This will be implemented in the next AR version (within a week). If the issue would persist after the next release, please, open a new issue on this.

Vaskivskyi avatar Jun 08 '24 17:06 Vaskivskyi