ha-tplink-deco icon indicating copy to clipboard operation
ha-tplink-deco copied to clipboard

List Clients timed out

Open Mattrees007 opened this issue 2 years ago • 10 comments

Version of the custom_component

Configuration

Add your logs here.

Describe the bug

When I try to add the integration i get an "unknown error occurred" which appears after a minute or so.

A clear and concise description of what the bug is.

Debug log


Add your logs here.

image

Mattrees007 avatar Apr 09 '22 08:04 Mattrees007

Same for me.

Scoopien avatar Apr 21 '22 21:04 Scoopien

Please enable and post debug logs.

amosyuen avatar Apr 21 '22 21:04 amosyuen

Este erro teve origem numa integração personalizada.

Logger: custom_components.tplink_deco Source: custom_components/tplink_deco/api.py:198 Integration: TP-Link Deco (documentation, issues) First occurred: 23:56:36 (3 occurrences) Last logged: 23:57:44

Unexpected error fetching tplink_deco-clients data: 'utf-8' codec can't decode byte 0xb8 in position 0: invalid start byte Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/tplink_deco/coordinator.py", line 236, in _async_update_data deco_client_responses = await asyncio.gather( File "/config/custom_components/tplink_deco/coordinator.py", line 39, in async_call_with_retry return await func(*args) File "/config/custom_components/tplink_deco/api.py", line 198, in async_list_clients client["name"] = base64.b64decode(client["name"]).decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 0: invalid start byte

Este erro teve origem numa integração personalizada.

Logger: custom_components.tplink_deco Source: custom_components/tplink_deco/config_flow.py:57 Integration: TP-Link Deco (documentation, issues) First occurred: 23:57:44 (1 occurrences) Last logged: 23:57:44

Error testing credentials: 'utf-8' codec can't decode byte 0xb8 in position 0: invalid start byte

Scoopien avatar Apr 21 '22 22:04 Scoopien

2022-04-24 18:57:36 DEBUG (MainThread) [custom_components.tplink_deco] Finished fetching tplink_deco-decos data in 4.059 seconds (success: True) 2022-04-24 18:58:06 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-35-18 timed out 2022-04-24 18:58:06 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-1A-34 timed out 2022-04-24 18:58:06 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-16-C4 timed out 2022-04-24 18:58:32 DEBUG (MainThread) [custom_components.tplink_deco] Finished fetching tplink_deco-clients data in 56.007 seconds (success: True)

Mattrees007 avatar Apr 24 '22 17:04 Mattrees007

@Scoopien your error is different. I created a new issue for yours at https://github.com/amosyuen/ha-tplink-deco/issues/64.

amosyuen avatar Apr 25 '22 09:04 amosyuen

Ok sorry

Scoopien avatar Apr 25 '22 09:04 Scoopien

@Mattrees007 Looks like the calls are timing out for some reason. Please follow advanced debugging steps at https://github.com/amosyuen/ha-tplink-deco/blob/master/DEBUGGING.md to verify what your list client requests from Admin UI look like.

amosyuen avatar Apr 25 '22 09:04 amosyuen

response to the "...?form=client_list" was

sign=#################&data=JkNJB82aXkeZZdfcXa07M8VsPn7j0U%2B9Q6VowAODNX0nmTzYY%2F26w8rw9wtTwS64EkkaduBOk%2FGAif1z6Spejw%3D%3D

Ran the following in the console. data = "JkNJB82aXkeZZdfcXa07M8VsPn7j0U%2B9Q6VowAODNX0nmTzYY%2F26w8rw9wtTwS64EkkaduBOk%2FGAif1z6Spejw%3D%3D"; jQuery.encrypt.encryptManager.encryptor.AesDecrypt(decodeURIComponent(data));

Result was {"operation":"read","params":{"device_mac":"default"}}

Mattrees007 avatar Apr 25 '22 16:04 Mattrees007

