ZmNinja, API, camera definitions

Forum for questions and support relating to the 1.30.x releases only.
Locked
ziptoo
Posts: 4
Joined: Sat May 27, 2017 8:11 pm

ZmNinja, API, camera definitions

Post 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 :)
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: ZmNinja, API, camera definitions

Post 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?
ziptoo
Posts: 4
Joined: Sat May 27, 2017 8:11 pm

Re: ZmNinja, API, camera definitions

Post by ziptoo »

With that I get nothing at all but a blank page. Sorry, should have stated this outright.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: ZmNinja, API, camera definitions

Post 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.
ziptoo
Posts: 4
Joined: Sat May 27, 2017 8:11 pm

Re: ZmNinja, API, camera definitions

Post 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.
ziptoo
Posts: 4
Joined: Sat May 27, 2017 8:11 pm

Re: ZmNinja, API, camera definitions

Post 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!!
undrwater
Posts: 13
Joined: Thu Apr 07, 2016 4:17 am

Re: ZmNinja, API, camera definitions

Post 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.
Locked