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
424 stars 138 forks source link

Confirmed Works on Python3 + Added AboluteMove PTZ examples #67

Closed lordet01 closed 3 months ago

lordet01 commented 4 years ago

We added additional AbsoluteMove PTZ example. Works confirmed on HikVision PTZ (HIKVISION DS-2DE2204IW-DE3 2MP IP PTZ )

ricciolino commented 1 year ago

I have a IMOU Ranger 2C 4MP model. I try to run the AbsoluteMove example provided in this PR, but I gon the following error:

Traceback (most recent call last):
  File "/home/ricciolino/.local/lib/python3.10/site-packages/onvif/client.py", line 23, in wrapped
    return func(*args, **kwargs)
  File "/home/ricciolino/.local/lib/python3.10/site-packages/onvif/client.py", line 153, in wrapped
    return call(params, callback)
  File "/home/ricciolino/.local/lib/python3.10/site-packages/onvif/client.py", line 140, in call
    ret = func(**params)
  File "/home/ricciolino/.local/lib/python3.10/site-packages/zeep/proxy.py", line 46, in __call__
    return self._proxy._binding.send(
  File "/home/ricciolino/.local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 135, in send
    return self.process_reply(client, operation_obj, response)
  File "/home/ricciolino/.local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
    return self.process_error(doc, operation)
  File "/home/ricciolino/.local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 391, in process_error
    raise Fault(
zeep.exceptions.Fault: This optional method is not implemented

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ricciolino/Downloads/onvif_absolute_pos.py", line 271, in <module>
    move_up(ptz, positionrequest)
  File "/home/ricciolino/Downloads/onvif_absolute_pos.py", line 42, in move_up
    do_move(ptz, request)
  File "/home/ricciolino/Downloads/onvif_absolute_pos.py", line 32, in do_move
    ptz.AbsoluteMove(request)
  File "/home/ricciolino/.local/lib/python3.10/site-packages/onvif/client.py", line 26, in wrapped
    raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error: This optional method is not implemented

What does this mean? Possibly my camera does not implement the AbsoluteMove action and so the only option I have to move it is thought the ContinousMove request?

m0ose commented 3 months ago

I can verify that it is able to move a Bolin EXU248FW Outdoor 4k PTZ . There is one problem, which I think is the camera's fault. ptz.GetStatus({'ProfileToken': media_profile.token}) always returns PanTilt coordinates of zero.