2022-04-24 20:58:51 DEBUG (MainThread) [custom_components.tplink_deco] aes_key=4670221534599327 2022-04-24 20:58:51 DEBUG (MainThread) [custom_components.tplink_deco] aes_iv=9464511344736993 2022-04-24 20:58:51 DEBUG (MainThread) [custom_components.tplink_deco] password_rsa_n=147400152213047990727033136147004346733103031985288458332450458806859242043605003404150174090446171651650480460233560027136327325663456109096372971869531130727197464059178168406922984183008755410378326074461124456947748570215827915280709053787014995116751665099191965014918961216467473409603919228363587361789 2022-04-24 20:58:51 DEBUG (MainThread) [custom_components.tplink_deco] password_rsa_e=65537 2022-04-24 20:58:52 DEBUG (MainThread) [custom_components.tplink_deco] sign_rsa_n=9688174529359620609448795656656199290346479171146585778107155429373871167142950438380623447803779438104917788421351767178944927351619555025163039410907223 2022-04-24 20:58:52 DEBUG (MainThread) [custom_components.tplink_deco] sign_rsa_e=65537 2022-04-24 20:58:52 DEBUG (MainThread) [custom_components.tplink_deco] seq=181835793 2022-04-24 20:58:53 DEBUG (MainThread) [custom_components.tplink_deco] cookie=sysauth=a82bfe38e516d41a6de7b3c0986332ab 2022-04-24 20:58:53 DEBUG (MainThread) [custom_components.tplink_deco] stok=c025aa2c36cdceb71939dd172d174e3d 2022-04-24 20:58:56 DEBUG (MainThread) [custom_components.tplink_deco] List devices device_count=3 2022-04-24 20:58:56 DEBUG (MainThread) [custom_components.tplink_deco] List devices device_list=[{'nand_flash': False, 'owner_transfer': True, 'previous': '98-DA-C4-ED-16-C4', 'device_ip': '192.168.100.71', 'bssid_2g': '98:DA:C4:ED:35:1A', 'parent_device_id': '80193194BDFE3B593388243BB07D492A1BCF7AE3', 'software_ver': '1.5.2 Build 20210916 Rel. 56193', 'role': 'slave', 'bssid_sta_5g': '9E:DA:C4:ED:16:C7', 'hardware_ver': '1.0', 'device_id': '8019714696B385965DAC02A547FA947B1BD0DF4E', 'product_level': 100, 'inet_status': 'online', 'nickname': 'bedroom', 'bssid_5g': '98:DA:C4:ED:35:1B', 'connection_type': ['band2_4', 'band5'], 'set_gateway_support': True, 'inet_error_msg': 'well', 'group_status': 'connected', 'mac': '98-DA-C4-ED-35-18', 'bssid_sta_2g': '9E:DA:C4:ED:16:C6', 'support_plc': False, 'oem_id': '0f3d0225dbc161eaadd408b21c2ccba2', 'signal_level': {'band2_4': '2', 'band5': '1'}, 'device_model': 'M4R', 'oversized_firmware': False, 'speed_get_support': True, 'hw_id': '1328d595c1bb97cb66a14645d4a112a7', 'device_type': 'HOMEWIFISYSTEM'}, {'nand_flash': False, 'owner_transfer': True, 'device_ip': '192.168.100.69', 'previous': '98-DA-C4-ED-16-C4', 'bssid_5g': '98:DA:C4:ED:1A:37', 'parent_device_id': '80193194BDFE3B593388243BB07D492A1BCF7AE3', 'software_ver': '1.5.2 Build 20210916 Rel. 56193', 'role': 'slave', 'bssid_sta_5g': '9E:DA:C4:ED:16:C7', 'bssid_sta_2g': '9E:DA:C4:ED:16:C6', 'device_id': '801992820A28C06366590EBB2082EB641BCF2B87', 'product_level': 100, 'hardware_ver': '1.0', 'inet_status': 'online', 'support_plc': False, 'bssid_2g': '98:DA:C4:ED:1A:36', 'mac': '98-DA-C4-ED-1A-34', 'set_gateway_support': True, 'inet_error_msg': 'well', 'connection_type': ['band2_4', 'band5'], 'custom_nickname': 'TG91bmdl', 'nickname': 'Lounge', 'group_status': 'connected', 'oem_id': '0f3d0225dbc161eaadd408b21c2ccba2', 'signal_level': {'band2_4': '2', 'band5': '2'}, 'device_model': 'M4R', 'oversized_firmware': False, 'speed_get_support': True, 'hw_id': '1328d595c1bb97cb66a14645d4a112a7', 'device_type': 'HOMEWIFISYSTEM'}, {'nand_flash': False, 'hardware_ver': '1.0', 'bssid_sta_2g': '', 'software_ver': '1.5.2 Build 20210916 Rel. 56193', 'role': 'master', 'bssid_sta_5g': '', 'previous': '', 'inet_status': 'online', 'nickname': 'hallway', 'oversized_firmware': False, 'bssid_5g': '9E:DA:C4:ED:16:C7', 'set_gateway_support': True, 'inet_error_msg': 'well', 'group_status': 'connected', 'mac': '98-DA-C4-ED-16-C4', 'bssid_2g': '9E:DA:C4:ED:16:C6', 'support_plc': False, 'oem_id': '0f3d0225dbc161eaadd408b21c2ccba2', 'signal_level': {'band5': '0', 'band2_4': '0'}, 'product_level': 100, 'device_ip': '192.168.100.1', 'device_model': 'M4R', 'hw_id': '1328d595c1bb97cb66a14645d4a112a7', 'device_type': 'HOMEWIFISYSTEM'}] 2022-04-24 20:58:56 DEBUG (MainThread) [custom_components.tplink_deco] Finished fetching tplink_deco-decos data in 4.705 seconds (success: True) 2022-04-24 20:59:26 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-35-18 timed out 2022-04-24 20:59:26 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-1A-34 timed out 2022-04-24 20:59:26 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-16-C4 timed out 2022-04-24 20:59:51 DEBUG (MainThread) [custom_components.tplink_deco] Finished fetching tplink_deco-clients data in 55.392 seconds (success: True) 2022-04-24 20:59:51 DEBUG (MainThread) [custom_components.tplink_deco] aes_key=9813419148506746 2022-04-24 20:59:51 DEBUG (MainThread) [custom_components.tplink_deco] aes_iv=6818251563532672 2022-04-24 20:59:52 DEBUG (MainThread) [custom_components.tplink_deco] password_rsa_n=147400152213047990727033136147004346733103031985288458332450458806859242043605003404150174090446171651650480460233560027136327325663456109096372971869531130727197464059178168406922984183008755410378326074461124456947748570215827915280709053787014995116751665099191965014918961216467473409603919228363587361789 2022-04-24 20:59:52 DEBUG (MainThread) [custom_components.tplink_deco] password_rsa_e=65537 2022-04-24 20:59:52 DEBUG (MainThread) [custom_components.tplink_deco] sign_rsa_n=9688174529359620609448795656656199290346479171146585778107155429373871167142950438380623447803779438104917788421351767178944927351619555025163039410907223 2022-04-24 20:59:52 DEBUG (MainThread) [custom_components.tplink_deco] sign_rsa_e=65537 2022-04-24 20:59:52 DEBUG (MainThread) [custom_components.tplink_deco] seq=970958189 2022-04-24 20:59:53 DEBUG (MainThread) [custom_components.tplink_deco] cookie=sysauth=b9320014a0550515a6a946edfd42f12a 2022-04-24 20:59:53 DEBUG (MainThread) [custom_components.tplink_deco] stok=07fa314e4858052c8fe2d7cbf0d364a6 2022-04-24 21:00:14 DEBUG (MainThread) [custom_components.tplink_deco] List devices device_count=3 2022-04-24 21:00:14 DEBUG (MainThread) [custom_components.tplink_deco] List devices device_list=[{'nand_flash': False, 'owner_transfer': True, 'previous': '98-DA-C4-ED-16-C4', 'device_ip': '192.168.100.71', 'bssid_2g': '98:DA:C4:ED:35:1A', 'parent_device_id': '80193194BDFE3B593388243BB07D492A1BCF7AE3', 'software_ver': '1.5.2 Build 20210916 Rel. 56193', 'role': 'slave', 'bssid_sta_5g': '9E:DA:C4:ED:16:C7', 'hardware_ver': '1.0', 'device_id': '8019714696B385965DAC02A547FA947B1BD0DF4E', 'product_level': 100, 'inet_status': 'online', 'nickname': 'bedroom', 'bssid_5g': '98:DA:C4:ED:35:1B', 'connection_type': ['band2_4', 'band5'], 'set_gateway_support': True, 'inet_error_msg': 'well', 'group_status': 'connected', 'mac': '98-DA-C4-ED-35-18', 'bssid_sta_2g': '9E:DA:C4:ED:16:C6', 'support_plc': False, 'oem_id': '0f3d0225dbc161eaadd408b21c2ccba2', 'signal_level': {'band2_4': '2', 'band5': '1'}, 'device_model': 'M4R', 'oversized_firmware': False, 'speed_get_support': True, 'hw_id': '1328d595c1bb97cb66a14645d4a112a7', 'device_type': 'HOMEWIFISYSTEM'}, {'nand_flash': False, 'owner_transfer': True, 'device_ip': '192.168.100.69', 'previous': '98-DA-C4-ED-16-C4', 'bssid_5g': '98:DA:C4:ED:1A:37', 'parent_device_id': '80193194BDFE3B593388243BB07D492A1BCF7AE3', 'software_ver': '1.5.2 Build 20210916 Rel. 56193', 'role': 'slave', 'bssid_sta_5g': '9E:DA:C4:ED:16:C7', 'bssid_sta_2g': '9E:DA:C4:ED:16:C6', 'device_id': '801992820A28C06366590EBB2082EB641BCF2B87', 'product_level': 100, 'hardware_ver': '1.0', 'inet_status': 'online', 'support_plc': False, 'bssid_2g': '98:DA:C4:ED:1A:36', 'mac': '98-DA-C4-ED-1A-34', 'set_gateway_support': True, 'inet_error_msg': 'well', 'connection_type': ['band2_4', 'band5'], 'custom_nickname': 'TG91bmdl', 'nickname': 'Lounge', 'group_status': 'connected', 'oem_id': '0f3d0225dbc161eaadd408b21c2ccba2', 'signal_level': {'band2_4': '2', 'band5': '2'}, 'device_model': 'M4R', 'oversized_firmware': False, 'speed_get_support': True, 'hw_id': '1328d595c1bb97cb66a14645d4a112a7', 'device_type': 'HOMEWIFISYSTEM'}, {'nand_flash': False, 'hardware_ver': '1.0', 'bssid_sta_2g': '', 'software_ver': '1.5.2 Build 20210916 Rel. 56193', 'role': 'master', 'bssid_sta_5g': '', 'previous': '', 'inet_status': 'online', 'nickname': 'hallway', 'oversized_firmware': False, 'bssid_5g': '9E:DA:C4:ED:16:C7', 'set_gateway_support': True, 'inet_error_msg': 'well', 'group_status': 'connected', 'mac': '98-DA-C4-ED-16-C4', 'bssid_2g': '9E:DA:C4:ED:16:C6', 'support_plc': False, 'oem_id': '0f3d0225dbc161eaadd408b21c2ccba2', 'signal_level': {'band5': '0', 'band2_4': '0'}, 'product_level': 100, 'device_ip': '192.168.100.1', 'device_model': 'M4R', 'hw_id': '1328d595c1bb97cb66a14645d4a112a7', 'device_type': 'HOMEWIFISYSTEM'}] 2022-04-24 21:00:14 DEBUG (MainThread) [custom_components.tplink_deco] Finished fetching tplink_deco-decos data in 22.780 seconds (success: True) 2022-04-24 21:00:44 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-35-18 timed out 2022-04-24 21:00:44 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-1A-34 timed out 2022-04-24 21:00:44 DEBUG (MainThread) [custom_components.tplink_deco] List Clients 98-DA-C4-ED-16-C4 timed out 2022-04-24 21:00:51 DEBUG (MainThread) [custom_components.tplink_deco] Finished fetching tplink_deco-clients data in 37.228 seconds (success: True)

Mattrees007 avatar Apr 25 '22 16:04 Mattrees007

Hmm, the request payload looks correct. It's quite suprising that the list devices call works but not the list clients. It's also intriguing that it fails with timeout. Some other things to check:

  • Could you check the request URL for list clients in the browser developer console. looks like http://192.168.0.1/cgi-bin/luci/;stok=<redacted>/admin/client?form=client_list, is yours diferent? e.g. using https instead of http, different port, etc.
  • Could you see if anything stands out in how the list devices and list clients request differ? Compare base request URL and request headers.
  • In the admin UI for list clients, can you select a specific deco and check the request for that list clients call?

amosyuen avatar May 12 '22 07:05 amosyuen