Raspbian Zoneminder 1.29 API zmNinja Instructions

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
maco1717
Posts: 7
Joined: Tue Sep 09, 2014 10:02 pm

Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by maco1717 »

Hi,

Let me share my experience getting Zoneminder 1.29 to work on Raspberry Pi 2 Debian 8 (Jessy) API enable to work with zmNinja.

follow this wiki.

It will ask you to setup time zone, do the following:

Add timezone to php

Code: Select all

sudo nano /etc/php5/apache2/php.ini
Search for [Date]

Code: Select all

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/London
You might need to restart apache

Code: Select all

sudo service apache2 restart
At this stage Zoneminder should work but when testing the API it will return an error saying something like
URL rewriting is not properly configured on your server...
from*

edit apache zoneminder.conf

Code: Select all

sudo nano etc/apache2/conf-enabled/zoneminder.conf
and add the bellow code to the end of the file

Code: Select all

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
Enable rewrite configuration in Apache.

Code: Select all

a2enmod rewrite
At this stage if you restart apache service API should show green

Code: Select all

sudo service apache2 restart
Adding the following steps to get video footage to show on the device
Install php5-gd

Code: Select all

sudo apt-get install php5-gd
Change permission off API

Code: Select all

sudo chown -R www-data:www-data /usr/share/zoneminder/www/api
Restart apache service and zoneminder

Code: Select all

sudo service apache2 restart
sudo service zoneminder restart
Last edited by maco1717 on Mon Jun 12, 2017 10:51 pm, edited 1 time in total.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by asker »

Thanks for posting!
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
trekimann
Posts: 15
Joined: Thu Sep 08, 2016 2:23 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by trekimann »

I know this is an old thread but I just had this problem. Followed the instructions but I get
Warning: mkdir(): Permission denied in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/FileEngine.php on line 379

Warning: _cake_core_ cache was unable to write 'cake_dev_en' to File cache in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 323

Warning: /usr/share/zoneminder/www/api/app/tmp/cache/persistent/ is not writable in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/FileEngine.php on line 384

Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /usr/share/zoneminder/www/api/app/Config/core.php(376): Cache::config('_cake_core_', Array) #2 /usr/share/zoneminder/www/api/lib/Cake/Core/Configure.php(72): include('/usr/share/zone...') #3 /usr/share/zoneminder/www/api/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /usr/share/zoneminder/www/api/app/webroot/index.php(90): include('/usr/share/zone...') #5 {main} thrown in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 181

When I try to open http://serverip/zm/api
I expect I am just missing something simple but I don't know where to go from here.
maco1717
Posts: 7
Joined: Tue Sep 09, 2014 10:02 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by maco1717 »

Hi Trekimann,

I Wouldn't know why you having this problem, for the looks of it it looks like some permission issues, I recall having issues with cake myself. have you checked that that folder has the right permission I would advise giving all user and group read and write permission.

I could try and have a look see if following my post give's me some issues, but I wont be able to do it till next week, earliest. On the mean time maybe someone else can advise. you could also try and doing everything from scratch from a clean Raspbian install.

Also make sure you are using the same version as I as newer version might be installed differently or may not work.

Try to google the error you are getting an read about it. See if that throws some light. Also You can ignore the warnings, just focus on the "Fatal error"
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /usr/share/zoneminder/www/api/app/Config/core.php(376): Cache::config('_cake_core_', Array) #2 /usr/share/zoneminder/www/api/lib/Cake/Core/Configure.php(72): include('/usr/share/zone...') #3 /usr/share/zoneminder/www/api/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /usr/share/zoneminder/www/api/app/webroot/index.php(90): include('/usr/share/zone...') #5 {main} thrown in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 181
Lets us know how you do.
trekimann
Posts: 15
Joined: Thu Sep 08, 2016 2:23 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by trekimann »

I am using 1.29 as that is the newest which will run on the PI (as far as I know) Which folder would I maybe need to change the permissions for? /usr/share/zoneminder/www/api ?
maco1717
Posts: 7
Joined: Tue Sep 09, 2014 10:02 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by maco1717 »

have a look at this:

CacheException' with message 'Cache engine _cake_core_ is not properly configured /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 181 - Google Search:
https://www.google.co.uk/search?q=Cache ... n+line+181

Clean Install API Permission Issues - ZoneMinder Forums:
viewtopic.php?t=23947

php - Cakephp cake_core_ cache was unable to write 'cake_dev_en-us' - Stack Overflow:
http://stackoverflow.com/questions/1822 ... -dev-en-us

php - CakePHP unable to write to certain files - Stack Overflow:
http://stackoverflow.com/questions/9379 ... tain-files
trekimann
Posts: 15
Joined: Thu Sep 08, 2016 2:23 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by trekimann »

if anyone is interested it turned out that I needed to also use the command
sudo chown -R www-data:www-data /usr/share/zoneminder/www/api
and restart zoneminder and apache. seems to be all sorted now
maco1717
Posts: 7
Joined: Tue Sep 09, 2014 10:02 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by maco1717 »

Hi trekimann,

Thanks for letting us know.

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

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by knight-of-ni »

Moved to the mobile apps forum.
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/
maco1717
Posts: 7
Joined: Tue Sep 09, 2014 10:02 pm

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Post by maco1717 »

Hi trekimann,

Thanks for that.

I can confirm that there where missing steps. I'll update the original post with this step.

Kind regards.
\M
Post Reply