Hello all,
I am trying to use an Amcrest IP2M-844E camera with HA and having a few problems. My Configuration file looks like this:
camera:
- platform: amcrest
host: 192.168.1.234
# port: 554
port: 80
name: "Front Door"
username: !secret camera_username
password: !secret camera_password
stream_source: rtsp
resolution: low
What I am seeing is that sometimes it works and sometimes it does not (mostly not) - totally inconsistent! The camera is working 100% from my web browser at http://192.168.1.234/
When it does not work, here is what I see in the log:
2017-07-13 08:57:06 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform amcrest
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 386, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 382, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
response.begin()
File "/usr/lib/python3.4/http/client.py", line 351, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.4/http/client.py", line 313, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.4/socket.py", line 371, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 388, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 308, in _raise_timeout
raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='192.168.1.234', port=80): Read timed out. (read timeout=3.0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 678, in urlopen
**response_kw)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 678, in urlopen
**response_kw)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 678, in urlopen
**response_kw)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/urllib3/util/retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.1.234', port=80): Max retries exceeded with url: /cgi-bin/magicBox.cgi?action=getSerialNo (Caused by ReadTimeoutError("HTTPConnectionPool(host='192.168.1.234', port=80): Read timed out. (read timeout=3.0)",))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 161, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/amcrest.py", line 73, in setup_platform
config.get(CONF_USERNAME), config.get(CONF_PASSWORD)).camera
File "/home/homeassistant/.homeassistant/deps/amcrest/__init__.py", line 32, in __init__
timeout_protocol=timeout_protocol
File "/home/homeassistant/.homeassistant/deps/amcrest/http.py", line 68, in __init__
self._set_name()
File "/home/homeassistant/.homeassistant/deps/amcrest/http.py", line 102, in _set_name
self._serial = self.serial_number
File "/home/homeassistant/.homeassistant/deps/amcrest/system.py", line 93, in serial_number
'magicBox.cgi?action=getSerialNo'
File "/home/homeassistant/.homeassistant/deps/amcrest/http.py", line 147, in command
timeout=self._timeout_protocol,
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/sessions.py", line 515, in get
return self.request('GET', url, **kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/adapters.py", line 504, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.1.234', port=80): Max retries exceeded with url: /cgi-bin/magicBox.cgi?action=getSerialNo (Caused by ReadTimeoutError("HTTPConnectionPool(host='192.168.1.234', port=80): Read timed out. (read timeout=3.0)",))
Any ideas on what I can try next? Is there a way to increase the timeout?
Thank you in advance for any help!
Tom