I have upgraded a RPb3 venv to RPb4 docker image. Unfortunately I can’t for the life of me get 2 Dahua cameras to work either as ONVIF (which previously worked) or ffmpeg / stream. In both cases the docker seems not to be allowing traffic through, despite network_mode being set to “host”.
Trying to use the UI ONVIF device setup times out or throws “Unknown error occurred”. Adding the cameras through yaml causes my entire network to grind to a very slow crawl, home assistant to take tens of minutes to start and throw an ‘Error Handling Request’ (log below).
I’ve spent a couple of days reading the docs / forums, but can’t seem to pin down the reasons for the problem - I may need to simply build a new venv on the rpb4 - although part of the attraction of docker was avoiding the horrid builds of ffmpeg and pyav!
If anyone has a clue as to what I’m doing wrong before I go in that direction I’d really appreciate it.
Extra notes:
- I have tried ports 554 (RTSP) / 40000 (TCP) / UDP (37778) / 80 (HTTP)
- ONVIF is turned on on both cameras
- Multicast is turned on on both cameras
- I can view the cameras on their web-interface via the local network
- I can view the cameras via RTSP on VNC
Here is my docker-compose.yaml
version: '3.8'
networks:
homeassistant:
external: true
services:
broker:
container_name: mosquitto
image: eclipse-mosquitto
expose:
- "1883"
ports:
- "1883:1883"
restart: always
homeassistant:
container_name: homeassistant
image: homeassistant/home-assistant:stable
network_mode: "host"
volumes:
- /opt/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
devices:
- /dev/ttyACM0:/dev/ttyACM0:rwm
restart: always
Here are the cameras in cameras.yaml (included from configuration.yaml)
- platform: onvif
host: 192.168.0.200
name: t_cam1
username: !secret cam_usr
password: !secret cam_pwd
port: 554
- platform: onvif
host: 192.168.0.201
name: t_cam2
username: !secret cam_usr
password: !secret cam_pwd
port: 554
Here is the relevant log error
Logger: homeassistant
Source: components/onvif/config_flow.py:203
First occurred: 17:25:21 (1 occurrences)
Last logged: 17:25:21
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/httpx/_exceptions.py", line 326, in map_exceptions
yield
File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1502, in _send_single_request
(status_code, headers, stream, ext,) = await transport.arequest(
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 218, in arequest
response = await connection.arequest(
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/connection.py", line 106, in arequest
return await self.connection.arequest(method, url, headers, stream, ext)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/http11.py", line 72, in arequest
) = await self._receive_response(timeout)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/http11.py", line 133, in _receive_response
event = await self._receive_event(timeout)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/http11.py", line 172, in _receive_event
data = await self.socket.read(self.READ_NUM_BYTES, timeout)
File "/usr/local/lib/python3.8/site-packages/httpcore/_backends/asyncio.py", line 153, in read
raise
File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.8/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions
raise to_exc(exc) from None
httpcore.ReadError: [Errno 104] Connection reset by peer
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 130, in async_init
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/onvif/config_flow.py", line 275, in async_step_import
return await self.async_step_profiles()
File "/usr/src/homeassistant/homeassistant/components/onvif/config_flow.py", line 203, in async_step_profiles
await device.update_xaddrs()
File "/usr/local/lib/python3.8/site-packages/onvif/client.py", line 276, in update_xaddrs
capabilities = await devicemgmt.GetCapabilities({"Category": "All"})
File "/usr/local/lib/python3.8/site-packages/zeep/proxy.py", line 64, in __call__
return await self._proxy._binding.send_async(
File "/usr/local/lib/python3.8/site-packages/zeep/wsdl/bindings/soap.py", line 156, in send_async
response = await client.transport.post_xml(
File "/usr/local/lib/python3.8/site-packages/zeep/transports.py", line 230, in post_xml
response = await self.post(address, message, headers)
File "/usr/local/lib/python3.8/site-packages/zeep/transports.py", line 215, in post
response = await self.client.post(
File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1633, in post
return await self.request(
File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1371, in request
response = await self.send(
File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1406, in send
response = await self._send_handling_auth(
File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1444, in _send_handling_auth
response = await self._send_handling_redirects(
File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1476, in _send_handling_redirects
response = await self._send_single_request(request, timeout)
File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1502, in _send_single_request
(status_code, headers, stream, ext,) = await transport.arequest(
File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.8/site-packages/httpx/_exceptions.py", line 343, in map_exceptions
raise mapped_exc(message, **kwargs) from exc # type: ignore
httpx.ReadError: [Errno 104] Connection reset by peer