zmNinja for desktops

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: zmNinja for desktops

Post by knight-of-ni »

@BiloxiGeek You need to turn on DEEP_STORAGE. The only reason the old storage is still supported is to give users of old zoneminders a migration path.
To turn it on when running master, you should run "zmupdate.pl --migrate-events" to convert the existing events. Or just delete your events and start over with a new database (or go into the Config table and turn that bit on if you are comfortable doing that).
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/
BiloxiGeek
Posts: 271
Joined: Tue Feb 11, 2014 2:04 pm

Re: zmNinja for desktops

Post by BiloxiGeek »

While I don't particularly like the deep storage, I can live with it. :)

But something is still borked up with event watching in zmNinja. When I try to view a recorded event via the web interface it works just fine. Using zmNinja I get a bunch of this in the ssl_error.log:

Code: Select all

[Sat Nov 14 16:48:26.951890 2015] [:error] [pid 28669] [client <ipaddr>.1:44198] PHP Fatal error:  Call to undefined function imagescale() in /usr/share/zoneminder/www/views/image.php on line 125
It appears to put one of those errors in the log for each frame of the event.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: zmNinja for desktops

Post by rockedge »

[quote="asker"]Rockedge, can you please give this a try for linux? If this works, it was a 32bit problem. I doubt however, it will work with Puppy linux, but please give it a try

Very Cool! I am downloading and will report in a moment.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: zmNinja for desktops

Post by rockedge »

[quote="asker"]Rockedge, can you please give this a try for linux? If this works, it was a 32bit problem. I doubt however, it will work with Puppy linux, but please give it a try

Nice! it runs like a champ! I will configure it and test against my 1.28.108 install and report back.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: zmNinja for desktops

Post by rockedge »

On Puppy Linux Tahr 6.0.3 and so far everything works except for the functions that are not finished. Going for normal usage tests for the next days.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker »

rockedge wrote:On Puppy Linux Tahr 6.0.3 and so far everything works except for the functions that are not finished. Going for normal usage tests for the next days.
damn - good to know the puppy likes the ninja. I'll set up the 32 bit download as part of a regular update
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: zmNinja for desktop

Post by asker »

BiloxiGeek wrote:While I don't particularly like the deep storage, I can live with it. :)

But something is still borked up with event watching in zmNinja. When I try to view a recorded event via the web interface it works just fine. Using zmNinja I get a bunch of this in the ssl_error.log:

Code: Select all

[Sat Nov 14 16:48:26.951890 2015] [:error] [pid 28669] [client <ipaddr>.1:44198] PHP Fatal error:  Call to undefined function imagescale() in /usr/share/zoneminder/www/views/image.php on line 125
It appears to put one of those errors in the log for each frame of the event.

Zoneminder uses ZMS to show images. ZmNinja does not. ZMS sucks in general especially on mobiles. You need to figure out which a library on scilinux to offers image scale
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
abi
Posts: 61
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi »

1. Is it possible to run zmNinja on CentOS7 ? It has only php54, so no imagescale() function available. https://github.com/pliablepixels/zmNinj ... r-with-API states that 54 should be enough.

2. Are you going to support plain auth on apache side? As zoneminder wiki states, ZM auth is not secure.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker »

abi, Im pretty sure CentOS has imageScale --> knnnigget maintains the CentOS ports and this particular feature was merged after knnnigget confirmed it works https://github.com/ZoneMinder/ZoneMinder/pull/1001

Can you check with him?

As a sidenote:
It's pretty easy to make zmNinja work without scale support for the desktop version:

a) Go to developer settings -> make event image scale % to 100 and save. This should make "event footage" work not quick scrub
b) To make quick scrub work, needs one to change one line of code which it a little more complicated for the downloaded archives

IF this scaling is a pain in terms of platforms not supporting them, I'll add a flag in the next version to enable/disable 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
abi
Posts: 61
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi »

asker wrote:abi, Im pretty sure CentOS has imageScale --> knnnigget maintains the CentOS ports and this particular feature was merged after knnnigget confirmed it works https://github.com/ZoneMinder/ZoneMinder/pull/1001
It is not. imagescale is from 5.5 http://php.net/manual/en/function.imagescale.php so it's not available on CentOS. Unofficial backport repos are available, but this is path to have issue on CentOS and it will break zmrepo deps as php is available under different name.

I think, the most acceptable solution not to disable feature at all, but add custom inplementation of imagescale in function_exists block. I am almost sure, it's just a helper to more general purpose function gd has for ages. This one http://php.net/manual/en/function.image ... ampled.php should do the job.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker »

That's interesting. I guess that PR needs to be reworked if that is the case - and should use a compatible API instead.
In the mean time I will add in that toggle in zmNinja so it works even if people don't have the server side fix.
abi wrote: It is not. imagescale is from 5.5 http://php.net/manual/en/function.imagescale.php so it's not available on CentOS. Unofficial backport repos are available, but this is path to have issue on CentOS and it will break zmrepo deps as php is available under different name.

I think, the most acceptable solution not to disable feature at all, but add custom inplementation of imagescale in function_exists block. I am almost sure, it's just a helper to more general purpose function gd has for ages. This one http://php.net/manual/en/function.image ... ampled.php should do the job.
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
abi
Posts: 61
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi »

asker wrote:That's interesting. I guess that PR needs to be reworked if that is the case - and should use a compatible API instead.
In the mean time I will add in that toggle in zmNinja so it works even if people don't have the server side fix.
Should I open the PR ? I can even write a patch, it looks trivial.

BTW, what about my second question - are you planning to add external (Apache) simple auth ? AFAIK, ZM auth is not very secure thing and I'd avoid to expose it on the Internet.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker »

Sure, if its not available then this PR will fail. I'm not a core ZM developer, so the call needs to be made by knnnigett/iconnor/fixxermet but given its not supported, I think you should PR anyway.


With respect to Apache auth:
1. I don't plan to add basic auth but wouldn't it just work if you did a user:password@host as part of the base URL setting of zmNinja? What I am not sure of is how Chrome treats it - my app uses a Chrome window and I read somewhere that it drops basic auth in URLs as its not secure (even if its over SSL, being a part of the URL means it can show up in referred by headers and termination logs as well). You can always give it a try

2. Can you point me to the article that says ZM auth is insecure?
abi wrote:
asker wrote:That's interesting. I guess that PR needs to be reworked if that is the case - and should use a compatible API instead.
In the mean time I will add in that toggle in zmNinja so it works even if people don't have the server side fix.
Should I open the PR ? I can even write a patch, it looks trivial.

BTW, what about my second question - are you planning to add external (Apache) simple auth ? AFAIK, ZM auth is not very secure thing and I'd avoid to expose it on the Internet.
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
abi
Posts: 61
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi »

Here you are. I'm not supplying diff as I doubt devs will use my newbie code :)
https://github.com/ZoneMinder/ZoneMinder/issues/1163

1. Didn't fugure this out. I'll try and report.
2. I read somewhere, maybe in wiki or option description that jpegs can be accessed by direct linking or something like this. Maybe just wrong interpretation, but, anyway, with apache auth I'm reducing attack surface.
Simpler
Posts: 76
Joined: Mon Nov 02, 2015 12:40 am

Re: zmNinja for desktops

Post by Simpler »

I'm trying out zmNinja on Linux Mint 17.2 with ZoneMinder 1.28.107. Most seems to be working well and looks great, but for some reason when I do a "Quick Scrub" or "View Footage" on an event, I only see a generic image of camera with a red question mark.

I can view the events in ZoneMinder, but not in zmNinja.

I turned on the debug switch in zmNinja and the top of the log file has the following:

Code: Select all

version:0.86.1D

Nov 15, 2015 7:09:34 PM INFO Stream authentication construction: 
Nov 15, 2015 7:09:34 PM INFO Data Model: Did not find any  stream mode of auth
Nov 15, 2015 7:09:34 PM INFO DataModel: Did not find a stream auth key, looking for user=
Nov 15, 2015 7:09:33 PM INFO Got API version: 1.28.107
Nov 15, 2015 7:09:33 PM INFO ZM_EVENT_IMAGE_DIGITS is 5
Nov 15, 2015 7:09:33 PM DEBUG DataModel: Getting auth from http://localhost/zm/index.php?view=watch
I'm not sure if that is relevant?
Post Reply