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

Cannot run events.py - no element 'PullMessages' #80

Open xultz opened 3 years ago

xultz commented 3 years ago

Hi, I'm starting with onvif, so I'm trying to run the examples to control a PTZ camera. I am able to run the continuous_move.py example, but when I try to run the events.py code, I get the error:

raise exceptions.LookupError( zeep.exceptions.LookupError: No element 'PullMessages' in namespace http://docs.oasis-open.org/wsrf/rw-2. Available elements are: -

Am I missing something?

What I need to do is to move the camera to a preset, and know somehow when the camera finished moving to that position, is it possible in any way using the onvif protocol?

Thank you for any help!

yingchengpa commented 2 years ago

https://github.com/yingchengpa/python-onvif2-zeep/

support hecv and repair the event bug .

-------------------------------demo ---------------------------------- self.events_service = self.mycam.create_events_service() print(self.events_service.GetEventProperties()) pullpoint = self.mycam.create_pullpoint_service()

    try:
       pullmess = pullpoint.PullMessages({"Timeout": datetime.timedelta(seconds=5), "MessageLimit": 10})
       print(pullmess.CurrentTime)
       print(pullmess.TerminationTime)
       for msg in pullmess.NotificationMessage:
         print(msg)
       except Exception as e:
          print(e)
       finally:
          pass

--------------------------------TopicExpressionType parse error ---------------- Message is ##any ,you should modify b-2.xsd ##any to tt::Message