Trying to get zmeventnotification working with ZM 1.30.4 and Debian Stretch

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
SkippyDo
Posts: 219
Joined: Mon Nov 20, 2017 6:49 pm

Trying to get zmeventnotification working with ZM 1.30.4 and Debian Stretch

Post by SkippyDo »

I'm trying to get just simple push notifications (w/o hooks) working under ZM 1.30.4 on Debian Stretch. (had it, along with hooks, working under ZM 1.32.3 on Debian Sid [overall system was unstable so I reverted back]) As far as I can tell everything seems set up OK, but it's not working.

Using configuration documentation from https://github.com/pliablepixels/zmeventserve. All bits that I can tell are in place.

Here's output when I run zmeventserver.pl:
Configuration (read /etc/zmeventnotification.ini):

Port .......................... 9000
Address ....................... [::]
Event check interval .......... 5
Monitor reload interval ....... 300

Auth enabled .................. true
Auth timeout .................. 20

Use FCM ....................... true
FCM API key ................... (defined)
Token file .................... /etc/private/tokens.txt

Use MQTT .......................false
MQTT Server ....................127.0.0.1
MQTT Username ..................(undefined)
MQTT Password ..................(undefined)

SSL enabled ................... true
SSL cert file ................. /etc/apache2/ssl/myhostname'sFQDN/zoneminder.crt
SSL key file .................. /etc/apache2/ssl/myhostname'sFQDN/zoneminder.key

Verbose ....................... true
Read alarm cause .............. false
Tag alarm event id ............ true
Use custom notification sound . false

Hook .......................... (undefined)
Use Hook Description........... false

Picture URL ................... https://server/zm/index.php?view=image& ... mypassword
Include picture................ true

2019-02-17,19:47:14 Push enabled via FCM
2019-02-17,19:47:14 MQTT Disabled
2019-02-17,19:47:14 You are running version: 2.6
2019-02-17,19:47:14 Parent<--Child pipe ready
2019-02-17,19:47:14 Event Notification daemon v 2.6 starting

2019-02-17,19:47:14 Initializing FCM tokens...
2019-02-17,19:47:14 Total event client connections: 0

2019-02-17,19:47:14 Reloading Monitors...

2019-02-17,19:47:14 Loading monitors

2019-02-17,19:47:14 checkEvents() events found=0
2019-02-17,19:47:14 About to start listening to socket
2019-02-17,19:47:14 Secure WS(WSS) is enabled...
2019-02-17,19:47:14 Web Socket Event Server listening on port 9000

2019-02-17,19:47:19 ---------->Tick START<--------------
2019-02-17,19:47:19 After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
2019-02-17,19:47:19 Empty job queue
2019-02-17,19:47:19 checkEvents() events found=0
2019-02-17,19:47:19 ---------->Tick END<--------------
2019-02-17,19:47:24 ---------->Tick START<--------------
2019-02-17,19:47:24 After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
2019-02-17,19:47:24 Empty job queue
2019-02-17,19:47:24 checkEvents() events found=0
2019-02-17,19:47:24 ---------->Tick END<--------------
2019-02-17,19:47:29 ---------->Tick START<--------------
2019-02-17,19:47:29 After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
2019-02-17,19:47:29 Empty job queue
2019-02-17,19:47:29 checkEvents() events found=0
2019-02-17,19:47:29 ---------->Tick END<--------------
2019-02-17,19:47:34 ---------->Tick START<--------------
2019-02-17,19:47:34 After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
2019-02-17,19:47:34 Empty job queue
2019-02-17,19:47:34 checkEvents() events found=0
2019-02-17,19:47:34 ---------->Tick END<--------------
2019-02-17,19:47:39 ---------->Tick START<--------------
2019-02-17,19:47:39 After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
2019-02-17,19:47:39 Empty job queue
2019-02-17,19:47:39 checkEvents() events found=0
2019-02-17,19:47:39 ---------->Tick END<--------------
2019-02-17,19:47:44 ---------->Tick START<--------------
2019-02-17,19:47:44 After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
2019-02-17,19:47:44 Empty job queue
2019-02-17,19:47:44 checkEvents() events found=0
2019-02-17,19:47:44 ---------->Tick END<--------------
2019-02-17,19:47:49 ---------->Tick START<--------------
2019-02-17,19:47:49 After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
2019-02-17,19:47:49 Empty job queue
2019-02-17,19:47:49 checkEvents() events found=0
2019-02-17,19:47:49 ---------->Tick END<--------------
2019-02-17,19:47:51 ---------->onConnect START<--------------
2019-02-17,19:47:51 got a websocket connection from ::ffff:192.168.254.39 (0) active connections
2019-02-17,19:47:51 ---------->onConnect STOP<--------------
2019-02-17,19:47:51 ---------->onConnect:handshake START<--------------
2019-02-17,19:47:51 Websockets: New Connection Handshake requested from ::ffff:192.168.254.39:44445 state=pending auth, id=1550461671.20396
2019-02-17,19:47:51 ---------->onConnect:handshake END<--------------
2019-02-17,19:47:51 ---------->onConnect msg START<--------------
2019-02-17,19:47:51 Raw incoming message: {"event":"auth","data":{"user":"myzmacct","password":"myzmpass","monlist":"1,2,3,4","intlist":"0,0,0,0"}}
2019-02-17,19:47:51 Correct authentication provided by ::ffff:192.168.254.39
2019-02-17,19:47:51 ---------->onConnect msg STOP<--------------
2019-02-17,19:47:51 ---------->onConnect msg START<--------------
2019-02-17,19:47:51 Raw incoming message: {"event":"control","data":{"type":"filter","monlist":"1,2,3,4","intlist":"0,0,0,0","token":""}}
2019-02-17,19:47:51 Contrl: Storing token ...,monlist:1,2,3,4,intlist:0,0,0,0,pushstate:

