open source ZM client: ZmNinja (uses ZoneMinder APIs)

Discussion topics related to mobile applications for ZoneMinder
McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Wed Dec 23, 2015 11:54 pm

Hello,

Got zmNinja to work on my iPhone 6 Plus - yay! Live monitor view works - yay! However, event playback does not work: it goes through the progress bar, but all I see is either a blank screen OR a picture of a camera with a question mark. Tried disabling/enabling h.264 support but it did not help.

Any ideas?

Also - is there a way to stop ptz movement once triggered? There does not appear to be a way to stop the camera from moving after tapping a directional arrow.

Thanks!

asker
Posts: 813
Joined: Sun Mar 01, 2015 12:12 pm

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by asker » Thu Dec 24, 2015 12:54 am

McFuzz wrote:Hello,

Got zmNinja to work on my iPhone 6 Plus - yay! Live monitor view works - yay! However, event playback does not work: it goes through the progress bar, but all I see is either a blank screen OR a picture of a camera with a question mark. Tried disabling/enabling h.264 support but it did not help.

Any ideas?

Also - is there a way to stop ptz movement once triggered? There does not appear to be a way to stop the camera from moving after tapping a directional arrow.

Thanks!
Hello,
a) For the no events image, its is likely that you don't have the right ZM patches installed. Replace your version of web/views/image.php with this file https://raw.githubusercontent.com/abish ... /image.php
If you still don't see images, let me know what you see in apache error logs

b) To stop PTZ, it would depend on which PTZ script you are using in ZM. Which camera/script are you using in ZM (not zmNinja) and when you do PTZ in ZM does it stop? Is the constant motion only for the down direction or all directions?

thx
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Thu Dec 24, 2015 2:10 am

1. The image.php from the link is identical to the image.php that I currently have.

Apache error log spits the following:

Code: Select all

[Wed Dec 23 18:07:04.916641 2015] [:error] [pid 14024] [client 16x.x.x.x:24638] PHP Fatal error:  Call to undefined function imagecreatefromjpeg() in /usr/share/zoneminder/www/views/image.php on line 117
2. I am using one of the default scripts (It's the script for the Foscam FI8918W; I can paste the contents if needed) for a foscam camera which works out of the box with ZoneMinder core UI. The PTZ functionality does respond to the stop button when using the web UI. The motion is constant for all directions.

asker
Posts: 813
Joined: Sun Mar 01, 2015 12:12 pm

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by asker » Thu Dec 24, 2015 2:43 am

So then you probably don't have php5-gd installed in zm. Can you please install that package.
On Ptz zm you need to explicitly tap a stop button then there may be a problem with the script. Ill take a look tomorrow

McFuzz wrote:1. The image.php from the link is identical to the image.php that I currently have.

Apache error log spits the following:

Code: Select all

[Wed Dec 23 18:07:04.916641 2015] [:error] [pid 14024] [client 16x.x.x.x:24638] PHP Fatal error:  Call to undefined function imagecreatefromjpeg() in /usr/share/zoneminder/www/views/image.php on line 117
2. I am using one of the default scripts (It's the script for the Foscam FI8918W; I can paste the contents if needed) for a foscam camera which works out of the box with ZoneMinder core UI. The PTZ functionality does respond to the stop button when using the web UI. The motion is constant for all directions.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Thu Dec 24, 2015 3:57 am

Ahhhhh while I did have php5-gd installed earlier today, I didn't restart Apache; did so and voila! Thanks for the hint.

On an unrelated note - is it possible to have a server selection menu upon launch of the app? I have three nodes configured on my end - two of which are for my home (Internal LAN access and external WAN access) and the last one being a client of mine. Currently when the app launches, I have to wait until authentication times out before I can go to the ZM settings menu and select a server. It'd be nice to have it from the get-go.

asker wrote:So then you probably don't have php5-gd installed in zm. Can you please install that package.
On Ptz zm you need to explicitly tap a stop button then there may be a problem with the script. Ill take a look tomorrow

McFuzz wrote:1. The image.php from the link is identical to the image.php that I currently have.

Apache error log spits the following:

Code: Select all

[Wed Dec 23 18:07:04.916641 2015] [:error] [pid 14024] [client 16x.x.x.x:24638] PHP Fatal error:  Call to undefined function imagecreatefromjpeg() in /usr/share/zoneminder/www/views/image.php on line 117
2. I am using one of the default scripts (It's the script for the Foscam FI8918W; I can paste the contents if needed) for a foscam camera which works out of the box with ZoneMinder core UI. The PTZ functionality does respond to the stop button when using the web UI. The motion is constant for all directions.

asker
Posts: 813
Joined: Sun Mar 01, 2015 12:12 pm

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by asker » Thu Dec 24, 2015 11:14 am

McFuzz, you are turning into my favorite tester for the following reasons:
a) You use iOS
b) You use my multi-server feature which no one seems to be using (and therefore lightly tested)
c) You also seem to be using Pan/Tilt (which you would have observed is lightly implemented with no presets)

So, onto your problems:

1) PTZ - I hope in your FI8918W you have followed these instructions https://wiki.zoneminder.com/Foscam_FI8918W -- most importantly specified an AutoStop timeout as 1. This makes the camera move for one second and stop. I have the same camera and just tried it

2) Server switch - good point - so you are in a situation where certain profiles don't work in certain network setups and zmNinja wastes time authenticating when you know it will fail. Good point. Can you please create a feature request for this here https://github.com/pliablepixels/zmNinja/issues

3) What I plan to do is implement these features for the desktop port - its easy to test for you and me - if it works, I'll publish it to the stores (app store is closed till Dec 29th). So which desktop port works for you ? https://github.com/pliablepixels/zmNinj ... -platforms
McFuzz wrote:Ahhhhh while I did have php5-gd installed earlier today, I didn't restart Apache; did so and voila! Thanks for the hint.

On an unrelated note - is it possible to have a server selection menu upon launch of the app? I have three nodes configured on my end - two of which are for my home (Internal LAN access and external WAN access) and the last one being a client of mine. Currently when the app launches, I have to wait until authentication times out before I can go to the ZM settings menu and select a server. It'd be nice to have it from the get-go.

asker wrote:So then you probably don't have php5-gd installed in zm. Can you please install that package.
On Ptz zm you need to explicitly tap a stop button then there may be a problem with the script. Ill take a look tomorrow

McFuzz wrote:1. The image.php from the link is identical to the image.php that I currently have.

Apache error log spits the following:

Code: Select all

[Wed Dec 23 18:07:04.916641 2015] [:error] [pid 14024] [client 16x.x.x.x:24638] PHP Fatal error:  Call to undefined function imagecreatefromjpeg() in /usr/share/zoneminder/www/views/image.php on line 117
2. I am using one of the default scripts (It's the script for the Foscam FI8918W; I can paste the contents if needed) for a foscam camera which works out of the box with ZoneMinder core UI. The PTZ functionality does respond to the stop button when using the web UI. The motion is constant for all directions.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Thu Dec 24, 2015 9:41 pm

Hey asker,

No problem - happy to test things out for you :)

1. PTZ - I personally never liked the autostop of 1 setup; I prefer to have it at 0 so the camera moves until it gets to where I want and I then stop it manually... but I can understand where you're coming from so it's not a big deal if you want to stick with that for zmninja; I can live with it :p

2. Will do. Edit: done - see ticket #122.

3. I can do either OSX or Windows - I split my usage down the middle between the two. I can also do Linux if needed but it'd be through a VM since I do not have a dedicated linux box.

asker
Posts: 813
Joined: Sun Mar 01, 2015 12:12 pm

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by asker » Thu Dec 24, 2015 11:05 pm

