quatanium / python-onvif

ONVIF Client Implementation in Python
MIT License
470 stars 312 forks source link

NoneType' object has no attribute 'promotePrefixes' error when calling openvif-cli #36

Open ghost opened 8 years ago

ghost commented 8 years ago

onvif-cli -u "admin" -a "..." --host "192.168.100.3" --port 80 --wsdl /usr/local/wsdl/ Traceback (most recent call last): File "/usr/local/bin/onvif-cli", line 9, in load_entry_point('onvif==0.1.3', 'console_scripts', 'onvif-cli')() File "/usr/local/lib/python2.7/dist-packages/onvif/cli.py", line 160, in main cli.setup(args) File "/usr/local/lib/python2.7/dist-packages/onvif/cli.py", line 39, in setup args.wsdl, encrypt=args.encrypt) File "/usr/local/lib/python2.7/dist-packages/onvif/client.py", line 227, in init self.update_xaddrs() File "/usr/local/lib/python2.7/dist-packages/onvif/client.py", line 237, in update_xaddrs services = self.devicemgmt.GetServices({'IncludeCapability': False}) File "/usr/local/lib/python2.7/dist-packages/onvif/client.py", line 31, in wrapped raise ONVIFError(err) onvif.exceptions.ONVIFError: Unknown error: 'NoneType' object has no attribute 'promotePrefixes'

Has anyone ever had this problem?

jogu commented 8 years ago

I have the same issue. Latest git master against an sv3c b01-4mp-poe camera. In my case I wonder if the camera even supports onvif (though the manufacturer claims it does); here's a capture of the network traffic:

POST /onvif/device_service HTTP/1.1
Accept-Encoding: identity
Content-Length: 1139
Soapaction: "http://www.onvif.org/ver10/device/wsdl/GetCapabilities"
Host: 192.168.1.10:80
User-Agent: Python-urllib/2.7
Connection: close
Content-Type: application/soap+xml

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns0="http://www.onvif.org/ver10/device/wsdl" xmlns:ns1="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"><SOAP-ENV:Header><wsse:Security mustUnderstand="true"><wsse:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">lhn2rEjktgTvNozpufEgfZen9ys=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ZjBhYzA3Mjg0MjQ1ZDllYjEzYzFjYmYzMzFhYjQ1Yzg=</wsse:Nonce><wsu:Created>2016-07-04T21:20:02.287438Z</wsu:Created></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header><ns1:Body><ns0:GetCapabilities><ns0:Category>All</ns0:Category></ns0:GetCapabilities></ns1:Body></SOAP-ENV:Envelope>

HTTP/1.0 200 OK
Content-type: application/binary
Server: uc-httpd 1.0.0
Expires: 0

<html><head><title>404 File Not Found</title></head>
<body>The requested URL was not found on this server</body></html>
jogu commented 8 years ago

For my case, the issue is that the http server that supports onvif is not on port 80 - it works once I added --port 8899. I used onvif manager ( https://sourceforge.net/p/onvifdm/wiki/Home/ ) to discover the real port - it seems to only be available for Windows unfortunately.