Anyone tried zoneminder for camera control

Mar 27, 2024 Last reply: 2 years ago 11 Replies

From time to time it'd be nice to have a remote control camera connected to my Pi. Most likely use would be watching for unwelcome critters in the garage or garden.



Knowing absolutely nothing I downloaded zoneminder. It looks like a much more complex system than I need, but it's available. At this stage I'd just like to find out if it runs on a Pi4 running up-to-date 64 bit RasPiOS. It's installed but the man page is little help and running zmu reports a permissions error.



Any tips or links would be much appreciated.



Thanks for reading,



bob prohaska



Runs fine on a RPi4

You don't run it manually, it start (should) automagically at boot time, go to

formatting link

There you can set up cameras etc. etc. etc.

HTH

Avpx

It helps enormously, now I know which way is up 8-)

Still, there seem to be problems:

If I try to visit http://localhost/zm/index.phpI get a 404.

If I try to run the daemon manually I see:

bob@raspberrypi:~ $ sudo zmc -d localhost

03/27/24 13:43:48.107397 zmc_dlocalhost[400666].ERR-zm_db.cpp/55 [Can't connect to server: Access denied for user 'zmuser'@'localhost']

03/27/24 13:43:48.107614 zmc_dlocalhost[400666].FAT-zm_config.cpp/67 [Can't connect to db. Can't continue.]

Zoneminder was set up using sudo apt install zoneminder, no manual configuration.

The errors above make it look like maybe some sort of install script needs to run for setting permissions. Sudo zmu reports the same permissions error as zmc.

I did check that sudo more /etc/zm/zm.conf displays a reasonable looking file.

Any further hints appreciated!

Thanks for writing!

bob prohaska

Bob,

Have you read

formatting link
?
formatting link

formatting link

There is a lot of good stuff there - though some is a bit arcane :-)

Regards

Avpx

That's new to me. I tried using sudo chgrp -c www-data /etc/zm/zm.conf but still see bob@raspberrypi:~ $ sudo zmu

03/28/24 10:31:33.373918 undef[406950].ERR-zm_db.cpp/55 [Can't connect to server: Access denied for user 'zmuser'@'localhost'] 03/28/24 10:31:33.374161 undef[406950].FAT-zm_config.cpp/67 [Can't connect to db. Can't continue.] At least the config file is now readable.

Indeed, I'll have study it a while. I wish there had been a hint in the man page to the links you supplied.

Thank you very much!

bob prohaska

I see

Bob,

Don't run zmu from the command line it's not how it works :-)

Zoneminder is a service that runs all the time in the background doing its stuff, there is a mysql database at the heart of this system with .php web pages.

ps aux |grep zm provides

<code>

nick@zoneminder:~ $ ps aux |grep zm www-data 722 0.0 0.1 27676 1348 ? S Mar22 1:39 /usr/ bin/perl -wT /usr/bin/zmdc.pl startup www-data 878 29.2 10.4 605636 97340 ? SLl Mar22 2798:31 /usr/ bin/zmc -m 6 www-data 965 24.8 10.2 605480 95752 ? SLl Mar22 2385:40 /usr/ bin/zmc -m 8 www-data 1051 0.0 0.3 26964 3296 ? S Mar22 4:10 /usr/ bin/perl -wT /usr/bin/zmwatch.pl www-data 1058 0.0 0.2 26672 2052 ? S Mar22 0:11 /usr/ bin/perl -wT /usr/bin/zmstats.pl www-data 1253 26.3 9.7 610832 90368 ? SLl Mar22 2524:17 /usr/ bin/zmc -m 10 www-data 211830 0.0 0.5 42048 4956 ? S 00:00 0:05 /usr/ bin/perl -wT /usr/bin/zmfilter.pl --filter_id=1 --daemon www-data 211833 25.3 13.0 603980 121568 ? SLl 00:00 142:41 /usr/ bin/zmc -m 7 www-data 211834 0.0 0.5 42184 5036 ? S 00:00 0:02 /usr/ bin/perl -wT /usr/bin/zmfilter.pl --filter_id=2 --daemon </code>

localhost/zm (or ip.of.your.RPi/zm) should give you a web page with a top bar with 'useful stuff' in it e.g.

<https:/
formatting link

Here 'add' allows new cameras to be added etc.

As I say zm should be started on boot - but it might depend on how you've installed it - it was a long time ago now & I can't remember I just update it when I think about it - this thread has just prompted my to do an apt update, upgrade.

Regards

Avpx

That was what had me stumped, I expected it could be stopped and started manually or in the startup scripts. My bad....

That command offered proof that zoneminder's not running.

I'll try rebooting at some point to see if that makes any difference. I'm not likely to want it running all the time, can it be stopped and started _without_ rebooting?

Thanks for all your help!

bob prohaska

Oh :-(

I've not actually tried it as I run mine 24/7/52 but ...

sudo systemctl start|stop zoneminder.service may/should/might work

or

sudo service zoneminder stop|start (I think all RPis system use systemd these days so systemctl is more likely)

HTH

No problems - I remember struggling at first, but as I say I can't remember what I did to solve it. A clean install via apt-get I think ... then it all just worked (c).

Avpx

I've not used zoneminder, but have used 'motion' for watching wildlife

formatting link
which works fine on an RPi (both with USB cameras and the RPi camera).

How does one guesstimate which cameras will work? Zonemaster has a list, but I didn't see one for motion. It looks like the better-performing cameras start in the mid-hundreds of dollars so a correct choice matters.

Thanks for writing!

bob prohaska

I'm not aware of a list of tested cameras, though a quick glance at the documentation suggests that one which supports Video4Linux2 should work.

But I wasn't trying to persuade you to switch away from zoneminder, just suggesting something else you might try if zoneminder doesn't work out.

I'll admit that zoneminder appears to be a fairly ambitious project.... was hoping motion might be closer to cheap plug-and-pray setup.

The initial mystery (figuring out what's chewing up a lemon tree) has been resolved the old fashioned way. Still, knowing what's possible and affordable will be useful the next time something like this comes up.

Thanks to everybody who responded, I'm slightly less ignorant now!

bob prohaska

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required