question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'ONVIFCamera' object has no attribute 'devicemgmt'

See original GitHub issue

I’ve not worked with onvif nor wsdl files before, trying to control a onvif compatible Tonton PTZ camera. Seems I just can’t seem to get any of the object attributes from the camera, any assistance would be greatly appreciated, also, how do I know where in the camera the wsdl file is actually stored as I’m using the default /etc/onvif/wsdl path?

from onvif import ONVIFCamera mycam = ONVIFCamera(‘192.168.1.101’, 80, ‘admin’, ‘admin’, ‘/etc/onvif/wsdl/’) resp = mycam.devicemgmt.GetHostname() print ('My camera`s hostname: ’ + str(resp.Name))

AttributeError: ‘ONVIFCamera’ object has no attribute ‘devicemgmt’

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
abhilash-ingalecommented, Apr 2, 2020

Hi @westpirate , after reading through the issues dozens of times, I tried pasting the above devicemgmt.wsdl file into the following directory -

/home/usr/.virtualenvs/env1/lib/python3.5/site-packages/onvif/wsdl

I think you should be able to get it up and running. The other issues that might arise are already discussed. I could PTZ control my IP cam.

Note: I am using a virtual environment called ‘env1’ on Ubuntu 16.04

Cheers, Abhilash

2reactions
Calinoucommented, Mar 13, 2020

You can download the ONVIF WSDL files from this page.

For example, try saving devicemgmt.wsdl into a folder named wsdl/ in your project folder: https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl (right-click > Save Link Target As…)

Then change the '/etc/onvif/wsdl/' parameter in the ONVIFCamera() constructor to 'wsdl' (if your main script is located just above the wsdl/ folder). The code sample should work once you do this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ONVIF Camera Questions - Home Assistant Community
I have been reading other topics about ONVIF camera errors, ... AttributeError: 'NoneType' object has no attribute 'getroottree'.
Read more >
python-onvif-zeep - Bountysource
mycam = ONVIFCamera("192.168.10.180", 80, 'admin', 'admin') event_service ... AttributeError: 'NoneType' object has no attribute 'PanTilt'. Status is
Read more >
onvif-zeep - PyPI
Python Client for ONVIF Camera. ... params = mycam.devicemgmt.create_type('SetHostname') ... ONVIFCamera has support methods to create new services::
Read more >
onvif.exceptions.ONVIFError: Unknown error: No such file: /etc ...
Modify the following path /etc/onvif/wsdl/ to where you have the wsdl file. By default, you have it in ...
Read more >
OnVif & Discovery — Python Media Streaming Framework for ...
So, use Zeep as your SOAP client, give it the WSDL file and that's about it. OnVif with Zeep¶. Rather than giving you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found