Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus control ReferenceToken type doesnt accept collections as value #125

Open
RichRickett opened this issue Jun 18, 2024 · 1 comment
Open

Comments

@RichRickett
Copy link

RichRickett commented Jun 18, 2024

Hi all, I'm successfully using the zoom function in ONVIF using the same mycam details, but can't get the Imaging Focus Move function to work.
I set up a request as follows:

from onvif import ONVIFCamera
mycam = ONVIFCamera('192.168.1.108', 8080, 'admin', 'admin', 'C:/Users/richr/Downloads/python-onvif-zeep-zeep/python-onvif-zeep-zeep/wsdl/')
media = mycam.create_media_service()
imaging = mycam.create_imaging_service()
video_sources=media.GetVideoSources()

requestMove = imaging.create_type('Move')
requestMove.VideoSourceToken = video_sources[0].token
requestMove.Move = 'Focus'
requestMove.Focus = 'Continuous'
requestMove.Speed = 0.5

When I print(requestMove) to check it's all in there, I get;
{
'VideoSourceToken': 'VideoSource0',
'Focus': 'Continuous',
'Move': 'Focus',
'Speed': 0.5
}

But when I try the Move command using
imaging.Move(requestMove)

I get error messages galore culminating in :
File "c:\Users\richr\PythonCode\ZoomF\ONVIF Focus Test.py", line 27, in
imaging.Move(requestMove)
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: The ReferenceToken type doesn't accept collections as value

I've checked and the camera does support all the functions:
{
'Absolute': None,
'Relative': None,
'Continuous': {
'Speed': {
'Min': -1.0,
'Max': 1.0
}
}
}

I feel like I'm very close to getting it to work, could anyone steer me as to what I'm missing ?
cheers

@nchetto
Copy link

nchetto commented Sep 2, 2024

Up, same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants