Controlling D-Link DCS-5020L in ZoneMinder 1.28.1

Forum for questions and support relating to the 1.28.x releases only.
Locked
root
Posts: 2
Joined: Sat Jun 27, 2015 4:53 pm

Controlling D-Link DCS-5020L in ZoneMinder 1.28.1

Post by root »

Hi

I have successfully installed ZoneMinder 1.28.1 on Centos 6 and used the following guide to add D-Link DCS-5020L as a monitor:
http://www.zoneminder.com/wiki/index.ph ... _DCS-5020L

The capturing works great, but I cannot control it with the instructions and script in the guide.

The monitor page displays the following message when trying to control the camera:

Code: Select all

Control response was status = undefined
message = /usr/bin/zmcontrol.pl --panstep=16 --command=moveRelRight --id=1=>
The log displays:

Code: Select all

2015-06-29 07:29:01.888938	web_php	15795	ERR	/usr/bin/zmcontrol.pl --panstep=18 --command=moveRelRight --id=1=>	/usr/share/zoneminder/www/includes/functions.php	2330
2015-06-29 07:29:01.837110	zmcontrol	17718	FAT	Can't connect: No such file or directory	zmcontrol.pl	
2015-06-29 07:28:51.836060	zmcontrol	17723	INF	Control server 1/ starting at 15/06/29 09:28:51	zmcontrol.pl	
2015-06-29 07:28:51.768100	zmcontrol	17718	INF	Starting control server 1/	zmcontrol.pl	
Have anyone managed to control their D-Link DCS-5020L with ZoneMinder 1.28.1?

It looks like the control script is written for version 1.25. Could that explain why it does not work?
http://www.zoneminder.com/wiki/index.ph ... rol_Script

Any advice and suggestions will be greatly appreciated.

-Michael
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Controlling D-Link DCS-5020L in ZoneMinder 1.28.1

Post by knight-of-ni »

The unfortunate side effect of posting instructions in the Wiki is that they are not maintained.
So you are correct in the conclusion that a ptz control script written for zoneminder 1.25 will not work in zoneminder 1.28.1.

The way to find what is wrong with the script is to call the script from the commad line:

Code: Select all

perl /path/to/ptz/control/script.pl
A working script should return immediately w/o any output. The script you have will likely produce errors. The output will tell you where the errors are. You can use the control scripts that are already part of zoneminder as examples to figure out how to fix your script:
https://github.com/ZoneMinder/ZoneMinde ... er/Control

Off the top of my head, you will need to add the following to your script:

Code: Select all

use ZoneMinder::Logger qw(:all);
You may also have to modify how the script gets the value for ZM_VERSION. See the existing scripts for more details.

Once you get the script working, please generate a pull request on github to add the script into the source. Once that happens, you won't have to maintain the script anymore. We will do that.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
root
Posts: 2
Joined: Sat Jun 27, 2015 4:53 pm

Re: Controlling D-Link DCS-5020L in ZoneMinder 1.28.1

Post by root »

Thank you very much for the information. I`ll look into it :)

-Michael
ajsgray2
Posts: 3
Joined: Mon Jul 20, 2015 2:40 pm

Re: Controlling D-Link DCS-5020L in ZoneMinder 1.28.1

Post by ajsgray2 »

SOLUTION.

Thank you for your guidance. The DCS5020L Control Script at http://www.zoneminder.com/wiki/index.ph ... rol_Script has a BAREWORD error at approximately line 82. I determined this using the following command:

sudo perl -c \usr\share\perl5\ZoneMinder\Control\[filename]

A partial of the error line is as follows:

"ZoneMinder Control Agent"/.ZM_Version

Using another script, this was changed to the following:

"ZoneMinder Control Agent/¨.ZoneMinder::Base::ZM_Vesion);

This produced another bareword error that was corrected by eliminating (at approximately line 28.)

use strict;

This is not the best solution, but I was unable to close the barewood.

If you know PERL and have a more refined, correct manner of eliminating the barewood error, I would appreciate you providing it.

Is it possible for me to update http://www.zoneminder.com/wiki/index.ph ... rol_Script so that future users will not experience this same problem?

Thanks.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Controlling D-Link DCS-5020L in ZoneMinder 1.28.1

Post by knight-of-ni »

Absolutely.
Anyone can edit the Wiki. Please help to keep it up to date.

The best thing to do moving forward is to generate a pull request on github to get it added to the source.
Just like this one:
https://github.com/ZoneMinder/ZoneMinder/pull/570

You've got to add, not only the script, but the necessary bits of sql to get it into the database.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Controlling D-Link DCS-5020L in ZoneMinder 1.28.1

Post by knight-of-ni »

The control scripts live here:
https://github.com/ZoneMinder/ZoneMinde ... er/Control

Here is how we are handling the ZM_VERSION change from a bareword:
https://github.com/ZoneMinder/ZoneMinde ... 3d66d6ab37

which is what you did so we are good with that.

You should not remove use strict. That won't fix the problem, it just makes Perl stop complaining about barewords. What was the other bareword error?

UPDATE: remove this line if you have not already:

Code: Select all

our $VERSION = $ZoneMinder::Base::VERSION;
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Locked