McFuzz, give this version a go (OS X)
https://drive.google.com/file/d/0B3iQz0 ... sp=sharing

a) Please check if PTZ now works - I've added a stop
b) While authentication is on, I've added a "X" button - you can tap that to get out of it to the login screen

thx
McFuzz wrote:Hey asker,

No problem - happy to test things out for you :)

1. PTZ - I personally never liked the autostop of 1 setup; I prefer to have it at 0 so the camera moves until it gets to where I want and I then stop it manually... but I can understand where you're coming from so it's not a big deal if you want to stick with that for zmninja; I can live with it :p

2. Will do. Edit: done - see ticket #122.

3. I can do either OSX or Windows - I split my usage down the middle between the two. I can also do Linux if needed but it'd be through a VM since I do not have a dedicated linux box.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Fri Dec 25, 2015 8:38 am

asker wrote:McFuzz, give this version a go (OS X)
https://drive.google.com/file/d/0B3iQz0 ... sp=sharing

a) Please check if PTZ now works - I've added a stop
b) While authentication is on, I've added a "X" button - you can tap that to get out of it to the login screen

thx
McFuzz wrote:Hey asker,

No problem - happy to test things out for you :)

1. PTZ - I personally never liked the autostop of 1 setup; I prefer to have it at 0 so the camera moves until it gets to where I want and I then stop it manually... but I can understand where you're coming from so it's not a big deal if you want to stick with that for zmninja; I can live with it :p

2. Will do. Edit: done - see ticket #122.

3. I can do either OSX or Windows - I split my usage down the middle between the two. I can also do Linux if needed but it'd be through a VM since I do not have a dedicated linux box.
I'll give it a shot in the morning. Side question: is the minimum refresh interval indeed 1 second? Is there no way to see cameras in real time FPS (mine are all at 15)?

asker
Posts: 813
Joined: Sun Mar 01, 2015 12:12 pm

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by asker » Fri Dec 25, 2015 1:25 pm

Not in montage view. The reason is that Chrome does not allow more than 6 connections open to the same sub/domain. So if I enable persistent connections, it would only allow unto 6 monitors and the rest would freeze. To get around that limitation, I am doing single snapshot requests (which means I close the connection and re-open it). If I did this for each monitor at real FPS it would overwhelm ZM.

But here is what I _can_ you. When you tap on a monitor, I could show real fps for that monitor (single monitor view). Will that help?
McFuzz wrote: I'll give it a shot in the morning. Side question: is the minimum refresh interval indeed 1 second? Is there no way to see cameras in real time FPS (mine are all at 15)?
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

asker
Posts: 813
Joined: Sun Mar 01, 2015 12:12 pm

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by asker » Fri Dec 25, 2015 2:56 pm

Give this version a go
https://drive.google.com/file/d/0B3iQz0 ... sp=sharing

There is a new option to use zms in developer settings - this should enable real fps streaming in single view mode (not when montage is showing)
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Fri Dec 25, 2015 8:46 pm

asker wrote:Not in montage view. The reason is that Chrome does not allow more than 6 connections open to the same sub/domain. So if I enable persistent connections, it would only allow unto 6 monitors and the rest would freeze. To get around that limitation, I am doing single snapshot requests (which means I close the connection and re-open it). If I did this for each monitor at real FPS it would overwhelm ZM.

But here is what I _can_ you. When you tap on a monitor, I could show real fps for that monitor (single monitor view). Will that help?
McFuzz wrote: I'll give it a shot in the morning. Side question: is the minimum refresh interval indeed 1 second? Is there no way to see cameras in real time FPS (mine are all at 15)?

Oh yeah - montage would make sense but single view at real FPS would be awesome!

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Fri Dec 25, 2015 9:07 pm

asker wrote:Give this version a go
https://drive.google.com/file/d/0B3iQz0 ... sp=sharing

There is a new option to use zms in developer settings - this should enable real fps streaming in single view mode (not when montage is showing)

Just gave it a try - zms streaming works like a charm and so does PTZ stop! Yay!

Was the server selection option implemented in this latest rev or not? I have two boxes setup on my mac - my own server and a clients and by default it still logs onto the last server.

Also - it looks like server-swap on the desktop app is broken. In the iOS app, I can click on the little down-arrow next to the menu selector when "ZM Settings" is selected and swap between the server groups, but in the Mac desktop app, it does not work (doesn't do anything) and neither does the delete functionality.

If I may also add a suggestion - perhaps you can add a 'add new server' button to the pop-up menu... I know you can add a server by simply overwriting what it currently shows in ZM Settings - but adding a button may be a bit more intuitive.


Oh and totally unrelated to the issues above but - the push notifications - i assume that's the 'event server' option? Can it be setup on my end (my own box)? Will it be able to handle multiple ZM server or will it push only for the one that has been last logged into?

asker
Posts: 813
Joined: Sun Mar 01, 2015 12:12 pm

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by asker » Fri Dec 25, 2015 11:04 pm

Just gave it a try - zms streaming works like a charm and so does PTZ stop! Yay!
Great!
Was the server selection option implemented in this latest rev or not? I have two boxes setup on my mac - my own server and a clients and by default it still logs onto the last server.
Yes, but not in the way you are thinking. What I've now enabled is that you can cancel the authentication. My hypothesis is most people will want to auto log into their previous settings, so I want to keep it simple. In your case, you can now tap on the "X" circle next to authenticating and that will take you to login without waiting for the timeout.
Also - it looks like server-swap on the desktop app is broken. In the iOS app, I can click on the little down-arrow next to the menu selector when "ZM Settings" is selected and swap between the server groups, but in the Mac desktop app, it does not work (doesn't do anything) and neither does the delete functionality.
Seems to work just fine for me -- if its not working, you need to enable debug logs and then take a look at what logs are saying.
If I may also add a suggestion - perhaps you can add a 'add new server' button to the pop-up menu... I know you can add a server by simply overwriting what it currently shows in ZM Settings - but adding a button may be a bit more intuitive.
Yup. This part is partially implemented - it was a pain doing multi-server and managing push notifications/swapping between them etc - you will also see (especially in the phone version), if you define too many groups, the selection list scrolls out of view - so there is work to do there. I'll get around to improving it sooner than later.

Oh and totally unrelated to the issues above but - the push notifications - i assume that's the 'event server' option? Can it be setup on my end (my own box)?
Yes, mostly.
https://github.com/pliablepixels/zmeventserver --> needs to be installed along with your ZM installation.
It uses web sockets to communicate and send events. However, to send it to your phone requires your event server to 'proxy' requests to a public notification server I've set up. The zmeventserver code is set up to talk to my server. Why is this needed? Well, Apple and Google want to make sure only authorized senders can send messages to zmNinja (otherwise it would be easy to spam). So for push messages to reach your phone, your event server needs to send my server a request to push it to your zmNinja. My server and zmNinja share a 'secure certificate' so Apple/Google allow that communication.

This does not apply for desktop clients - there is no push there over APNS/GCM - its over web sockets and your event server talks directly to the desktop code.

Will it be able to handle multiple ZM server or will it push only for the one that has been last logged into?
For now the last one logged into. Its very messy trying to maintain them for multiple ones.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: open source ZM client: ZmNinja (uses ZoneMinder APIs)

Post by McFuzz » Sat Dec 26, 2015 8:04 am

Totally double posted there rofl :p

And 10-4 re: event server. I'll stick with SMS notifications for the time being (yay unlimited data). I swap between servers regularly as I keep a close eye on my clients box (it's a mechanic and he got burned a few times before by shady customers trying to blame him for non existing damage) to ensure it's up and running. So far nothing that was not my fault has occurred but nevertheless.

Interesting - I know what happened - I had both server groups pointing to the same endpoint and I completely missed it. Oops!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests