Amcrest PTZ functionality
-
- Posts: 6
- Joined: Sun Apr 02, 2017 5:36 pm
Re: Amcrest PTZ functionality
I took this a bit further and verified the base64 encoding of the authentication that is sent to the camera for the Basic Authentication, and that is also correct in the wireshark capture.
What I did find that was odd was the 410 authorization Failure return from the Camera appears to be processing the Authorization as a Digest Authorization rather than a Basic as the return packet from the Camera shows this:
I am by no means an expert on Authorization, but according to the API Documentation this type of response should only be received if a Digest Authentication was attempted.
I guess at this point I am looking to confirm with anyone else who may have been using these scripts with this Camera and is running the same Firmware as I am, or anyone else who is smarter than me that can make sense out of this.
What I did find that was odd was the 410 authorization Failure return from the Camera appears to be processing the Authorization as a Digest Authorization rather than a Basic as the return packet from the Camera shows this:
I am by no means an expert on Authorization, but according to the API Documentation this type of response should only be received if a Digest Authentication was attempted.
I guess at this point I am looking to confirm with anyone else who may have been using these scripts with this Camera and is running the same Firmware as I am, or anyone else who is smarter than me that can make sense out of this.
-
- Posts: 6
- Joined: Sun Apr 02, 2017 5:36 pm
Re: Amcrest PTZ functionality
Well I made a little more progress, and to me it's really looking like an issue in the firmware. I added the specific Digest Authorization Credentials to the script and I am now getting 50% success on the calls, unfortunately that means it' still garbage. This is now what my subroutine looks like:
I also removed the user credentials from the Control Address as I was specifically adding them to the script.
The Camera Moves but doesn't stop. You can see that in the logs here, so actually getting a request in and accepted but not consistantly. Just doesn't make any sense.
Code: Select all
sub Right
{
my $self = shift;
Debug( "Move Right" );
$self->{ua}->credentials("server:port","realm-from-wireshark","username"=>"password");
$self->sendCmd( 'cgi-bin/ptz.cgi?action=start&code=Right&channel=0&arg1=0&arg2=1&arg3=0' );
usleep (500);
$self->sendCmd( 'cgi-bin/ptz.cgi?action=stop&code=Right&channel=0&arg1=0&arg2=1&arg3=0' );
}
The Camera Moves but doesn't stop. You can see that in the logs here, so actually getting a request in and accepted but not consistantly. Just doesn't make any sense.
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
Amcrest has a support forum, and they do respond...
Re: Amcrest PTZ functionality
Same issue with digest auth on an IP2M-841W with R17 firmware. I reverted to previous firmware version of R16 and problem solved. Found prior version via AWS S3 API calls listing their firmware directory. I can post a link if anyone needs it and doesn't know how to list S3.
Re: Amcrest PTZ functionality
Home function confirmed working for IP2M-841 R16 firmware:
(Updated 20170503 - removed extra "&" in command)
Code: Select all
#Move Camera to Home Position
sub presetHome
{
my $self = shift;
# Debug( "Home Preset" );
$self->sendCmd( 'cgi-bin/ptz.cgi?action=start&channel=0&code=PositionABS&arg1=180&arg2=0&arg3=1&arg4=1' );
}
Last edited by VladSI on Wed May 03, 2017 11:56 pm, edited 1 time in total.
Re: Amcrest PTZ functionality
What's with the double & in there ?
Re: Amcrest PTZ functionality
I copy and pasted the cmd line from the preset method which also had that extra "&". It works both ways but code edited regardless.
-
- Posts: 6
- Joined: Sun Apr 02, 2017 5:36 pm
Re: Amcrest PTZ functionality
Can you provide the Link to the Firmware? I know that they are telling me that It is not supported but Support has been less than helpful even specifically telling me that downgrading it not supported, but they are also basically ignoring the issue.
Thanks!
Thanks!
Re: Amcrest PTZ functionality
https://s3.amazonaws.com/amcrest-files/ ... 160909.zipGilley7997 wrote: ↑Fri Jun 23, 2017 6:07 pm Can you provide the Link to the Firmware? I know that they are telling me that It is not supported but Support has been less than helpful even specifically telling me that downgrading it not supported, but they are also basically ignoring the issue.
Thanks!
This is for the IP2M-841. If you are looking for different model, let me know and I'll post the direct link for your camera.
Re: Amcrest PTZ functionality
By the way - looks like R18 is out. Changelog only mentions general bug fixes. Anyone want to be the guinea pig to see if auth was fixed?
-
- Posts: 6
- Joined: Sun Apr 02, 2017 5:36 pm
Re: Amcrest PTZ functionality
Actually I already did. The issue is not resolved.
There is a thread that I was participating in on the Amcrest forums as well.
Here is the link there if anyone else would like to join in.
https://amcrest.com/forum/technical-dis ... 1-s10.html
There is a thread that I was participating in on the Amcrest forums as well.
Here is the link there if anyone else would like to join in.
https://amcrest.com/forum/technical-dis ... 1-s10.html
-
- Posts: 1
- Joined: Tue Sep 26, 2017 1:01 am
Re: Amcrest PTZ functionality
Hi, new to zoneminder.
Using IP2-841, with R16 firmware. Zm v1.30.4
I am trying to use PTZ, I use Fedora, so the control script is in /usr/share/perl5/vendor_perl/Zoneminder/Control.
Got the control added, restarted zm, but when I send a command, I get
Invalid control parameter: Right /usr/share/zoneminder/www/includes/control_functions.php 282
Camera control command FAILED: '500 No Host option provided' for URL /cgi-bin/ptz.cgi?action=stop&code=Right&channel=0&arg1=0&arg2=1&arg3=0 zmcontrol.pl
What is that trying to tell me?
Using IP2-841, with R16 firmware. Zm v1.30.4
I am trying to use PTZ, I use Fedora, so the control script is in /usr/share/perl5/vendor_perl/Zoneminder/Control.
Got the control added, restarted zm, but when I send a command, I get
Invalid control parameter: Right /usr/share/zoneminder/www/includes/control_functions.php 282
Camera control command FAILED: '500 No Host option provided' for URL /cgi-bin/ptz.cgi?action=stop&code=Right&channel=0&arg1=0&arg2=1&arg3=0 zmcontrol.pl
What is that trying to tell me?
Re: Amcrest PTZ functionality
Did you fill out the "Control Address" box in the "Control" configuration panel? The URL is incomplete as it does not have the auth and host. It should look like "user:password@host/cgi-bin/ptx.cgi.....".
-
- Posts: 1
- Joined: Sat Jan 20, 2018 8:28 am
Re: Amcrest PTZ functionality
I just bought an Amcrest camera and was excited to use this control script. I was disappointed that it didn't work and read just the first page of this thread to find someone else had the same issue but I didn't read the 2nd page where they figured out the digest authentication being the issue. So I spent a few hours figuring out the cause of the 401 error (I should have read the 2nd page) and rewriting the script to handle this method of authentication. This is working for this firmware: 2.420.AC00.18.R, Build Date: 2017-05-21 I want to do a little cleanup of code and will post the script here.
Re: Amcrest PTZ functionality
Would you be willing to share your script?
I am intersted in making the control work for my Amcrest cameras.
I am intersted in making the control work for my Amcrest cameras.