Hi there,
I have been reading along for a few days. Got my Foscam C1 today, setup worked fine with the Foscam app so I am sure that the cam is working properly.
Now I am trying to set it up using onvif as described above. I used both the newest and the version before, both have trouble setting up.
As I am by no means a programmer I can’t figure out what is going on. The only line I understand is “onvif.exceptions.ONVIFError: Unknown error: (400, ‘Bad Request’)”, looks like something is pointing to the wrong URL but I am 100% sure I used the right IP, port and credentials.
2018-01-20 01:13:38 ERROR (MainThread) [custom_components.camera.onvif] Unable to communicate with ONVIF Camera: Unknown error: (400, ‘Bad Request’)
2018-01-20 01:13:38 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform onvif
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/suds/transport/http.py”, line 78, in send
fp = self.u2open(u2request)
File “/usr/lib/python3.6/site-packages/suds/transport/http.py”, line 119, in u2open
return url.open(u2request, timeout=tm)
File “/usr/lib/python3.6/urllib/request.py”, line 532, in open
response = meth(req, response)
File “/usr/lib/python3.6/urllib/request.py”, line 642, in http_response
‘http’, request, response, code, msg, hdrs)
File “/usr/lib/python3.6/urllib/request.py”, line 570, in error
return self._call_chain(*args)
File “/usr/lib/python3.6/urllib/request.py”, line 504, in _call_chain
result = func(*args)
File “/usr/lib/python3.6/urllib/request.py”, line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/suds/client.py”, line 652, in send
reply = transport.send(request)
File “/usr/lib/python3.6/site-packages/suds/transport/http.py”, line 178, in send
return HttpTransport.send(self, request)
File “/usr/lib/python3.6/site-packages/suds/transport/http.py”, line 86, in send
raise TransportError(e.msg, e.code, e.fp)
suds.transport.TransportError: Bad Request
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/onvif/client.py”, line 34, in wrapped
return func(*args, **kwargs)
File “/usr/lib/python3.6/site-packages/onvif/client.py”, line 201, in wrapped
return call(params, callback)
File “/usr/lib/python3.6/site-packages/onvif/client.py”, line 191, in call
ret = func(**params)
File “/usr/lib/python3.6/site-packages/suds/client.py”, line 559, in call
return client.invoke(args, kwargs)
File “/usr/lib/python3.6/site-packages/suds/client.py”, line 618, in invoke
result = self.send(soapenv)
File “/usr/lib/python3.6/site-packages/suds/client.py”, line 664, in send
result = self.failed(binding, e)
File “/usr/lib/python3.6/site-packages/suds/client.py”, line 726, in failed
raise Exception((status, reason))
Exception: (400, ‘Bad Request’)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 171, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/asyncio/tasks.py”, line 180, in _step
result = coro.send(None)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/config/custom_components/camera/onvif.py”, line 47, in async_setup_platform
async_add_devices([ONVIFCameraHASS(hass, config)])
File “/config/custom_components/camera/onvif.py”, line 66, in init
config.get(CONF_USERNAME), config.get(CONF_PASSWORD)
File “/usr/lib/python3.6/site-packages/onvif/client.py”, line 267, in init
self.update_xaddrs()
File “/usr/lib/python3.6/site-packages/onvif/client.py”, line 283, in update_xaddrs
capabilities = self.devicemgmt.GetCapabilities({‘Category’: ‘All’})
File “/usr/lib/python3.6/site-packages/onvif/client.py”, line 36, in wrapped
raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error: (400, ‘Bad Request’)
Any idea what I am doing wrong?
Kind regards,
Bram