Installing Zoneminder to use with OpenHAB

Please forgive me for posting this here. I hate creating accounts in different forums just to ask for help
I have openhab installed and somewhat setup. (tring to use Zoneminer to use for recording cameras)
FYI: they are on the same server, and both where installed using sudo and apt

I have no idea how to use sql. I only follow tultorials that I found searching when I ran into trouble

I am running Ubuntu server 19.04
I followed the directions here
https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#easy-way-ubuntu-18-04-bionic

found out the ppa doesn’t work with my version but there was zoneminer1.32.3 package with apt

installed and setup the sql user and the pass (changed the default and went through ZM
config files and changed there too)

but when I run the codes given on the page this happens

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql Enter password: ERROR 1064 (42000) at line 741: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','Edit','','')' at line 1

mysql -uroot -p -e "grant lock tables,alter,drop,select,insert,update,delete,create,index,alter routine,create routine, trigger,execute on zm.* to 'zmuser'@localhost identified by 'Zmpass!1';" mysql -uroot -p -e "grant lock tables,alter,drop,select,insert,update,delete,create,index,alter routine,create routine, trigger,execute on zm.* to 'zmuser'@localhost identified by 'Zmpasssudo apt update';" Enter password: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Zmpasssudo apt update'' at line 1

so I logged into sql and ran this

mysql> grant lock tables,alter,drop,select,insert,update,delete,create,index,alter routine,create routine, trigger,execute on zm.* to 'zmuser'@localhost identified by 'Zmpass!1'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Zmpass!1'' at line 1

still didnt work, but I continued on
when i tried starting the service this happens

[code]zoneminder.service - ZoneMinder CCTV recording and surveillance system
Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-02-28 11:25:10 EST; 10s ago
Docs: http://zoneminder.readthedocs.org/en/latest/
Process: 2124 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=255/EXCEPTION)

Feb 28 11:25:10 SpaceScene zmpkg.pl[2124]: DBI connect(‘database=zm;host=localhost’,‘zmuser’,…) failed: Access denied for user ‘zmuser’@‘localhost’ to database ‘zm’ at /usr/share/perl5/ZoneMinder/Config.pm lin
Feb 28 11:25:10 SpaceScene zmpkg.pl[2124]: Can’t connect to db at /usr/share/perl5/ZoneMinder/Config.pm line 166.
Feb 28 11:25:10 SpaceScene zmpkg.pl[2124]: BEGIN failed–compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 166.
Feb 28 11:25:10 SpaceScene zmpkg.pl[2124]: Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
Feb 28 11:25:10 SpaceScene zmpkg.pl[2124]: BEGIN failed–compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Feb 28 11:25:10 SpaceScene zmpkg.pl[2124]: Compilation failed in require at /usr/bin/zmpkg.pl line 34.
Feb 28 11:25:10 SpaceScene zmpkg.pl[2124]: BEGIN failed–compilation aborted at /usr/bin/zmpkg.pl line 34.
Feb 28 11:25:10 SpaceScene systemd[1]: zoneminder.service: Control process exited, code=exited, status=255/EXCEPTION
Feb 28 11:25:10 SpaceScene systemd[1]: zoneminder.service: Failed with result ‘exit-code’.
Feb 28 11:25:10 SpaceScene systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.[/code]

This is what those files say at the lines quoted
/usr/share/perl5/ZoneMinder/Config.pm line 166. } # end BEGIN

/usr/share/perl5/ZoneMinder.pm line 33. use ZoneMinder::Config qw(:all);

/usr/bin/zmpkg.pl line 34. use ZoneMinder;

I am at a loss as to what to do next. Can someone please help?

Bad idea.

I’m no Zoneminder expert by any stretch of the imagination. But it looks to me like it was trying to create the default Zoneminder user. When that failed, there’s now no way for the app to log into the database.

Is there a specific reason you chose 1.32.x? I’d suggest you go back to the beginning, perhaps starting with the most current Zoneminder version, which is 1.34.4. (That’s the version I’m running, BTW).

I just used sudo apt install Zoneminer and that was what the output said was installing.
As far as I can tell the current version for Zoneminer is not out for Ubuntu 19.04 and I’d rather not try compiling code.

but even following this https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#harder-way-build-package-from-source
the next step is still where it fails. (haven’t tried it from source yet)

Seems to me that the first code failed when the DB that ZM made had syntax errors.

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql 
Enter password: 
ERROR 1064 (42000) at line 741: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','Edit','','')' at line 1

So should I just delete that line, edit it or something else?

It looks like there’s a ppa for 19.04 (disco). (2nd line from the bottom).

https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-1.34

I apologize. My fault. it’s version 19.10
I added the ppa and this happens

E: The repository 'http://ppa.launchpad.net/iconnor/zoneminder-1.32/ubuntu eoan Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

But going through the links I found the deb file and will try to download and install from that

And yet, failing to ask the question on a forum with people who can actually answer the question is:

  • unlikely to result in getting the help you need
  • somewhat rude to the forum you posted the request to since we have to spend our time and resources either trying to help support a product we don’t own, are not experts in.

It is always best to ask for support on the forums of the product you need the support for. If you have a problem integrating Zoneminder with OH we will be more than able and willing to help. But installing Zoneminder itself is very much outside the scope of the openHAB forum.

this is true and I apologize.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.