core: CamHipro Wireless WiFi 5MP 240X ZOOM Camera cannot parse XML or respond to `GetCapabilities` with 2023.5.x and later

The problem

next onvif problem here

What version of Home Assistant Core has the issue?

2023.5.0b5

What was the last working version of Home Assistant Core?

2023.4.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

onvif

Link to integration documentation on our website

No response

Diagnostics information

Logger: homeassistant.config_entries Source: components/onvif/device.py:309 First occurred: 22:12:07 (1 occurrences) Last logged: 22:12:07

Error setting up entry Cam Zoom 3 - C4:3C:B0:EA:72:5A for onvif
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 38, in async_setup_entry
    await device.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 112, in async_setup
    self.profiles = await self.async_get_profiles()
  File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 309, in async_get_profiles
    result = await media_service.GetProfiles()
  File "/usr/local/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
    return await self._proxy._binding.send_async(
  File "/usr/local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 156, in send_async
    response = await client.transport.post_xml(
  File "/usr/local/lib/python3.10/site-packages/zeep/transports.py", line 235, in post_xml
    response = await self.post(address, message, headers)
  File "/usr/local/lib/python3.10/site-packages/zeep/transports.py", line 220, in post
    response = await self.client.post(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1845, in post
    return await self.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1617, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1719, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request
    return await self._connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 116, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 95, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 159, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 195, in _receive_event
    data = await self._network_stream.read(
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 34, in read
    return await self._stream.receive(max_bytes=max_bytes)
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 1265, in receive
    await self._protocol.read_event.wait()
  File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
    await fut
asyncio.exceptions.CancelledError

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 96 (58 by maintainers)

Commits related to this issue

Most upvoted comments

Can you share the full log?

My email is nick [at] koston [dot] org

Please try 2023.5.4 when it is released

Thanks with 2023.5.4 the 5mp ptz works again.

I’ll follow up when the hardware arrives

It might be better to wait until the test camera shows up

The last one you just sent the camera didn’t respond at all to the request. I’m not sure it was booted yet or was still in a the stuck state

Also please power cycle the device before trying again as I think once it gets into a bad state it won’t recover on its own

Can you adjust the loggers so we can pick up the custom component and try again

# Example configuration.yaml entry
logger:
  default: info
  logs:
    homeassistant.components.onvif: debug
    custom_components.onvif: debug
    httpx: debug
    onvif: debug
    zeep: debug

got it.

Its getting a lot further.

2023-05-07 00:02:51.389 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/device_service:
2023-05-07 00:02:51.400 DEBUG (MainThread) [httpx] HTTP Request: POST http://192.168.2.189:8080/onvif/device_service "HTTP/1.1 200 OK"
2023-05-07 00:02:51.401 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.2.189:8080/onvif/device_service (status: 200):
2023-05-07 00:02:51.403 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/device_service:
2023-05-07 00:02:51.413 DEBUG (MainThread) [httpx] HTTP Request: POST http://192.168.2.189:8080/onvif/device_service "HTTP/1.1 200 OK"
2023-05-07 00:02:51.415 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.2.189:8080/onvif/device_service (status: 200):
2023-05-07 00:02:51.416 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/device_service:
2023-05-07 00:02:51.425 DEBUG (MainThread) [httpx] HTTP Request: POST http://192.168.2.189:8080/onvif/device_service "HTTP/1.1 200 OK"
2023-05-07 00:02:51.426 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.2.189:8080/onvif/device_service (status: 200):
2023-05-07 00:02:51.427 DEBUG (MainThread) [onvif] Creating service ('media', None) with http://192.168.2.189:8080/onvif/media_service
2023-05-07 00:02:51.429 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/media_service:
2023-05-07 00:02:51.434 DEBUG (MainThread) [httpx] HTTP Request: POST http://192.168.2.189:8080/onvif/media_service "HTTP/1.1 200 OK"
2023-05-07 00:02:51.435 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.2.189:8080/onvif/media_service (status: 200):
2023-05-07 00:02:51.436 DEBUG (MainThread) [onvif] Creating service ('imaging', None) with http://192.168.2.189:8080/onvif/image_service
2023-05-07 00:02:51.436 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/media_service:
2023-05-07 00:02:51.473 DEBUG (MainThread) [httpx] HTTP Request: POST http://192.168.2.189:8080/onvif/media_service "HTTP/1.1 200 OK"
2023-05-07 00:02:51.475 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.2.189:8080/onvif/media_service (status: 200):
2023-05-07 00:02:51.479 DEBUG (MainThread) [onvif] Creating service ('ptz', None) with http://192.168.2.189:8080/onvif/ptz_service
2023-05-07 00:02:51.607 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/ptz_service:
2023-05-07 00:02:51.624 DEBUG (MainThread) [httpx] HTTP Request: POST http://192.168.2.189:8080/onvif/ptz_service "HTTP/1.1 200 OK"
2023-05-07 00:02:51.631 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.2.189:8080/onvif/ptz_service (status: 200):
2023-05-07 00:02:51.679 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/ptz_service:
2023-05-07 00:02:51.693 DEBUG (MainThread) [httpx] HTTP Request: POST http://192.168.2.189:8080/onvif/ptz_service "HTTP/1.1 200 OK"
2023-05-07 00:02:51.701 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.2.189:8080/onvif/ptz_service (status: 200):
2023-05-07 00:02:51.738 DEBUG (MainThread) [onvif] Creating service ('notification', None) with http://192.168.2.189:8080/onvif/event_service
2023-05-07 00:02:51.740 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/event_service:
2023-05-07 00:03:26.249 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/event_service:
2023-05-07 00:03:56.253 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.2.189:8080/onvif/media_service:
2023-05-07 00:04:26.258 WARNING (MainThread) [homeassistant.config_entries] Config entry 'PTZ - 00:0A:24:33:32:D2' for onvif integration not ready yet: Could not connect to camera 192.168.2.189:8080: ; Retrying in background

Can you try power cycling the device before setting it up again with the 2.1.4 version?

no ReadError in the log so definitely making progress

I pushed onvif-zeep-async==2.1.4

cd /config
curl -o- -sSL https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d onvif -p 92700
cat /config/custom_components/onvif/manifest.json

Verify that the version displayed above is “onvif-zeep-async==2.1.4” and NOT 2.1.1

Restart HA

Test

Delete /config/custom_components/onvif and restart after testing is completed to restore the core version

I’m trying to work up an alternate solution. Give me ~30m

We don’t know if the camera has gone away or its just failing to respond because it does nothing when it gets a request with WSAs

o wait. It does look like its making more progress

Edit: there was a problem with the checkout script above. I edited the command and fixed it

@pbvdven Thanks for the logs. At least we have a better idea on whats going on now

If you enable debug logs we should be able to get a better idea about what is going on with the camera

# Example configuration.yaml entry
logger:
  default: info
  logs:
    homeassistant.components.onvif: debug
    httpx: debug
    onvif: debug
    zeep: debug

You’ll need to restart

It does look like the same issue. The other one I ordered still hasn’t shipped yet so I’ll order this one

There were some more fixes from other test cameras that arrived recently in 2023.5.1 that might help.

https://github.com/home-assistant/core/pull/92354 should be in b7 (or 2023.5.0)

Summary

  • reverts the previous change since the behavior is obviously worse
  • moves events to start later which was the original goal
  • adds a lot of logging which may give more clues as to why the Cam Zoom 3 one is failing.

On one hand I’m hoping that the Cam Zoom 3 is giving out bad xaddrs since at least we would know the root cause. We should know with the new logging

Thanks for checking. I’ll report back when the test unit arrives

I’ll be sure to setup the test unit on wifi when it arrives. If you can test with ethernet in the mean that that would be a helpful datapoint

Will check tomorrow with 5.0b5 again on ethernet