Having problem with HikVision.pm

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
tafollaj
Posts: 13
Joined: Mon Aug 27, 2018 5:13 am

Having problem with HikVision.pm

Post by tafollaj »

I am having trouble getting the Hikvision controls working and I was getting an command = undefined error. I ran perl HikVision.pm and got the following:

/usr/share/perl5/ZoneMinder/Control$ perl HikVision.pm
WARNING: ZoneMinder configuration file found but is not readable. Check file permissions on /etc/zm/zm.conf
WARNING: ZoneMinder configuration file found but is not readable. Check file permissions on /etc/zm/conf.d/zmcustom.conf
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in pattern match (m//) at /usr/share/perl5/ZoneMinder/Config.pm line 93.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_HOST"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Config.pm line 102.
Use of uninitialized value $ZoneMinder::Config::Config{"ZM_DB_NAME"} in concatenation (.) or string at /usr/share/perl5/ZoneMinder/Config.pm line 117.
DBI connect('database=;host=','',...) failed: Access denied for user 'pollosanto'@'localhost' (using password: NO) at /usr/share/perl5/ZoneMinder/Config.pm line 117.
Can't connect to db at /usr/share/perl5/ZoneMinder/Config.pm line 166.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 166.
Compilation failed in require at /usr/share/perl5/ZoneMinder/Logger.pm line 90.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Logger.pm line 90.
Compilation failed in require at HikVision.pm line 46.
BEGIN failed--compilation aborted at HikVision.pm line 46.


Does anyone know what the problem is here? Thanks.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Having problem with HikVision.pm

Post by rockedge »

check to make sure the permissions on /etc/zm/zm.conf are correct and match the Apache user !!
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Having problem with HikVision.pm

Post by knight-of-ni »

tafollaj wrote: Tue Mar 26, 2019 8:55 pm DBI connect('database=;host=','',...) failed: Access denied for user 'pollosanto'@'localhost' (using password: NO) at /usr/share/perl5/ZoneMinder/Config.pm line 117.
You can't call the zoneminder scripts or binaries from the command line as a normal user. They will only run as the root user or the web account user.
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/
tafollaj
Posts: 13
Joined: Mon Aug 27, 2018 5:13 am

Re: Having problem with HikVision.pm

Post by tafollaj »

Thank you, I forgot to sudo. Regarding the problem I am having, this is the error I get when I try to use the controls. Am I missing a component in my install?


2019-03-27 14:21:45 zmcontrol 2301 FAT Can't load ZoneMinder::Control::Can't locate ZoneMinder/Control/.pm in @INC (you may need to install the ZoneMinder::Control:: module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl/5.26/Module/Load.pm line 77.Can't locate ZoneMinder/Control/ in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl/5.26/Module/Load.pm line 77.
tafollaj
Posts: 13
Joined: Mon Aug 27, 2018 5:13 am

Re: Having problem with HikVision.pm

Post by tafollaj »

Ok, got it working! The protocol wasn't set in the control definition for HikVision. Thanks for the help, much appreciated!
kobold81
Posts: 16
Joined: Fri Jan 11, 2019 4:42 pm

Re: Having problem with HikVision.pm

Post by kobold81 »

what is the protocol please and where do I have to enter this?
JasonBorn
Posts: 37
Joined: Fri Jan 08, 2021 5:31 pm

Re: Having problem with HikVision.pm

Post by JasonBorn »

kobold81 wrote: Thu Oct 31, 2019 11:26 pm what is the protocol please and where do I have to enter this?
Have you solved this problem? I'm at the moment on the same problem.
kobold81
Posts: 16
Joined: Fri Jan 11, 2019 4:42 pm

Re: Having problem with HikVision.pm

Post by kobold81 »

sorry, was absent for some time.

I got it to work. in the "Control" tab, I used the name the hikvision camera gave me under the system tab of the camera as the "control device" and I selected "Hikvision" from "Control Type" and checked "Controllable" ." Control Address" ist username:password@ip address, e.g. gordon:password@192.168.1.12
Post Reply