Page 1 of 1

Real time event notification with zmNinja (0.81+)

Posted: Sat Oct 10, 2015 8:39 pm
by asker
Updated Oct 24 2015:

As of release 0.83 push notifications are fully supported for both iOS and Android.
You need the latest event server from here

Enabling push notifications is easy. Just follow these steps. The push notification server is running at my home, so please be kind with the amount of pushes you do. I strongly encourage you to use reporting interval filters (new feature starting zmNinja 0.83)


HERE is a demo on an android phone lying around.
HERE is a demo on an iPhone

For this to work, you need to :
  • install the new Zoneminder event server HERE and have it configured and running. Make sure you enable push proxy and read its instructions.
  • Configure zmNinja to use the event server - the URL MUST be of the format wss://<hostname or ip>:<port>. Unless you change something the hostname is the same as ZM's hostname and port is 9000
  • Make sure the event server is reachable from the phone (if that means opening up a firewall port, then please do so)

Re: Real time event notification with zmNinja (0.81+)

Posted: Tue Oct 13, 2015 11:52 pm
by aaronl
Notes on getting this to run on ubuntu 14.04

1) The CPAN install of Crypt::MySQL failed wanting a SHA1 Digest package. So installed via apt instead:

Code: Select all

sudo apt-get install libcrypt-mysql-perl
2) The CPAN install of WebSockets failed with "make not ok".

Code: Select all

sudo apt-get install libyaml-perl
sudo apt-get install make
Now webSockets installed :D

There was an issue with the -T flag in the script. syslog states that the '-T' must be also be on the command line. I commented out for now, but that's not the best choice.

syslog now says this every few minutes:

Code: Select all

zmdc[18313]: INF ['zmeventnotification.pl' started at 15/10/13 16:49:09]
zmdc[18092]: ERR ['zmeventnotification.pl' exited abnormally, exit status 9]
The command zmeventnotification.pl is also missing from the process list (ps aux)...

I'm still working on validating that I have everything else correct...

Re: Real time event notification with zmNinja (0.81+)

Posted: Tue Oct 13, 2015 11:56 pm
by asker
Awesome - thanks for trying.

1) Please don't run it via zmdc for now.

Can you please run it manually "sudo ./zmeventnotification.pl" and then see? (logs will still go to syslog)
(Before you do this make sure you kill it and also remove it from zmdc restart otherwise it will keep getting restarted, or just change the port in the code before you run it from command line)

I've had mine running for 2 weeks now - ubuntu 14


2) What is the exact syslog issue with -T ? I don't see any on mine

Re: Real time event notification with zmNinja (0.81+)

Posted: Tue Oct 13, 2015 11:59 pm
by aaronl
running it on command line gives:

Code: Select all

Can't locate JSON.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at ./zmeventnotification.pl line 48

Re: Real time event notification with zmNinja (0.81+)

Posted: Wed Oct 14, 2015 12:09 am
by asker
Huh. It was there in mine

Code: Select all

apt-get install libjson-perl

Re: Real time event notification with zmNinja (0.81+)

Posted: Wed Oct 14, 2015 12:16 am
by aaronl
Just found it, mine has JSON::XS, which is some accelerated version of it.
http://packages.ubuntu.com/trusty/amd64 ... l/filelist
For now I modified the script to

Code: Select all

use JSON::XS;
and it launches by hand, no errors.
I also put the -T option back in, that was my bad, I was running it on the command line as "perl ./zmeventnotification.pl". Once I let the shell launch the perl interpreter that complaint went away.


Aaron

Re: Real time event notification with zmNinja (0.81+)

Posted: Wed Oct 14, 2015 12:19 am
by aaronl
pop, pop go the events! :P

Re: Real time event notification with zmNinja (0.81+)

Posted: Wed Oct 14, 2015 12:24 am
by asker
Okay, please keep it running in this mode (command line) and try it with zmNinja to make sure its able to parse the JSON objects etc before you move it to zmdc

Thanks!

Re: Real time event notification with zmNinja (0.81+)

Posted: Wed Oct 14, 2015 12:25 am
by asker
Yay! That ding is king!
aaronl wrote:pop, pop go the events! :P

Re: Real time event notification with zmNinja (0.81+)

Posted: Sat Oct 17, 2015 12:43 am
by asker
And now, iOS push notifications


However, till I host my own server, it still won't work for you. If you are an iOS developer and have access to iOS member center,
you can generate your own push certificates and use the experimental branch of zmeventserver
https://github.com/pliablepixels/zmeven ... perimental