Amcrest PTZ functionality
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
All of this discussion of the type of authentication is interesting, but I am inclined to think its a Zoneminder version or operating system issue, not an issue with the Amcrest cameras themselves....despite the evidence to the contrary. Why would all this work so nicely on mine and fail on others? I have a brand new Amcrest POE PTZ camera that I added to my setup just a few weeks ago, and it works fine with my original script.
I dont object to someone finding flaws in my ugly, probably-poorly designed script. But I am fearful that people are chasing the wrong root cause of the problem because it works fine on my setup, and has been for months. Is there a flaw in this thinking?
I dont object to someone finding flaws in my ugly, probably-poorly designed script. But I am fearful that people are chasing the wrong root cause of the problem because it works fine on my setup, and has been for months. Is there a flaw in this thinking?
Re: Amcrest PTZ functionality
Which model of camera and which firmware version are you running?
This is what I have:
Software Version2.520.AC00.18.R, Build Date: 2017-06-29
WEB Version3.2.1.453504
ONVIF Version2.42 (V2.2.2.428697)
On the version of software stated above the CGI PTZ API reports 401 Unauthorized to all HTTP Basic authentication requests.
Based on my reading of the Amcrest support forum they removed support for HTTP Basic and require HTTP Digest authentication in their recent firmware.
This is what I have:
Software Version2.520.AC00.18.R, Build Date: 2017-06-29
WEB Version3.2.1.453504
ONVIF Version2.42 (V2.2.2.428697)
On the version of software stated above the CGI PTZ API reports 401 Unauthorized to all HTTP Basic authentication requests.
Based on my reading of the Amcrest support forum they removed support for HTTP Basic and require HTTP Digest authentication in their recent firmware.
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
Isnt this controlled by CURL? Is not CURL what the script is using to commo with the camera?
I cannot tell you the details of the camera unless there is some way to get that remotely - I am about 120 miles from my cameras!
I cannot tell you the details of the camera unless there is some way to get that remotely - I am about 120 miles from my cameras!
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
Cross-posting, another user seems to have figured out a fix: viewtopic.php?f=36&t=27093#p105188
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
This code apparently never made it into the repo. My new 1.32.3 install has no amcrest control scripts. Oh well, I know yall got a lot going on.
Re: Amcrest PTZ functionality
Cross posting from viewtopic.php?f=36&t=27093&p=112998#p112998:
Thanks to everyone who's been working on this so far. I've been able to get this working with 1.32.3 + the latest firmware on my IP2M-841. However, it appears that Zoneminder 1.32.3's frontend is not sending the right query parameters when making PTZ requests. For example, it posts to /zm/index.php with paramaters such as:
Changing those requests to send "moveUp" (which matches the method name in Amcrest_HTTP.pm) fixes the problem.
I also tried adjusting the perl module to use "Up", but that failed because the PHP backend doesn't like "Up" as a control parameter (see https://github.com/ZoneMinder/zoneminde ... ns.php#L11)
Thanks to everyone who's been working on this so far. I've been able to get this working with 1.32.3 + the latest firmware on my IP2M-841. However, it appears that Zoneminder 1.32.3's frontend is not sending the right query parameters when making PTZ requests. For example, it posts to /zm/index.php with paramaters such as:
Which results in errors like "Invalid control parameter: Up" and "Can't access Up member of object of class ZoneMinder::Control::Amcrest_HTTP".view=request
request=control
id=6
control=Up
yge=32
Changing those requests to send "moveUp" (which matches the method name in Amcrest_HTTP.pm) fixes the problem.
I also tried adjusting the perl module to use "Up", but that failed because the PHP backend doesn't like "Up" as a control parameter (see https://github.com/ZoneMinder/zoneminde ... ns.php#L11)
Re: Amcrest PTZ functionality
You need to check Can Move Continuous.
Re: Amcrest PTZ functionality
Just picked up an Amcrest IP3M-941 and am seeing the same "Invalid control parameter: Up" and "Can't access Up member of object of class ZoneMinder::Control::Amcrest_HTTP" errors. Punching the URLs from the amcrest781.pm/Amcrest_HTTP.pm files with my camera's IP makes the camera move correctly, so it definitely seems like it should work. I have tried checking "Can Move Continuous," but I get a "No printMsg method defined for protocol ZoneMinder::Control" error instead. Not sure if anybody is using this specific Amcrest camera with ZM PTZ control yet, but would definitely appreciate any thoughts. Seemed like the right place to post this, but definitely let me know if I'm wrong there.
I have made sure that my serial number is in the Device Control section and all credentials and ip addresses are correct.
Camera firmware version is latest: V2.620.00AC00.3.R
Thanks in advance!!
I have made sure that my serial number is in the Device Control section and all credentials and ip addresses are correct.
Camera firmware version is latest: V2.620.00AC00.3.R
Thanks in advance!!
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
What version of ZM?
Re: Amcrest PTZ functionality
ZM v1.32.3 (manually pulled Amcrest_HTTP.pm from github)
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
I have been unable to get this new Amcrest script to work with my 1.32.3, but I am getting a different error than you. I think Im going to upgrade to 1.34.1 and see how it works. My understanding is that 1.32.3 to 1.34.X is a pretty seamless upgrade....but I haven't done it yet.
Re: Amcrest PTZ functionality
Testing ZM v1.34.0 now... Unfortunately I am now getting:
Tried a few different variations of the control address (i.e. with and w/o "http://" and ":80"). Haven't tried much else yet...
Again, copying the URL directly from the ZM log and entering into web browser causes camera to move, so I'm still pretty puzzled.
Code: Select all
Camera control command FAILED: '401 Unauthorized' for URL user:pass@host/cgi-bin/ptz.cgi?action=stop&code=Right&channel=0&arg1=0&arg2=1&arg3=0
Again, copying the URL directly from the ZM log and entering into web browser causes camera to move, so I'm still pretty puzzled.
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
I believe the control address is supposed to be "login:password@ip_address:port" and the control device is supposed to be the serial number of the camera.
Re: Amcrest PTZ functionality
Yup, I've tried just about every possible combination with these details entered and not.alabamatoy wrote: ↑Sun Jan 26, 2020 7:34 pm I believe the control address is supposed to be "login:password@ip_address:port" and the control device is supposed to be the serial number of the camera.
Adding the port to the URL has not made a difference fore me, and results in the exact same 401 error (this is as I would expect it to behave, as http implies port 80 - unless you are using a custom port on your camera).
And it actually looks like having the serial number in the Device Control section does not make a difference either (same 401 error, not quite what I was expecting).
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: Amcrest PTZ functionality
I upgraded to 1.34.1 and using the new "Amcrest HTTP API" control I am getting the same error as you. I have no means of testing directly with a browser pointed at the camera.NoNaym wrote: ↑Sun Jan 26, 2020 7:01 pm Testing ZM v1.34.0 now... Unfortunately I am now getting:
Code: Select all
Camera control command FAILED: '401 Unauthorized' for URL user:pass@host/cgi-bin/ptz.cgi?action=stop&code=Right&channel=0&arg1=0&arg2=1&arg3=0
This discussion should probably be moved to the 1.34 forum.