fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
553 stars 101 forks source link

unexpected error #587

Open INVADIA666 opened 1 year ago

INVADIA666 commented 1 year ago

after trying different ways of adding the reolink Duo POE camera to HA using the reolink integrations I still get the " unexpected error" after 2 weeks.

I installed reolink discovery, reolink ip devices and reolink ip camera. the discovery integration finds my studio camera which is the E1 pro ( not sure if supported to be seen in HA dashboard ) and asks to configure it, once I click on configure the error pops up again " unexpected error "

the Duo poe is in a different wifi ( mesh) network so I have to add it manually , but once I put the required information and click submit , the message shows up again.

its a bit annoying as the cameras are the only thing missing in my dashboards.

would be nice if someone can help me to fix this .

find attached photos for the network/ ports config along with the logs .

thanks heaps..

Screen Shot 2022-10-24 at 1 02 47 pm

Screen Shot 2022-10-24 at 1 02 18 pm

Screen Shot 2022-10-24 at 12 59 11 pm ![Screen Shot 2022-10-24 at 1 07 03 pm](https://user-images.githubusercontent.com/104712857/1974 Screen Shot 2022-10-24 at 1 07 18 pm 40963-ab8f94a9-05e1-4766-8ada-8ce84ab5069e.png)

Screen Shot 2022-10-24 at 1 07 03 pm

logs

This error originated from a custom integration.

Logger: custom_components.reolink_rest.config_flow Source: custom_components/reolink_rest/config_flow.py:204 Integration: Reolink IP Device (documentation, issues) First occurred: 1:02:22 PM (3 occurrences) Last logged: 1:26:12 PM

Unhanled exception occurred Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection raise exceptions[0] File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect return await fut File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 535, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.68.141', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/reolink_rest/config_flow.py", line 204, in async_step_user if not await client.login( File "/usr/local/lib/python3.10/site-packages/async_reolink/api/security/init.py", line 71, in login async for response in self._execute( File "/usr/local/lib/python3.10/site-packages/async_reolink/rest/connection.py", line 252, in __execute response = await context File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.68.141:80 ssl:default [Connect call failed ('192.168.68.141', 80)]

This error originated from a custom integration.

Logger: custom_components.reolink_dev.config_flow Source: custom_components/reolink_dev/base.py:220 Integration: Reolink IP camera (documentation, issues) First occurred: 12:59:19 PM (5 occurrences) Last logged: 1:25:42 PM

Unexpected exception Traceback (most recent call last): File "/config/custom_components/reolink_dev/config_flow.py", line 70, in async_step_user self.info = await self.async_validate_input(self.hass, user_input) File "/config/custom_components/reolink_dev/config_flow.py", line 138, in async_validate_input if not await self.base.connect_api(): File "/config/custom_components/reolink_dev/base.py", line 220, in connect_api if not await self._api.get_settings(): File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 496, in get_settings response = await self.send(body) File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 1661, in send if not await self.login(): File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 854, in login response = await self.send(body, param) File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 1723, in send raise ApiError( reolink.exceptions.ApiError: API returned HTTP status ERROR code 404/Not Found

skynet01 commented 1 year ago

Try using this integration: https://github.com/JimStar/reolink_cctv

INVADIA666 commented 1 year ago

Try using this integration: https://github.com/JimStar/reolink_cctv

I'll try it out. keep you posted , thanks heaps 🙏🏻

INVADIA666 commented 1 year ago

Try using this integration: https://github.com/JimStar/reolink_cctv

hey mate , quick update , I tried the integration you suggested and unfortunately it did not work at all , I got a different message " failed to connect " I tried different ports , ( 80, 443, 8000) but none of them worked.

here're the logs :

This error originated from a custom integration.

Logger: custom_components.reolink_cctv.config_flow Source: custom_components/reolink_cctv/host.py:173 Integration: Reolink IP NVR/camera (documentation, issues) First occurred: 12:30:27 PM (1 occurrences) Last logged: 12:30:27 PM

Unexpected exception Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection raise exceptions[0] File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect return await fut File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 535, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.68.136', 8000)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/reolink_cctv/config_flow.py", line 74, in async_step_user self.info = await self.async_obtain_host_settings(self.hass, user_input) File "/config/custom_components/reolink_cctv/config_flow.py", line 140, in async_obtain_host_settings if not await host.init(): File "/config/custom_components/reolink_cctv/host.py", line 173, in init if await self._api.get_host_data(): File "/usr/local/lib/python3.10/site-packages/reolink_ip/api.py", line 821, in get_host_data response = await self.send(body) File "/usr/local/lib/python3.10/site-packages/reolink_ip/api.py", line 2069, in send if not await self.login(): File "/usr/local/lib/python3.10/site-packages/reolink_ip/api.py", line 527, in login await self.logout(True) # Ensure there would be no "max session" error File "/usr/local/lib/python3.10/site-packages/reolink_ip/api.py", line 592, in logout await self.send(body, param) File "/usr/local/lib/python3.10/site-packages/reolink_ip/api.py", line 2130, in send raise e File "/usr/local/lib/python3.10/site-packages/reolink_ip/api.py", line 2107, in send response = await session.post(url = self._url, json = body, params = param, allow_redirects = False) File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.68.136:8000 ssl:default [Connect call failed ('192.168.68.136', 8000)]

skynet01 commented 1 year ago

Ah, looks like you are getting "ConnectionRefusedError" error.. I assume you checked to make sure you have all the required ports open in the camera network settings? ... That link to a different integration is not mine, you can ask about your issue there as that plugin is actually being developed :)