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

[Bug] Wrong CPU usage after upgrade

Open stskrp opened this issue 1 year ago • 8 comments

The problem

Wrong CPU usage reported, hoes above 100% image image It shows also that router has 4 cores, but in real, it has only 3 cores image

Your device model

DSL-AX82U

Firmware type

Stock

Firmware version

3.0.0.4.386_49607

Integration version with the issue

0.23.2

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

2023.10.5

Is there anything useful in the logs?

No response

Diagnostics information

No response

Additional information

No response

stskrp avatar Nov 05 '23 14:11 stskrp

Sorry to hear you are experiencing issues with AsusRouter.

Do you mind turning on debug logging for the backend library asusrouter to check for CPU information? Should look like this:

2023-11-05 15:21:47.589 DEBUG (MainThread) [asusrouter.asusrouter] Using cached data for AsusData.CPU: {'total': {'total': 36175927.0, 'used': 1674728.0, 'usage': 4.07}, 1: {'total': 9035151, 'used': 781129, 'usage': 4.96}, 2: {'total': 9045202, 'used': 296599, 'usage': 3.31}, 3: {'total': 9047851, 'used': 303425, 'usage': 4.86}, 4: {'total': 9047723, 'used': 293575, 'usage': 3.12}}

It would be nice to get several of those lines. This will help to understand whether the data is received wrongly by the backend library or processed wrongly by the integration

To enable debug logging for the library you can add the following into your configuration.yaml:

logger:
  default: warning
  logs:
      asusrouter: debug

P.S. Please, keep in mind, that debug logging will produce a large amount of output in your log

Vaskivskyi avatar Nov 05 '23 14:11 Vaskivskyi

Hello, Adding lines: Using cached data for AsusData.CPU: {'total': {'total': 1678766.0, 'used': 33390.0}, 1: {'total': 419693, 'used': 9024}, 2: {'total': 419690, 'used': 17489}, 3: {'total': 419691, 'used': 6407}, 4: {'total': 419692, 'used': 470}} 2023-11-05 16:40:58.317 DEBUG (MainThread) [asusrouter.asusrouter] Using cached data for AsusData.CPU: {'total': {'total': 1678766.0, 'used': 33390.0}, 1: {'total': 419693, 'used': 9024}, 2: {'total': 419690, 'used': 17489}, 3: {'total': 419691, 'used': 6407}, 4: {'total': 419692, 'used': 470}} 2023-11-05 16:40:58.317 DEBUG (MainThread) [asusrouter.modules.homeassistant] Converting data to the list of sensors by map: {'total': {'total': 1678766.0, 'used': 33390.0}, 1: {'total': 419693, 'used': 9024}, 2: {'total': 419690, 'used': 17489}, 3: {'total': 419691, 'used': 6407}, 4: {'total': 419692, 'used': 470}}

stskrp avatar Nov 05 '23 14:11 stskrp

Thanks. So this comes from the backend. I will let you know if some more data is required from your side

Vaskivskyi avatar Nov 05 '23 15:11 Vaskivskyi

Hello. Mind checking whether you still have this issue with the new version 0.24.0?

Vaskivskyi avatar Nov 19 '23 22:11 Vaskivskyi

Looks good now, thank you

stskrp avatar Nov 20 '23 13:11 stskrp

I'm still seeing incorrect CPU usage data with 0.24.0 (RT-AC66U)

Screenshot_20231120-101737.png

Screenshot_20231120-101734.png

ejpenney avatar Nov 20 '23 18:11 ejpenney

@ejpenney, the fix should have just solved the problem with usage above 100%. There are still other bugs possible. Do you mind opening a new issue? It's rather hard to track things which are comments. Please, include the update interval you have set for CPU sensor update (default is 30 s if you didn't change it). And HA sensor history for ~1 hour or so, so that it would be possible to see if this is noise in values or oscillations

@stskrp, good that for you it works better now. In case you are experiencing any other problem, please, open a new issue

Vaskivskyi avatar Nov 20 '23 20:11 Vaskivskyi

Sorry for late response, but it looks that it started happening again :/ image

stskrp avatar Nov 24 '23 07:11 stskrp