Closed alabamatoy closed 3 years ago
I think what is happening here is that we are hitting ptz.cgi but not giving it a command. So it is returning bad request. We should probably be hitting a different url, or giving some command that effectively does nothing but gives us a successful result. Otherwise I'd be ok with removing this line entirely.
How about we send the command ?action=getCurrentProtocolCaps
I agree, but I understood that means changing the call which is setting the realm, and I was afraid to tinker with that. There are some ptz.cgi status calls which could be used and the returned content ignored as you suggest.
In current version, this change works:
Following line is line #78
changed above line to following my $res = $self->{ua}->get($$self{base_url}.'cgi-bin/magicBox.cgi?action=getDeviceType');
May want to change line 124 to give an accurate error message, since its no longer using cgi-bin/ptz.cgi
Latest (1.34.25) still has the old "cgi-bin/ptz.cgi" call that results in the errors..
Merged it in 1.34.26
Describe Your Environment
If the issue concerns a camera
Describe the bug Logs are filled with following"
2021-01-11 08:25:15 | zmcontrol_20 | | 29978 | ERR | Failed to get http://{login}:{password}@10.1.1.158/cgi-bin/ptz.cgi 400 Bad Request | zmcontrol.pl
To Reproduce Steps to reproduce the behavior: View the monitor live.
Expected behavior No errors.
Debug Logs
I changed the following in Amcrest_HTTP.PM 124 #Changed following line to get rid of the constant barrage of errors 125 #Error("Failed to get $$self{base_url}cgi-bin/ptz.cgi ".$res->status_line()); 126 Info("Failed to get $$self{base_url}cgi-bin/ptz.cgi ".$res->status_line()." -- ignoring and continuing...");
No more errors, everything still works.