API on Debian

Forum for questions and support relating to the 1.28.x releases only.
richard_t
Posts: 3
Joined: Tue Jan 19, 2016 8:18 pm

API on Debian

Post by richard_t »

Hi all,
Hopefully I will give you enough info required. Please go easy on me as have probably made some fundamental mistakes.

I have had zoneminder running for a few weeks, but have not managed to get the API working, despite lots of attempts.
ZoneMinder Running - v1.28.1, on debian stretch/sid Kernel 4.3.0-1-amd64
I am trying to get the API to work, I may have gone about this the wrong way but I have downloaded 1.29 to my desktop and transferred the API files across. Then noticed that there was no CRUD files, so downloaded CRUD3 (from FriendsOfCake) and transferred it across to zoneminder.

I initially used apt-get install zoneminder. Then subsequently tried to use the git install.

Code: Select all


Error: [MissingPluginException] Plugin Crud could not be found. #0 /usr/src/zoneminder/web/api/lib/Cake/Core/App.php(365): CakePlugin::path('Crud') #1 /usr/src/zoneminder/web/api/lib/Cake/Core/App.php(226): App::pluginPath('Crud') #2 /usr/src/zoneminder/web/api/lib/Cake/Core/App.php(547): App::path('Lib', 'Crud') #3 [internal function]: App::load('CrudControllerT...') #4 /usr/src/zoneminder/web/api/app/Controller/AppController.php(34): spl_autoload_call('CrudControllerT...') #5 /usr/src/zoneminder/web/api/lib/Cake/Core/App.php(545): include('/usr/src/zonemi...') #6 [internal function]: App::load('AppController') #7 [internal function]: spl_autoload_call('AppController') #8 /usr/src/zoneminder/web/api/lib/Cake/Error/ExceptionRenderer.php(151): class_exists('AppController') #9 /usr/src/zoneminder/web/api/lib/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(FatalErrorException)) #10 /usr/src/zoneminder/web/api/lib/Cake/Error/ErrorHandler.php(119): ExceptionRenderer->__construct(Object(FatalErrorException)) #11 [internal function]: ErrorHandler::handleException(Object(FatalErrorException)) #12 /usr/src/zoneminder/web/api/lib/Cake/Error/ErrorHandler.php(252): call_user_func('ErrorHandler::h...', Object(FatalErrorException)) #13 /usr/src/zoneminder/web/api/lib/Cake/Error/ErrorHandler.php(203): ErrorHandler::handleFatalError(256, 'Can't find appl...', '/usr/src/zonemi...', 97) #14 [internal function]: ErrorHandler::handleError(256, 'Can't find appl...', '/usr/src/zonemi...', 97, Array) #15 /usr/src/zoneminder/web/api/lib/Cake/Core/Configure.php(97): trigger_error('Can't find appl...', 256) #16 /usr/src/zoneminder/web/api/lib/Cake/bootstrap.php(177): Configure::bootstrap(true) #17 /usr/src/zoneminder/web/api/app/webroot/index.php(90): include('/usr/src/zonemi...') #18 {main}	
File: /usr/src/zoneminder/web/api/lib/Cake/Error/ErrorHandler.php	
Line: 129
Some of the other posts I have seen seem to talk about installing the API into different paths?

Not sure if I need to completely uninstall and start again (but I had done this previously and still did not sort it..

Hopefully I have given enough information for you to help, if not please ask and I will provide what you may need.


Regards Rich.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API on Debian

Post by asker »

To get APIs working I'd recommend you switch to 1.29

It is technically possible to make it work with 1.28 but involves various steps and patches. If you must go down this path, which I don't recommend, take a look at viewtopic.php?f=32&t=23878 and contact the user who got it working.
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
richard_t
Posts: 3
Joined: Tue Jan 19, 2016 8:18 pm

Re: API on Debian

Post by richard_t »

Thanks Asker,
I could not get 1.29 on Debian (did not think it was compatible at the moment)?

Rich.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API on Debian

Post by asker »

Ah yes that's true. You probably need to ask the Debian maintainer if they can create a 1.29-rc package. In the mean time you can try to get it working on 1.28 via that other link I posted.
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
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: API on Debian

Post by knight-of-ni »

Asker and I are developing a set of documentation specifically for this sort of situation. The documentation will describe how to roll your own package using the latest master branch. This will allow you to upgrade to a development snapshot so you won't have to wait for the package maintainer. Since it is package based, you can easily swap between official packages, to a package you rolled yourself, and back to an official package as your needs change.
Technically this will be for ubuntu, but I would expect the same sort of steps could be applied for debian.
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/
richard_t
Posts: 3
Joined: Tue Jan 19, 2016 8:18 pm

Re: API on Debian

Post by richard_t »

Thanks both, this will be much appreciated, I have bought the zmNinja app so wanted to use zoneminder with that, but also the flexibility of the API will be really useful.

I think I will wait and see how your work develops and keep an eye out for your posts. The simpler the better please, as most tuts seem to miss out elements and assume a certain level of knowledge which is not always there.

If you need me to proof read or check the documentation to see if it is easy to follow, feel free to drop me a pm or an email when your ready.
knnniggett wrote:Asker and I are developing a set of documentation specifically for this sort of situation. The documentation will describe how to roll your own package using the latest master branch. This will allow you to upgrade to a development snapshot so you won't have to wait for the package maintainer. Since it is package based, you can easily swap between official packages, to a package you rolled yourself, and back to an official package as your needs change.
Technically this will be for ubuntu, but I would expect the same sort of steps could be applied for debian.
Kind Regards,
Rich
User avatar
MJN
Posts: 251
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Re: API on Debian

Post by MJN »

Rich,

Did you make any progress? I've just bought ZMNinja but am unable to use it on my Debian installation of ZM (v1.29.0) due to the missing APIs.

Knnniggett,

I'd be interested and appreciative for the outcome of your work with Asker on the roll-your-own documentation side.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API on Debian

Post by asker »

You already have 1.29 installed? What happens when you go to /zm/api ? Lets start from there
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
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API on Debian

Post by asker »

With respect to the roll your own package instructions, I have an open PR that is yet to be merged. But if you already have 1.29 you shouldn't need it. https://github.com/ZoneMinder/ZoneMinder/pull/1248 (see ubuntu.rst inside that PR). I'm really not sure if it will work out of the box for debian - I wrote this with knnnigget's help to be a build from package for ubuntu - not quite sure what will change in the steps for debian (given I've never used it)
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
User avatar
MJN
Posts: 251
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Re: API on Debian

Post by MJN »

[re 1.29 installed?] Yes, and no...

I previously had v1.28.100 installed (and working) and followed the same instructions here to fetch and install v1.29.0. This appears to have worked (the ZM web interface indicates v1.29.0 at the top and ZM functions) however I note that there is no /usr/share/zoneminder/api folder (hence visiting /zm/api gives an Error 404).

As raised here I think the fact that the resulting .deb package version numbers include 1.28.0 in the filenames suggest that whatever is responsible for producing these has not been updated to install the api files. If this is the case I'm happy to wait - ZMNinja looks worth waiting for from what I've seen so far!
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API on Debian

Post by asker »

okay, I feel for you folks- I have no idea what plans the debian maintainer has for 1.29. If one of you can give me a 1.28 install that is working with one camera on debian, I'll get the APIs working completely on it. I need ssh access as root. If any debian user is upto it, please email me access details at pliablepixels at gmail. But please make sure its a clean 1.28 install - no half baked API attempts in it

Alternately, before you reach out, give https://github.com/pliablepixels/ZoneMi ... rom-source a go
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
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: API on Debian

Post by SteveGilvarry »

Debian Maintainer does not follow project so I tagged him in github release thread to let him know 1.29.0 released.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
User avatar
MJN
Posts: 251
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Re: API on Debian

Post by MJN »

Thanks for the offer Asker. Unfortunately I'm not in a position help you (help me) but I really appreciate the offer nevertheless.

Hopefully the Debian maintainer will respond to Steve's nudge. Perhaps I was a little too quick to upgrade to 1.29...
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API on Debian

Post by asker »

Oh wait, MJN I re-read your post. You really are on 1.29, not a hacked version of 1.28 + API attempt. I think it was someone else who emailed me with that problem.

I think in your case its a simple matter of not pulling in the API directories when you followed that link. I don't think the link you followed is correct. But I can't really help concretely if I can't access your system.

Can you give the do_debian.sh link I posted above a try?
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
User avatar
MJN
Posts: 251
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Re: API on Debian

Post by MJN »

Unfortunately I am unable to install additional packages on this machine at the moment (configuration control) and so can't bring in all of the necessary dependencies to complete the build from source.

I'll hold fire for the time being as I don't want to waste your time if I can't at least match the effort at this end.
Locked