FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
420 stars 137 forks source link

onvif.exceptions.ONVIFError: Unknown error: Unknown fault occured #124

Closed RichRickett closed 3 weeks ago

RichRickett commented 1 month ago

Hi, newby here. I have a generic IP camera, ONVIF-capable, checked using ODM (had to turn off Avast antivirus to get it to work). All I want to do is make a small app that controls the zoom and possibly focus of the camera.

Initially just trying to connect to the camera using ONVIF-Zeep, but I get a series of errors (below). I've tried varieties of path and directories for the devicemgmt file - forward slash, back slash, added a fullstop before, added a final slash - but can't connect. Any help very much appreciated.

I'm using Python 3.11.3-64 bit. This is the relevant line:

mycam = ONVIFCamera('192.168.1.108', 80, 'admin', 'admin', 'C:/Users/richr/Downloads/python-onvif-zeep-zeep/python-onvif-zeep-zeep/wsdl')

This is the output: Traceback (most recent call last): File "c:\Users\richr\AppData\Local\Programs\Python\Python311\Lib\site-packages\onvif\client.py", line 23, in wrapped return func(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\richr\AppData\Local\Programs\Python\Python311\Lib\site-packages\onvif\client.py", line 153, in wrapped return call(params, callback) ^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\richr\AppData\Local\Programs\Python\Python311\Lib\site-packages\onvif\client.py", line 140, in call ret = func(params) ^^^^^^^^^^^^^^ File "C:\Users\richr\AppData\Roaming\Python\Python311\site-packages\zeep\proxy.py", line 46, in call return self._proxy._binding.send( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\richr\AppData\Roaming\Python\Python311\site-packages\zeep\wsdl\bindings\soap.py", line 135, in send return self.process_reply(client, operation_obj, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\richr\AppData\Roaming\Python\Python311\site-packages\zeep\wsdl\bindings\soap.py", line 229, in process_reply return self.process_error(doc, operation) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\richr\AppData\Roaming\Python\Python311\site-packages\zeep\wsdl\bindings\soap.py", line 352, in process_error raise Fault( zeep.exceptions.Fault: Unknown fault occured

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\Users\richr\PythonCode\ZoomF\ZoomF.py", line 13, in mycam = ONVIFCamera('192.168.1.108', 80, 'admin', 'admin', 'C:/Users/richr/Downloads/python-onvif-zeep-zeep/python-onvif-zeep-zeep/wsdl') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\richr\AppData\Local\Programs\Python\Python311\Lib\site-packages\onvif\client.py", line 216, in init self.update_xaddrs() File "c:\Users\richr\AppData\Local\Programs\Python\Python311\Lib\site-packages\onvif\client.py", line 233, in update_xaddrs capabilities = self.devicemgmt.GetCapabilities({'Category': 'All'}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\richr\AppData\Local\Programs\Python\Python311\Lib\site-packages\onvif\client.py", line 26, in wrapped raise ONVIFError(err) onvif.exceptions.ONVIFError: Unknown error: Unknown fault occured

RichRickett commented 1 month ago

Error appeared to be caused by port discrepancy, should be 8080 rather than 80 (although ODM shows it as 80), also missed the final '/' from the path. Next step is to try and work out how to zoom in and out using TKinter buttons.