-
Notifications
You must be signed in to change notification settings - Fork 145
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
onvif.exceptions.ONVIFError: Unknown error: ('Connection aborted.', BadStatusLine('POST... *HTTP/1.1 500 Internal Server Error\r\n')) #118
Comments
I have a similar problem with a Tapo 500. Basically, nothing works so I captured the traffic and I figured out that the Tapo does not like the GetCapabilities request. request.xml:
When I use curl to do the POST request, it returns an error. I believe that there was not even a reply. The connection is simply closed.
I eventually found what seems to be the problem: The Tapo does not like the self-closing tag For example, the following GetCapabilities request works fine
but that one does not
This is quite a problem because there are probably a lot of onvif clients that do not work on the tapo for the same reason. I will try to fill a ticket at Tp-Link about. Is there a way to prevent onvif-zeep to produce closing tags? |
I figured out how to prevent self-closing tags. The XML is produced in package zeep by the function etree_to_string in wsdl/utils.py def etree_to_string(node):
for elem in node.iter():
if elem.text == None:
elem.text = ''
return etree.tostring(
node, pretty_print=False, xml_declaration=True, encoding="utf-8"
) So I can now successfully do the GetCapabilities and a few other requests. I still get a disconnection later in my test script but this is probably because I am trying to use an feature that is not supported by my Tapo 500 (i.e. PTZ ContinuousMove) |
I noticed some self-closing tag in a network trace from another onvif tool that appears to be working fine so my initial diagnostic is probably incorrect. Something odd is happening here!!! |
Another workaround is to do I think that it would return the same thing as providing no argument, but I'm not sure.
Edit: nevermind. I just tried it with zeep 4.3.1 and it still results in a 500 response. |
Hi, I was trying to connect TP-Link tapo C220 ip camera with python, but I 'm stuck on a problem. Here is my code :
When I start this code, it is the error message:
What's wrong with my code? Thanks
The text was updated successfully, but these errors were encountered: