Code Monkey home page Code Monkey logo

Comments (26)

elad-bar avatar elad-bar commented on August 20, 2024

released v2.0.0b8 with fix for it, please check and update

thanks

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

HI, unfortunately partially still there:

2024-05-18 13:04:34.136 ERROR (MainThread) [custom_components.hpprinter.managers.rest_api] Failed to get /DevMgmt/ProductConfigDyn.xml, Error: Connection timeout to host http://192.168.1.50:80/DevMgmt/ProductConfigDyn.xml, Line: 343

IS the only timeout line I get, all sensors are working fine.

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

Can you pls try tobaccess that page directly?

Thanks

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

Works fine:

image

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

when trying to load the page, can you check if it take more than 3 seconds?

thanks

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024
root@MyHomeCenter:~$ time wget -pq --no-cache --delete-after http://192.168.1.50:80/DevMgmt/ProductConfigDyn.xml

real    0m0.203s
user    0m0.007s
sys     0m0.003s

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

Thanks for answering the next question :)
I will increase the timeout to 10 seconds (for now it is defined for 3 seconds), that's the only thing that make sense...
Problem is that i'm abroad and will not be able to do it up until the weekend,
I can redirect you to the specific file that requires that change if you want to test it locally

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

I can find it myself, no worries.

The bad is that there is something holding the request in your integration as doing it manually it takes way less that 1s

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

Agree, can you please increase the timeout set logs to debug and share the logs, i will be able to see what is that process

Thanks

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

Still

2024-05-22 10:22:43.557 ERROR (MainThread) [custom_components.hpprinter.managers.rest_api] Failed to get /DevMgmt/ProductConfigDyn.xml, Error: Connection timeout to host http://192.168.1.50:80/DevMgmt/ProductConfigDyn.xml, Line: 337

Let me enable debug now

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

Cannot find any additional info in the log:

2024-05-22 10:58:22.849 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 4.293 seconds (success: True)
2024-05-22 11:03:25.556 ERROR (MainThread) [custom_components.hpprinter.managers.rest_api] Failed to get /DevMgmt/ProductConfigDyn.xml, Error: Connection timeout to host http://192.168.1.50:80/DevMgmt/ProductConfigDyn.xml, Line: 337
2024-05-22 11:03:25.907 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to http://192.168.1.50:80/DevMgmt/ConsumableConfigDyn.xml
2024-05-22 11:03:28.059 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to http://192.168.1.50:80/DevMgmt/ProductUsageDyn.xml

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

Seems to oscillate a lot:

2024-05-22 10:43:07.781 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 5.226 seconds (success: True)
2024-05-22 10:48:12.468 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 4.913 seconds (success: True)
2024-05-22 10:53:18.148 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 5.593 seconds (success: True)
2024-05-22 10:58:22.849 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 4.293 seconds (success: True)
2024-05-22 11:03:28.137 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 5.582 seconds (success: True)
2024-05-22 11:08:33.582 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 5.027 seconds (success: True)
2024-05-22 11:13:38.351 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 4.797 seconds (success: True)
2024-05-22 11:18:41.415 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 2.859 seconds (success: True)
2024-05-22 11:23:44.040 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 2.484 seconds (success: True)

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

Pls post a full debug log not parts of it, otherwise i cannot understand what happens in code

Fact that total update time is more than 3 seconds doesn't indicate an issue, timeout is per request while in single update there are multiple http request that each of them can be timed out.

I didn't experience any timeout that's the reason i'm asking for that information

Thanks

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

@chemelli74 is it still relevant?

thanks

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

I still see it from time to time, I think there is something blocking the refresh and this is the reason it's so slow.

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

What machine are you running ha on? How many integrations do you have? I'm thinking maybe limitation of threads (as there are 5-6 endpoint to collect the data from)

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

found out that ProductUsageDyn loading time can take up to 4.5 seconds at my network, printer from postman,
timeout set to 5 seconds, which supposed to be enough, pls check latest and update

thanks

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

found out that ProductUsageDyn loading time can take up to 4.5 seconds at my network,

Only inside the integration, look at #129

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

4.5 seconds is for ProductUsageDyn measured in postman not HA

same test as you conducted above for both resources:

user@host:~# time wget -pq --no-cache --delete-after http://IP/DevMgmt/ProductUsageDyn.xml

real    0m4.577s
user    0m0.003s
sys     0m0.002s
user@host:~# time wget -pq --no-cache --delete-after http://IP/DevMgmt/ProductConfigDyn.xml

real    0m0.485s
user    0m0.002s
sys     0m0.002s

if it would happen for different resources i would go with the assumption that something is blocking one of the threads that leads to the error, but since it's specific resource, maybe you can run the same test as load test, or just enable debug log level in logs,
i have added in v2.0.2 timing for each of the calls (regardless ok, timeout or 404).

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

Side note:
Seems that with v2.0.2 I have again all entities doubled;
Did you change again the unique id ?

Can you please add a migration method when this happen ?
It's a pain to fix everything at every update.

Thank you in advance

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

no, it was done at 2.0.1 but i also expirenced it when upgraded to 2.0.2

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

the method is to delete those entities, you can do it in the entity tab in device & services

from ha-hpprinter.

elad-bar avatar elad-bar commented on August 20, 2024

did you manage to check it with v2.0.2 or above?

thanks

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

the method is to delete those entities, you can do it in the entity tab in device & services

The method is to use the migrate in config_flow ;-)
Should not be done manually by users.

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

did you manage to check it with v2.0.2 or above?

thanks

Installed but need a bit of time to enable debug and check.
Sorry for being slow.

from ha-hpprinter.

chemelli74 avatar chemelli74 commented on August 20, 2024

With debug enabled I don't experience the timeout error anymore
Will try now without.

from ha-hpprinter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.