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

HttpException: Invalid response line #8

Closed
wmhseir3 opened this issue Oct 29, 2021 · 21 comments
Closed

HttpException: Invalid response line #8

wmhseir3 opened this issue Oct 29, 2021 · 21 comments

Comments

@wmhseir3
Copy link

hi, I tried the 0.0.13 with my physical nvt calling the onvif.ptz.moveLeft(profileToken). This will lead to the following exceptions:
E/flutter (20637): [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 (20637): #0 DioMixin.assureDioError (package:dio/src/dio_mixin.dart:821:20)
E/flutter (20637): #1 DioMixin._dispatchRequest (package:dio/src/dio_mixin.dart:678:13)
E/flutter (20637):
E/flutter (20637): #2 DioMixin.fetch.. (package:dio/src/dio_mixin.dart)
E/flutter (20637):
E/flutter (20637):
E/flutter (20637): #0 Soap.send (package:easy_onvif/src/soap.dart:34:7)
E/flutter (20637):
E/flutter (20637): #1 Soap.retrieveEnvlope (package:easy_onvif/src/soap.dart:43:26)
E/flutter (20637):
E/flutter (20637): #2 Ptz.continuousMove (package:easy_onvif/src/ptz.dart:30:5)
E/flutter (20637):
E/flutter (20637): #3 Ptz._move (package:easy_onvif/src/ptz.dart:103:5)
E/flutter (20637):
E/flutter (20637): #4 Ptz.moveLeft (package:easy_onvif/src/ptz.dart:120:5)

My sample codes are as followings:
var onvif = Onvif(
// host: '192.168.1.102:8000',
host: '192.168.1.103:2020',
username: '',
password: '');
//initiate connection
await onvif.initialize();
//get device info
var deviceInfo = await onvif.deviceManagement.getDeviceInformation();
var profileToken = 'profile_1';
await onvif.ptz.moveLeft(profileToken);

please help to look into this issue next. The onvif server is only for your convenience to tackle the issue which is also applicable with my physical nvt too.

@faithoflifedev
Copy link
Owner

@wmhseir3, you may not actually be using v0.0.13

I was able to replicate a similar error and the relevant part is :
Exception: Error code: {Code: {Value: {$: env:Sender}, Subcode: {Value: {$: ter:InvalidArgVal}, Subcode: {Value: {$: ter:NoProfile}}}}, Reason: {Text: {@xml:lang: en, $: The requested profile token ProfileToken does not exist.}}, Node: {$: http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver}, Role: {$: http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver}, Detail: {Text: {$: can not find this profile}}}

The important part is at the end {Text: {@xml:lang: en, $: The requested profile token ProfileToken does not exist.}} which tells us that your profile token is invalid.

The profile token is case sensitive, I generated this error by changing my correct "Profile_1" token to incorrect "profile_1"

@wmhseir3
Copy link
Author

wmhseir3 commented Nov 6, 2021

hi, your assumption to replicate a similar error may be right in your end but not applicable with the issue in my case.
The profile token is correct as with case sensitive regarded but yield the "Unhandled Exception: Exception: DioError [DioErrorType.other]: HttpException: Invalid response line" issue using 0.0.13.

@faithoflifedev
Copy link
Owner

Hello @wmhseir3 , does v0.0.15 produce the same error? The camera move logic was changed significantly recently.

@wmhseir3
Copy link
Author

wmhseir3 commented Feb 17, 2022 via email

@faithoflifedev
Copy link
Owner

@wmhseir3 , please try out v1.0.2 a number of bugs affecting some devices have been resolved.

@wmhseir3
Copy link
Author

wmhseir3 commented May 14, 2022 via email

@faithoflifedev
Copy link
Owner

@wmhseir3
I've published v1.0.5 which among several other things backs out the dependencies that required overrides.

Let me know if this version solves the issues.

@wmhseir3
Copy link
Author

wmhseir3 commented May 15, 2022 via email

@wmhseir3
Copy link
Author

wmhseir3 commented May 15, 2022 via email

@faithoflifedev
Copy link
Owner

I've added my twitter handle to my GitHub profile, if you would like to PM me - twitter: @faithoflifedev

@faithoflifedev
Copy link
Owner

Hi @wmhseir3 , I've just published v1.0.9 which has been tested against 3 different Onvif devices. A number of errors where found and corrected. If you get a chance, try this new version.

@wmhseir3
Copy link
Author

wmhseir3 commented May 28, 2022 via email

@faithoflifedev
Copy link
Owner

@wmhseir3 , I assume you left out the part of the log that does the authentication to the camera. If this isn't the case, then that's your problem.

If it's the case that authentication did occur properly, then it looks like the camera does not like the Request that the code is generating. The only way I could troubleshoot this is by having access to the same model camera.

@wmhseir3
Copy link
Author

wmhseir3 commented May 30, 2022 via email

@faithoflifedev
Copy link
Owner

@wmhseir3, it looks like twitter has receiving direct messages disabled by default. Sorry about that. I've enabled that now.

When I have some spare time, I'll try out the happytimesoft server as well.

@faithoflifedev
Copy link
Owner

@wmhseir3, v1.1.0 works with the happytimesoft Onvif server

Simulator Screen Shot - iPhone 13 Pro Max - 2022-05-30 at 13 43 31

@wmhseir3
Copy link
Author

wmhseir3 commented Jun 1, 2022 via email

@faithoflifedev
Copy link
Owner

Hello @wmhseir3 , I have some bad news for you. I did extensive testing with easy_onvif and with a node onvif package, and neither package will perform a RelativeMove on a TL-IPC43AN-4 camera. Strangely, AbsoluteMove works fine. The error returned by the camera does not give any useful information towards any further resolution.

Here are the things you can try next:

  • check with the manufacturer to see if there is a firmware upgrade that resolves the issue
  • you could try using the results of a ptz GetStatus to get the cameras current pan/tilt position, then use AboluteMove to simulate a RelativeMove
  • switch to a different model or manufacturer.

@wmhseir3
Copy link
Author

wmhseir3 commented Oct 11, 2022 via email

@wmhseir3
Copy link
Author

wmhseir3 commented Oct 11, 2022 via email

@faithoflifedev
Copy link
Owner

I/flutter (31546): DioError [DioErrorType.response]: Http status error [500]

The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is usually returned by the server when no other error code is suitable.

Essentially the device is not accepting the request. Are you sure you've properly authenticated?

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