Closed pliablepixels closed 8 years ago
Hmm, so it looks like someone is able to connect but keeps disconnecting
Jan 9 20:09:53 behemoth zmeventnotification[21102]: INF [Websocket remotely disconnected from ::ffff:10.1.1.19]
Jan 9 20:09:57 behemoth zmeventnotification[21102]: INF [got a websocket connection from ::ffff:10.1.1.19 (0) active connections]
Can you please enable DEBUG logs in zmNinja as well? (Developer settings)
I've just mailed this over... Thank you very much for taking the time to look at my problem!
For the benefit of others...
Jan 11, 2016 12:22:45 AM INFO Websocket closed
Jan 11, 2016 12:22:41 AM INFO Websocket closed
Jan 11, 2016 12:22:38 AM INFO Websocket closed
Jan 11, 2016 12:22:32 AM INFO Websocket closed
Jan 11, 2016 12:22:29 AM INFO Websocket closed
Jan 11, 2016 12:22:24 AM INFO Websocket closed
Jan 11, 2016 12:22:19 AM INFO Websocket closed
Jan 11, 2016 12:22:13 AM INFO Websocket closed
Jan 11, 2016 12:22:08 AM INFO Websocket closed
Jan 11, 2016 12:22:06 AM INFO Stream authentication construction:
Jan 11, 2016 12:22:06 AM INFO Data Model: Did not find any stream mode of auth
Jan 11, 2016 12:22:06 AM INFO DataModel: Did not find a stream auth key, looking for user=
Jan 11, 2016 12:22:06 AM INFO Got API version: 1.29.0
Jan 11, 2016 12:22:06 AM INFO ZM_EVENT_IMAGE_DIGITS is 5
Jan 11, 2016 12:22:06 AM INFO Returning pre-loaded list of 4 monitors
Jan 11, 2016 12:22:06 AM DEBUG getAPIversion called
Jan 11, 2016 12:22:06 AM DEBUG events
Jan 11, 2016 12:22:06 AM DEBUG Config URL for digits is:http://
Folks, my push server is down - I am on travel till 17th of Jan - not quite sure what happened, but till then you won't get push notifications on your phone in the background - sorry about that. Its supposed to restart but hasn't
@g4dge are you sure you have installed the SSL certificates on the phone - the same one that zmeventserver uses?
There is something wrong in your configuration
{"serverName":"Behemoth","username":"","password":"","url":"http://","apiurl":"http:///api","eventServer":"wss://","maxMontage":"10","streamingurl":"http:///cgi-
Can you re-check what you have entered? The logs should show http://<server>/
and wss://<server>:9000/
instead of null strings
Thanks for the continued feedback and support on this issue...
I'd not previously seen this guide before (https://github.com/pliablepixels/zmNinja/blob/master/docs/SSL-Configuration.md#install-certificates-cer-file-in-yout-phone), might be useful to link to it from your event server readme.
I'm not using SSL, nor was I using authentication between my desktop clients and ZM, since I've got it all behind a VPN and firewall. I've switched on authentication, and generated the keys as that was mentioned on eventserver readme (https://github.com/pliablepixels/zmeventserver/blob/master/README.md) - this was based on your comment - If you are not already using SSL for ZoneMinder and don't have certificates, generating them is as easy as: - I admit I just spammed return to get these created using default values.
I've attached logs from today, as well as some screenshots from the app. Looks like I've got a registrationid, which is something I've not seen previously.
Jan 11, 2016 11:39:24 AM DEBUG DataModel/setLogin: writing {"serverName":"Behemoth","username":"
Okay so that's the problem
The event server uses SSL (WSS == Web Sockets Secure/SSL) so you need to have the certificates both generated at the event server and installed in the phone. I'll add the install to phone part to the readme
When generating the certificate its very important to make sure the "common name" is the same server hostname or IP you will use. In your case its 10.1.3
Once you install the certificate in your phone you should be able to connect
The "registration ID" is a push notification id - it still shows you can't connect to your event server.
Thank you very much, I'll give it a try and report back later today!
Hey,,,
So regenerated the key, and restarted both apache and zoneminder. Got the following once I fired up the app.
Jan 11 22:03:24 behemoth zmeventnotification[10829]: INF [got a websocket connection from ::ffff:10.1.1.19 (0) active connections] Jan 11 22:03:24 behemoth zmeventnotification[10829]: INF [Websockets: New Connection Handshake requested from ::ffff:10.1.1.19:52930 state=pending auth] Jan 11 22:03:25 behemoth zmeventnotification[10829]: INF [Correct authentication provided by ::ffff:10.1.1.19] Jan 11 22:03:25 behemoth zmeventnotification[10829]: INF [Storing token ...wkZR5vq-vw,monlist:-1,intlist:-1,pushstate:disabled] Jan 11 22:03:25 behemoth zmeventnotification[10829]: INF [Pushproxy registration success ] Jan 11 22:03:25 behemoth zmeventnotification[10829]: INF [Storing token ...wkZR5vq-vw,monlist:-1,intlist:-1,pushstate:disabled] Jan 11 22:03:26 behemoth zmeventnotification[10829]: INF [Pushproxy registration success ] Jan 11 22:03:40 behemoth zmeventnotification[10829]: INF [Contrl: Storing token ...wkZR5vq-vw,monlist:3,intlist:60,pushstate:disabled] Jan 11 22:03:40 behemoth zmeventnotification[10829]: INF [Pushproxy registration success ]
Then forced an alert...
Jan 11 22:06:28 behemoth zmeventnotification[10829]: INF [New event 479 reported for HD-Feed] Jan 11 22:06:28 behemoth zmeventnotification[10829]: INF [Broadcasting new events to all 1 websocket clients] Jan 11 22:06:29 behemoth zmeventnotification[10829]: INF [Checking alarm rules for ::ffff:10.1.1.19:52930 token ending in:...wkZR5vq-vw] Jan 11 22:06:29 behemoth zmeventnotification[10829]: INF [Monitor 3 event: last time not found, so sending] Jan 11 22:06:29 behemoth zmeventnotification[10829]: INF [::ffff:10.1.1.19-sending over websockets] Jan 11 22:07:08 behemoth zmeventnotification[10829]: INF [Total event client connections: 1] Jan 11 22:07:08 behemoth zmeventnotification[10829]: INF [Reloading Monitors...] Jan 11 22:07:08 behemoth zmeventnotification[10829]: INF [Loading monitors]
Now, I've yet to recieve anything to my phone, but then I'm guessing that's because your push proxy is down.
Hopefully this is a clean bill of health, could you cast your eye and let me know if it looks good.
Once again thank you very much for all your assistance through this, and making this excellent app and tool!
Cheers
Rob
Awesome, you are almost there. My push proxy is up again.
Jan 11 22:03:40 behemoth zmeventnotification[10829]: INF [Contrl: Storing token ...wkZR5vq-vw,monlist:3,intlist:60,pushstate:disabled]
This log says your phone has not enabled push notifications. Please ensure that a) you have not blocked push notifications for this app in android b) You have the "use only web sockets" toggle button to OFF on event server
When you see a log in the event server that says "push state:enabled" you are all set
Hi There,
I've now got everything working, and I've tested a few scenarios upon my phone to confirm that it comes through. Thanks very much for your guidance and support in getting this in place.
One slight request if I may be so cheeky -
Have you heard of pushover? It's a free(ish - paid app / 7,500 messages per month limit).
https://pushover.net/faq#library-perl
I think that this would integrate fairly easy with zmeventnotification, and could be a third method of sending alerts. for those that don't wish to run WSS.
As I see it there are the following benefits.
+Simple user config (No WSS, or putting SSL keys onto phone) +No requirement to open firewall ports / setup port forwarding +Push notifications are saved to phone, and can be reviewed (as opposed to just seeing the latest) +Allows for customisation of alert tone, and severity +Alerts can be grouped (based on setting up an API within an individuals pushover account) +You're push proxy won't be hammered as hard (and chatty users have an option to buy more pushes)
-I don't think that this would automatically fire up zmNinja (however it would certainly alert me to needing to go there).
If you could consider this it would be very much appreciated! However appreciate how busy you must be, especially given the time that you share with your users.
Keep up the good work!
Best wishes
Rob
Thanks Rob - glad you have it resolved. Yes, I am aware of these 3rd party push servers - hopefully sometime in the future :)
Continuation of https://github.com/pliablepixels/zmeventserver/issues/5
@g4dge reports that zmNinja cannot connect to zmeventserver
@g4dge, based on your logs, please check the following:
a) That you have configured your WSS URL correctly - the logs strip the server name out for privacy, so I don't know what you have there
b) That you have installed the SSL certificate in the phone - other wise it won't be able to connect