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

[GetProfiles] DioError [DioErrorType.other]: HttpException: Connection closed before full header was received. #10

Closed
Cu-Toof opened this issue Feb 18, 2022 · 4 comments

Comments

@Cu-Toof
Copy link

Cu-Toof commented Feb 18, 2022

I use easy_onvif v0.0.15 to connect to a camera IP.
Getting the camera's information is successful but getting profiles is not.
Could you provide me with some solution for this issue? thanks
I receive some answers: requestData is too large. Could you provide me with some solution for reducing requestData size? thanks

Exception: DioError [DioErrorType.other]: HttpException: Connection closed before full header was received, uri = [http://14.241.168.136/onvif/media_service]()
        Source stack:
#0      DioMixin.fetch
package:dio/src/dio_mixin.dart:479
#1      DioMixin.request
package:dio/src/dio_mixin.dart:474
#2      DioMixin.post
package:dio/src/dio_mixin.dart:97
#3      Soap.send
package:camera_control/…/src/soap.dart:18
#4      Soap.retrieveEnvlope
package:camera_control/…/src/soap.dart:52
#5      Media.getProfiles
package:camera_control/…/src/media.dart:41
#6      _MyHomePageState._initialize
package:camera_control/main.dart:94
@faithoflifedev
Copy link
Owner

Hello @Cu-Toof ,

I found the following regarding the "Connection closed..." issue - https://stackoverflow.com/questions/55879550/how-to-fix-httpexception-connection-closed-before-full-header-was-received - a number of the solutions are related to the underlying network and there is no code change that I can make to resolve them.

If the problem is related to the requestData then I'm not sure that there is any change that I can make. Onvif is an XML based protocol and XML is very verbose.

I would more expect that applications would have a problem with the response data. I have yet to find a decent XML parser that supports namespaces in Dart. My work-around was to convert the Onvif XML response to JSON and then to Dart objects. This is very memory inefficient for large responses, but until a better XML parser comes around ...

The only partial solution I can offer right now is to add a section to the README asking people to list Onvif device models that they know the package works with and those where it doesn't. That way some people will know in advance if their Onvif device is supported.

@faithoflifedev
Copy link
Owner

Hello @Cu-Toof ,

I published a new version today - 1.0.0-dev.2 - you can give it a try and see if it solves your issue.

@faithoflifedev
Copy link
Owner

Hello @Cu-Toof ,

I was able to identify a bug that was causing this issue with some devices. The new v1.0.2 resolves the issue.

@faithoflifedev
Copy link
Owner

#32 gives more detail about this issue.

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