Closed abaretta closed 4 years ago
The ONVIF client uses digest authentication when connecting to the device service per section 5.12.1 of the ONVIF Core Specification. Either your device is non-conformant, or you have configured the entry incorrectly.
i am having the same error, i use the ONVIF integration, not yaml, so i let it discover or add manually it succeeds, the entity is created, i can even watch my camera live feed in HA , then a few moments later, or if i restart HA , the error below comes, and live feed is gone, and also the entity is gone
2020-06-17 22:51:52 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry C1 - 00626E940744 for onvif
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 847, in start
message, payload = await self._protocol.read() # type: ignore # noqa
File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 591, in read
await self._waiter
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_proto.py", line 199, in data_received
messages, upgraded, tail = self._parser.feed_data(data)
File "aiohttp\_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message='invalid constant string'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
hass, self
File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 73, in async_setup_entry
if not await device.async_setup():
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 97, in async_setup
self.capabilities = await self.async_get_capabilities()
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 246, in async_get_capabilities
event_capabilities = await event_service.GetServiceCapabilities()
File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/bindings.py", line 13, in send
options["address"], envelope, http_headers
File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 107, in post_xml
response = await self.post(address, message, headers)
File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 95, in post
proxy=self.proxy,
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 504, in _request
await resp.start(conn)
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 852, in start
message=exc.message, headers=exc.headers) from exc
aiohttp.client_exceptions.ClientResponseError: 400, message='invalid constant string', url='http://192.168.0.38:888/onvif/device_service
and running 111.3 :)
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
Error while setting up onvif platform for camera
Environment
Problem-relevant
configuration.yaml
Traceback/Error logs
Additional information
It seems the setup URL pointing to the onvif/device_service does not include the username:password. When I include them in the http://192.168.20.133:10554/username:password@onvif/device_service the camera correctly returns the Onvif capabilities:
RTSP/1.0 200 OK Cseq: 0 Date: Sun, Apr 12 2020 15:29:20 GMT Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
Thanks in advance!