I have a RP3 running Hassio version 61.1 and I am trying to add an Amcrest IP2M-841 camera. I had two Foscam cameras working correctly, but commented them out to match configuration information that found in other questions related to Amcrest cameras.
I have tried all of the configurations from the previous questions but continue to get the same type of error message on the frontend.
2018-01-25 15:26:01 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=120 from 2018-01-25 16:00:43.906043)
2018-01-25 15:26:21 ERROR (MainThread) [homeassistant.setup] Error during setup of component amcrest
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 199, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/amcrest.py", line 99, in setup
device.get(CONF_PASSWORD)).camera
File "/usr/lib/python3.6/site-packages/amcrest/__init__.py", line 32, in __init__
timeout_protocol=timeout_protocol
File "/usr/lib/python3.6/site-packages/amcrest/http.py", line 67, in __init__
self._token = self._generate_token()
File "/usr/lib/python3.6/site-packages/amcrest/http.py", line 82, in _generate_token
req.raise_for_status()
File "/usr/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://192.168.0.28:1028/cgi-bin/magicBox.cgi?action=getMachineName
2018-01-25 15:26:21 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of camera.amcrest. Setup failed for dependencies: amcrest
2018-01-25 15:26:21 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform camera.amcrest: Could not setup all dependencies.
2018-01-25 15:26:57 WARNING (SyncWorker_14) [homeassistant.components.zwave] zwave not ready after 30 seconds, continuing anyway
I am going to change configuration to match @nickelk13386’s file and reboot.
2018-01-25 15:52:13 ERROR (MainThread) [homeassistant.setup] Error during setup of component amcrest
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 199, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/amcrest.py", line 99, in setup
device.get(CONF_PASSWORD)).camera
File "/usr/lib/python3.6/site-packages/amcrest/__init__.py", line 32, in __init__
timeout_protocol=timeout_protocol
File "/usr/lib/python3.6/site-packages/amcrest/http.py", line 67, in __init__
self._token = self._generate_token()
File "/usr/lib/python3.6/site-packages/amcrest/http.py", line 82, in _generate_token
req.raise_for_status()
File "/usr/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://192.168.0.28:1028/cgi-bin/magicBox.cgi?action=getMachineName
2018-01-25 15:52:14 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of camera.amcrest. Setup failed for dependencies: amcrest
2018-01-25 15:52:14 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform camera.amcrest: Could not setup all dependencies.
2018-01-25 15:53:01 WARNING (SyncWorker_10) [homeassistant.components.zwave] zwave not ready after 30 seconds, continuing anyway
My host, user, password and port are correct and will open the camera web page with video. Also works with those setting on Synology disk station.
This error usually means the username/password is incorrect.
Try hitting that URL in your browser and enter the username/password and see what it tells you.
There are no missing files errors in the log you posted. The error you are getting is requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://192.168.0.28:1028/cgi-bin/magicBox.cgi?action=getMachineName
So when you hit the URL http://192.168.0.28:1028/cgi-bin/magicBox.cgi?action=getMachineName in your web browser what is displayed?
I had this issue before and recently when I re-enabled the platform I only enabled amcrest and not the camera and it seemed to work. Maybe try commenting out the camera section?
I am seeing the same error on my fresh install of Hassbian. I was running an older install of Hassbian that would have had python 3.4. I copied all files from my previous install and the camera worked. Switching to the new install of Hassbian and replacing files had this error come up. All other items in my config are working normally.
Not sure if this is related to all the issues here but like to share in case it helps someone.
Just found out for my amcrest camera (IPM-HX1B) when no recording schedule or destination is set for snapshot in the Storage/Destination page of the camera setup, HA can’t get video when stream_source=snapshot and give error.
The error has to do with no response from [cam ip:port]/cgi-bin/snapshot.cgi?channel=0
From HA:
stream_source (Optional): …, whereas snapshot will use the camera’s snapshot API to create a stream from still images. …, it defaults to snapshot.
Apparently Amcrest’s snapshot API is not accessible when not ‘enabled’.
My testing of stream_source, all refresh ~10s in the card:
mjpeg, click to access video, freezes in couple of seconds
snapshot, click to access video, works but slow refresh ~10s
rtsp, click to access video, freezes in couple of seconds
Using ffmpeg camera for amcrest video is much better for me, click on access video, smooth live stream, doesn’t freeze.