2019-02-17,19:47:51 Not saving, no token. Desktop?

I re-run while my zmNinja app is connected and I get/see:
2019-02-17,19:59:28 -->checkNewEvents: Connection 1: ID->1550462368.97673 IP->(none) Token->:...xUWBMmNHip Plat:android Push:disabled
Not sure why push is disabled.

Interestingly if I background zmNinja I see the websocket being dropped on the server end even though I have "exit app in background" disabled.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Trying to get zmeventnotification working with ZM 1.30.4 and Debian Stretch

Post by asker »

Not sure why push is disabled.
zmNinja->Settings->EventServer. Make sure "only use web sockets" is not enabled

Interestingly if I background zmNinja I see the websocket being dropped on the server end even though I have "exit app in background" disabled.
I did not realize I still had that option in the UI. zmNinja always exits (couldn't figure out how to terminate streams inside the browser in a mobile app that kept leaking data)
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
SkippyDo
Posts: 219
Joined: Mon Nov 20, 2017 6:49 pm

Re: Trying to get zmeventnotification working with ZM 1.30.4 and Debian Stretch

Post by SkippyDo »

Awesome, that did the trick. Thanks!

Curious, I thought that this WAS supposed to be using web sockets. It's using FCM? I'm totally not up on any of this though.

Oh! I have verified that alerts (push notifications) DO come through when zmNinja is backgrounded.

Bottom line: All is working as well as can be expected and I anxiously await being able to run the detection hooks on a stable combo of newer releases of ZM and Debian.

Again, many thanks!
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Trying to get zmeventnotification working with ZM 1.30.4 and Debian Stretch

Post by asker »

Curious, I thought that this WAS supposed to be using web sockets. It's using FCM? I'm totally not up on any of this though.
Websockets are only used in foreground mode. When the app is not running you need FCM (mobile only, which is also why desktops only get notifications when running - they don't support FCM)
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
SkippyDo
Posts: 219
Joined: Mon Nov 20, 2017 6:49 pm

Re: Trying to get zmeventnotification working with ZM 1.30.4 and Debian Stretch

Post by SkippyDo »

Thanks for the response!

There's so many different bits in this entire system. It can be a bit daunting. I'm kind of a masochist, so I tend to readily get myself in over my head, but I try to learn in the process.

Not that I needed it, but, and it says so in the code, I wasn't able to get an index image to get pushed (pulled down the latest index.php and that didn't want to work with 1.30.4). Gave it stab. Anyway, again, it's working just as one could hope for under ZM 1.30.4.
Post Reply