Page 1 of 1

ZmNinja, API, camera definitions

Posted: Sat May 27, 2017 8:25 pm
by ziptoo
Hi,
I have been using Zoneminder for many years, fresh rebuilding it every 1 or 2 years. This time around to take advantage of ZmNinja.

I am having trouble getting ZmNinja working, or rather, having trouble with the API. I have narrowed it down, I think, to possibly being the camera definitions. I have created, deleted and re-created monitors many times and according to the ZmNinja site this is one of the things that will produce a blank page. However I would think the getVersion url would work anyway?
This is on Gentoo, Zoneminder ver 1.30.2, which is up and running with all monitors working.

Is there an easy way to check and fix an "invalid camera definition "?
The only thing I can think of is to dump all the data in the database after deleting the cameras and start over.
Is there any other way to check what is going on? ( I have already fixed permissions errors and see nothing else in the apache2 error log). Will raising the debug level help with this?

Thanks :)

Re: ZmNinja, API, camera definitions

Posted: Sun May 28, 2017 12:05 am
by rockedge
begin with in a browser testing the API, by trying this URL

Code: Select all

http://your_zm_server.domain/zm/api/host/getVersion.json
what is generated?

Re: ZmNinja, API, camera definitions

Posted: Sun May 28, 2017 1:43 am
by ziptoo
With that I get nothing at all but a blank page. Sorry, should have stated this outright.

Re: ZmNinja, API, camera definitions

Posted: Sun May 28, 2017 3:29 am
by rockedge
ok I think you need to restart Apache after insuring that (Ubuntu based install) /etc/php5/mods-available/apcu.ini is enabled.
The update to version 1.30.2+ includes php5-apcu which now needs to be enabled for the API to work.
some more on the subject: viewtopic.php?f=36&t=26131

hope this helps.

Re: ZmNinja, API, camera definitions

Posted: Sun May 28, 2017 7:48 pm
by ziptoo
Thanks for the help. It seems there were lots of things needed to be enabled in PHP but no changes have worked yet. I am back to getting an error in CAKE:
Uncaught CacheException: Cache engine "_cake_model_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php:186
I also had an unwritable directory ...tmp/cache/persistent which I fixed and the above error continues.

Re: ZmNinja, API, camera definitions

Posted: Sun May 28, 2017 8:27 pm
by ziptoo
Correction, it seems I was not done creating folders in the tmp directory. I now get:
version "1.30.2"
apiversion "1.0"

For others with Gentoo:
Added package pecl-apcu and pecl-apcu-bc (backward compatibility-unsure if needed). I then added the directories to /usr/share/zoneminder/www/api/app/tmp, as in tmp/cache/models and tmp/cache/persistent. If this disappears on reboot as /usr/share/zoneminder/www/api/app/tmp is. actually a link to /var/lib/zoneminder/api_tmp I will have to figure how to re-create it on boot.
ZmNinja is now working!
Thanks for your help rockedge!!

Re: ZmNinja, API, camera definitions

Posted: Fri Aug 11, 2017 11:21 pm
by undrwater
Any further update here? I installed those packages, and the directories were already there. Also, they were not a link to /var/lib/zoneminder in my system.