Work around a 'stuck' legacy Eagle by sending a get_historical_data …#8
Work around a 'stuck' legacy Eagle by sending a get_historical_data …#8toddsay wants to merge 2 commits intojcalbert:nonmicrofrom
Conversation
…equest and adding a delay, with logging Notes: When the legacy Eagle returns a 503 response with text "Timeout waiting for response", through trial-and-error I discovered that it is possible to get things running again by sending the get_historical_data request to the cgi_manager endpoint (as used by the web interface). After sending this request and waiting several seconds, the requests used by this client will typically begin working again. This change automates that workaround process.
|
Would increasing the polling time in Home Assistant resolve the problem? Or would it just delay the problem from occurring to a later date? Adding |
|
@gtdiehl I can give that a try and report back. Currently I'm using a scan_interval of 30 (which is what the code is throttling to anyway). I'll try 120 and see if the code is still logging these workarounds. |
|
@gtdiehl I can confirm that the hang/timeout still occurs for me with a scan_interval of 120. It doesn't seem to be caused by the frequency of calls, but it does seem like the integration contributes to the problem somehow (likely an underlying Legacy Eagle bug, for this out-of-support hardware and firmware). What I don't know, and would like to confirm, is whether the behavior I see from my Eagle device is common to most other Legacy Eagle users. |
|
iirc I saw this problem before integrating with homeassistant. I've had the API freeze in less than a day when testing and sending a lot of requests. Not sure if it's a cumulative or probabilistic effect. My guess is that it'll be hard to diagnose without getting shell access† to the device and the easiest thing is to just use this workaround in the integration. †An Amazon reviewer claims to have brute forced the root password, but afaik hasn't disclosed it or the process anywhere. |
|
Yep, I noticed that Amazon review as well, regarding the poor security and brute-forceable password. As well as some comments about the API locking up after a few days. Currently the API stops working for me about 2 times per day, with this logic recovering access automatically. With this in place its been probably 2-3 months since I last rebooted it (the first several weeks was me experimenting with different combinations of API requests each time it hung, after realizing that using the web interface could make it start responding again). The delay between the |
estebanpapp
left a comment
There was a problem hiding this comment.
Can we get this change in? I am also suffering the same nonsense
…request and adding a delay, with logging
Notes: When the legacy Eagle returns a 503 response with text "Timeout waiting for response", through trial-and-error I discovered that it is possible to get things running again by sending the get_historical_data request to the cgi_manager endpoint (as used by the web interface). After sending this request and waiting several seconds, the requests used by this client will typically begin working again. This change automates that workaround process.