-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
HttpException: Invalid response line #3
Comments
Hi @wmhseir3, in this case can you give me some sample code for the operation you are trying to perform? It looks like the request might be the problem in this case, whereas in the past the code has had a problem with the response. |
hi, here is my codes as followings. I commented it out the "profs = await easyOnvif.media.getProfiles();"as this is another issue in #4. I managed to find the the profileToken manually when calling the zoomIn which causing this issue #3.
br, |
#5 should solve this issue as well. |
easy_onvif 0.0.10 has been published to pub.dev, it included the PR for #5 , let me know if it resolves the issue so I can close this. |
The 0.0.10 build still has the same issue and not solved. The captured DioError are as followings: Thanks for your prompt reply on this next. |
just tried the 0.0.11 with this issue and the same DioError appeared. |
please look into the soap messages below which causes the "HttpException: Invalid response line " issue when zoom connect to both of my test devices. this issue stops my further progress |
I've published v0.0.12, which corrected a problem with the Onvif SOAP envelope and also includes a working example for a Flutter app in the example folder. However, I'm not confident that these changes will resolve the "HttpException: Connection closed" issue. I suspect that this issue may be related to the minimal support that Dart has for XML processing. In the current implementation of easy_onvif I'm using the xml2json package to convert the XML response (a big string) into json, which then gets converted into Dart objects. For very large responses this is very inefficient, and on resource constrained mobile devices, it has the potential to be a problem. Though, since I can't replicate this issue I can't be certain that this is actually the cause of the "HttpException: Connection closed" error. My suggestion is to try out both the example flutter app and the sample cli app (available in the github repository) and see if the error still occurs in one or both cases. This could give a clue to the source of the problem. |
I tried 0.12.0 with the flutter_model example. It's still getting the HttpException: Connection closed before full header was received" with the new 2nd nvt. I would like to offer you the steps for you to test with this nvt remotely in your end. Can you please send email to me @wmhseir3@gmail.com? |
I don't have a full explanation, but I see a problem with the "Onvif Rtsp Server for Android" even without using my code. I used the following curl command to attempt to get a response from the device and it fails as well:
The same command works with both test devices I have available. |
Also, reading through the Happytimesoft Technology Co. user manual for the Onvif Sever on page 14, I see that the "GetSystemDateAndTime" feature doesn't appear to be supported, so as confirmation that the problem is not command related, I also ran:
which uses "GetCapabilities", which the documentation shows is supported. It gives the same So, I don't think I can do much more to help with this issue. |
@wmhseir3 , if you're interested, I was able to find a Onvif server that runs in a docker container. It's really easy to use. Just clone the repository then from the repository folder run:
Then you can test my sample flutter app using the following config:
See this StackOverflow post if you need an explanation for the IP address. With this setup easy_onvif v0.0.13 works as expected. The more recent version better follows the Onvif spec when responding to a "GetSystemDateAndTime" with a "GetSystemDateAndTimeResponse". |
@wmhseir3, I've gone a little overboard on this, since I don't like not knowing :-) To check if the problem with "Onvif Rtsp Server for Android" was network related I installed the server app and my sample client onto the same device and experienced the same problem. Next I tried to telnet to the advertised IP address and port for the server app. For this I do get an initial connection, however trying to send any data to the server through this connection, causes the connection to close. Taking the same steps with the "mpromonet/v4l2onvif" docker container however worked as expected: (the request, sent with telnet)
I got this response:
This points fairly conclusively to the problem being related to the "Onvif Rtsp Server for Android" software. It looks like there is an issue with the HTTP server portion of the app. I was able to connect with out issue with both telnet and VLC to the RTSP port of the app. So that part appears to be functioning properly. |
hi, I tried the 0.0.9 with the following exception when making the ptz operation with one valid profileToken.
E/flutter (28604): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Exception: DioError [DioErrorType.other]: HttpException: Invalid response line, uri = http://192.168.1.103:2020/onvif/service
E/flutter (28604): #0 DioMixin.assureDioError (package:dio/src/dio_mixin.dart:819:20)
E/flutter (28604): #1 DioMixin._dispatchRequest (package:dio/src/dio_mixin.dart:678:13)
E/flutter (28604):
E/flutter (28604): #2 DioMixin.fetch.. (package:dio/src/dio_mixin.dart)
E/flutter (28604):
E/flutter (28604):
E/flutter (28604): #0 Soap.send (package:easy_onvif/src/soap.dart:34:7)
E/flutter (28604):
E/flutter (28604): #1 Soap.retrieveEnvlope (package:easy_onvif/src/soap.dart:43:26)
E/flutter (28604):
E/flutter (28604): #2 Ptz.continuousMove (package:easy_onvif/src/ptz.dart:30:5)
E/flutter (28604):
E/flutter (28604): #3 Ptz._zoom (package:easy_onvif/src/ptz.dart:192:5)
E/flutter (28604):
E/flutter (28604): #4 Ptz.zoomIn (package:easy_onvif/src/ptz.dart:203:5)
I do not have the response for you this time as it's null as with the error.
![ptz_error_screen](https://user-images.githubusercontent.com/55186251/136729606-23b77743-03de-47f8-a3fb-c0c774d5d62e.jpg)
However, I attached the my debug screen capture for you to refer to which might be better than nothing.
br,
William
The text was updated successfully, but these errors were encountered: