Closed ekptwtos closed 1 year ago
As per the answer:
The data was not passed in the correct format to the function, so the SOAP message was incomplete.
Check the zeep documentation for details about passing SOAP datastructures.
deviceio_type_factory = deviceIO_service.zeep_client.type_factory("http://www.onvif.org/ver10/deviceIO/wsdl")
serial_data = deviceio_type_factory.SerialData(Binary=zoomin)
ack = deviceIO_service.ws_client.SendReceiveSerialCommand(Token= ports[0].token, SerialData=serial_data, TimeOut='PT0M6S', DataLength='100', Delimiter='')
visca_ack_comp = ack['Binary'].hex()
print(visca_ack_comp )
Heey! Great that you were able to find a solution to your problem!
The onvif classes in libValkka are just convenience-wrappers that are using zeep under-the-hood, so if there is a problem with "valkka onvif" it's basically just a problem of zeep / onvif / soap / xml, not libValkka. For soap problems it's better to ask elsewhere, like stack overflow, just as you did. :)
So the correct way to do this is to use the official onvif wsdl file & that's it?
Hello!
Yes the problem was basically two fold! 1) The onvif that was stored under
/usr/lib/python3/dist-packages/valkka/onvif/wsdl/deviceio.wsdl
was missing the "Token" element, I decided to add that myself, but another way would be to just download the latest onvif file and replace the existing one.
2) I was sending the data incorrectly. That was the way described in the python-onvif-zeep under the section "configure ( control ) your camera ". The correct way is as described in my comment above!
Please feel free to add this to your documentation! This could save someone else's time and frustration when trying to control his camera!
The problem
I have recently acquired an Active Silicon IP-camera and I have been trying to control it using your library. I tried previously using python-onvif-zeep. The camera implements the ONVIF Profile S standard. I would like to send zoom in / our, focus and other basic VISCA commands to the camera using the SendReceiveSerialData service as described in the DeviceIO wsdl, however I can not seem to get it to work. My knowledge in ONVIF, SOAP, and zeep is quite limited so please forgive me if its something too obvious!
Please note : camera does NOT support PTZ service!
Minimal reproducible example and needed changes
MRE
Here is the python code I have:
The first issue I encountered was that the SendReceiveSerialCommand service was not working and the following error occurred:
Needed changes
The reason behind that is the deviceIO.wsdl file of the library. It does not contain the "Token" element, unlike DeviceIO wsdl,therefore I had to manually add it under the SendReceiveSerialCommand element:
After this part was fixed the errors go away, but the camera does not zoom in/out ( depending on which VISCA command is being passed). Additionally, the acknowledgement comes back as "None".
Nothing changes if I fill the dictionary with all the fields from the SendReceiveSerialCommand service like so:
The setup
I am running this python script on Ubuntu 20.04 with python 3.8. The setup is a network between the camera and the laptop with static IP addresses assigned.
Please note that the camera is working as I can successfully send commands to the camera over the web interface and when running the C# example (can be found under downloads->software) it comes with, on a Windows machine.
Thank you in advance for your time and effort to help me out!
------ Original question posted in StackOverflow ------