-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: Configurable HTTP time out and throttle / stop connection attempts until ping succeeds #33
Comments
While I haven't experience this exact issue, my container restarts due to a ping timeout dozens of times a day. I added more env variables to the py logic so I can easily tune the ping settings on the docker environment variables which are then consumed by the ping function: ping_wait_ms = int(os.getenv("AMCREST_PINGWAIT") or 100) def ping_camera(): |
This is the read error I see: Amcrest error HTTPConnectionPool(host='192.168.30.48', port=80): Read timed out. |
I should have left a more complete log. This pattern repeats once an hour. |
To me it looks like #43 is refering to the same.. personally I have also some issues with the pinging of the device.. |
I had this exact same issue with one of my doorbells (but not the other). It was because the one was streaming to an NVR and the other wasn't. Going into the python-amcrest config.py file and editing the timeout to a bigger number, I no longer saw the issue. This issue should be reopened. |
The recent update seems to fix the offline state issue by using ping but I would like to suggest further stability improvements:
Trying again due to error: ReadTimeout(ReadTimeoutError("HTTPConnectionPool(host='192.168.103.8', port=80): Read timed out. (read timeout=6.05)"))
As an alternative the http connection also return if the Host is unreachable, this message could be used to back off connection attempts as it means that the device did not respond at all / is not online.
Trying again due to error: ConnectionError(MaxRetryError("HTTPConnectionPool(host='192.168.103.8', port=80): Max retries exceeded with url: /cgi-bin/magicBox.cgi?action=getMachineName (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at ADDRESS>: Failed to establish a new connection: [Errno 113] **Host is unreachable**'))"))
In my environment I have noted that there are at least 3 failed HTTP connections after a restart of this docker, I think backing off / increasing the time out or letting the user control it would help this work better.
The text was updated successfully, but these errors were encountered: