DLink PTZ cam not recognizing PTZ clicks

Forum for questions and support relating to the 1.25.x releases only.
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

I'm fairly certain that I do not have something set up exactly right.

I bought a DLink DCS-5020L to start my ZM setup with. I'm using the setup instructions using the DCS-5010L settings (copied into its own section for the 5020L) but PTZ doesn't appear to work for the 5020L.

Below are my settings for the monitor and PTZ settings:
Image
Image
Image

Here is my directory listing showing the perl module:

Code: Select all

art@tv:/usr/share/perl5/ZoneMinder/Control$ ls -l
total 92
-rw-r--r-- 1 root root 10990 Jun 21  2011 AxisV2.pm
-rw-r--r-- 1 root root  7095 Sep 17 20:06 DLink-DCS5020L.pm
-rw-r--r-- 1 root root  5261 Aug 26  2011 mjpgStreamer.pm
-rw-r--r-- 1 root root  5274 Jun 21  2011 Ncs370.pm
-rw-r--r-- 1 root root  7382 Jun 21  2011 PanasonicIP.pm
-rw-r--r-- 1 root root 18941 Jun 21  2011 PelcoD.pm
-rw-r--r-- 1 root root  7597 Sep 17 16:17 TVIP400.pm
-rw-r--r-- 1 root root 20103 Jun 21  2011 Visca.pm
Below is the error I get about 30 seconds after I click one of the PTZ controls:

Code: Select all

Control response was status = undefined
message = /usr/bin/zmcontrol.pl --panstep=16 --command=moveRelUpRight --id=1=>
Any ideas?
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

Found this in /var/log/apache2/error.log

Looks like it's forming up the shell command wrong.

[Thu Sep 19 13:08:07 2013] [error] [client ip_addr] ERR [/usr/bin/zmcontrol.pl --panstep=13 --command=moveRelUpRight --id=1=>], referer: http://ip_addr/zm/?view=watch&mid=1

Is that right?
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

Found this in my syslog, now just need to find out why I'm getting Permissions errors.

Code: Select all

443 Sep 19 19:32:36 tv zmcontrol[27568]: INF [Starting control server 1/DLink-DCS5020L]
444 Sep 19 19:32:36 tv zmcontrol[27570]: INF [Control server 1/DLink-DCS5020L starting at 13/09/19 19:32:36]
445 Sep 19 19:32:46 tv zmcontrol[27568]: FAT [Can't connect: Permission denied]
Last edited by UtahJarhead on Fri Sep 20, 2013 1:39 am, edited 1 time in total.
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

I definitely feel stupid. Bad password on the Control tab of the monitor. I figured it used the same path as the Monitor's main tab. I was wrong.

Code: Select all

Sep 19 19:37:59 tv zmcontrol[29786]: INF [Starting control server 1/DLink-DCS5020L]
Sep 19 19:37:59 tv zmcontrol[29788]: INF [Control server 1/DLink-DCS5020L starting at 13/09/19 19:37:59]
Sep 19 19:38:09 tv zmcontrol[29786]: FAT [Can't connect: No such file or directory]
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

I've determined through perl debugging that the error is coming from line 139 in zmcontrol.pl. If I look at the contents of $saddr, I get '#002'. I don't really know what I'm doing in perl, so that's where I'm at. ideas?

Code: Select all

137         socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or die( "Can't open socket: $!" );
138         my $attempts = 0;
139         while (!connect( CLIENT, $saddr ))
140         {
141             $attempts++;
142             Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY);
143             sleep(1);
144         }
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by TheKorn »

As the guy that added the 5010L, I was kind of wondering why you copied only half of it for the 5020L! :D

In the TVIP400 file, did you remember to change the line

Code: Select all

use ZoneMinder::Debug qw(:all);
to

Code: Select all

use ZoneMinder::Logger qw(:all);
? If you don't, then you'll get almost exactly the symptoms you describe.

(I'm happy someone found what I added useful!)
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by TheKorn »

I may have found your problem!

When you're in the control capabilities section, the "protocol" must match the package name (not the filename)! So unless you edited the file, "TVIP400" must be the protocol name!

Here is my definition for the 5010-L, for example.

HTH!
Attachments
zoneminder.png
zoneminder.png (84.27 KiB) Viewed 7181 times
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

TheKorn wrote:As the guy that added the 5010L, I was kind of wondering why you copied only half of it for the 5020L! :D
I didn't want to add data that I wasn't sure was yet useful and accurate since I hadn't verified that it would work with the 5020L. Once it was working, I'd planned on going back and fixing it. The work you've done with the 5010L is fantastic, however. :)
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

I found my issue. While your advice was correct based off of the information you know, it wasn't my issue.

I'd taken the TVIP400 file and copied to another file and I modified the module name internally, so in my settings it WAS correct. They key to figuring out *MY* error was when I took your file and threw it back into place and got it working. Well what did I do to screw it up?

https://gist.github.com/6656345

See the /PANTILTCONTROL.CGI ? Well, me cleaning things up changed it to /pantiltcontrol.cgi.... Stupid stupid me. I changed it to lower case because when I visit the lower case URL in the browser, it appears to work. Dummy me.
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

I've corrected the Wiki article to include an accurate script (which you may wish to copy to your 5010L description)

http://www.zoneminder.com/wiki/index.ph ... #DCS-5020L
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by TheKorn »

Ha! Gave yourself a landmine to find, I hate it when I do that!

Since the 5010 and 5020 are really just the same camera with different paint jobs, I took a crack at combining their wiki entries together. Looks OK, could be better, but good enough for now.

One thing... do(es) your 5020L(s) every once in a while send corrupt frames? Both of my 5010L's will occasionally send a corrupt frame or two. Obviously this then triggers motion detection for a false event. Was wondering if it happens to anyone else.
Attachments
Doing fine...
Doing fine...
025-capture.jpg (19.79 KiB) Viewed 7166 times
....whoa!
....whoa!
026-capture.jpg (26.37 KiB) Viewed 7166 times
Earthquake!!
Earthquake!!
027-capture.jpg (29.29 KiB) Viewed 7166 times
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by TheKorn »

And then just as quickly as it starts sending corrupt frames, it quits!
Attachments
Gonna hurl!
Gonna hurl!
028-capture.jpg (49.68 KiB) Viewed 7166 times
...back to normal in five frames or less!
...back to normal in five frames or less!
029-capture.jpg (19.85 KiB) Viewed 7166 times
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

I haven't seen any corrupt packets, but I haven't been paying a ton of attention to it and I haven't had it for very long, either.
UtahJarhead
Posts: 20
Joined: Tue Aug 14, 2012 8:30 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by UtahJarhead »

I never looked at the difference between the 5010L and the 5020L. Looks like the only difference is the 5020L has the wifi repeater. Nice.
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: DLink PTZ cam not recognizing PTZ clicks

Post by TheKorn »

For me, the difference was "the 5010L is on SALE!" :mrgreen:
Locked