No notifications, websocket disconnects

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

No notifications, websocket disconnects

Post by torkilt »

Just bought zmninja and everything seems to work except for notifications. I also installed the desktop version to test. Desktop client is on LAN, android phone connected to LAN with wireguard. I've tried to disable all SSL just to get it to work.

Output from zmeventnotification.pl foreground:

Code: Select all

Configuration (read /etc/zm/zmeventnotification.ini):

Secrets file.......................... /etc/zm/secrets.ini
Base data path........................./var/lib/zmeventnotification
Restart interval (secs)............... (undefined)

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

Auth enabled ......................... no
Auth timeout ......................... 20

Use FCM .............................. yes
FCM API key .......................... (defined)
Token file ........................... /var/lib/zmeventnotification/push/tokens.txt

Use MQTT ............................. no
MQTT Server .......................... 192.168.40.120 # openhab.localdomain
MQTT Username ........................ (undefined)
MQTT Password ........................ (undefined)
MQTT Tick Interval ................... 15

SSL enabled .......................... no
SSL cert file ........................ /etc/zm/apache2/ssl/zoneminder.crt
SSL key file ......................... /etc/zm/apache2/ssl/zoneminder.key

Verbose .............................. yes
Read alarm cause ..................... yes
Tag alarm event id ................... yes
Use custom notification sound ........ no
Send event end notification............yes

Use Hooks............................. 1
Hook Script on Event Start ........... '/var/lib/zmeventnotification/bin/zm_event_start.sh'
Hook Script on Event End.............. '/var/lib/zmeventnotification/bin/zm_event_end.sh'

Notify on Event Start (hook success).. all
Notify on Event Start (hook fail)..... none
Notify on Event End (hook success)... fcm,web
Notify on Event End (hook fail)...... none

Notify End only if Start success......yes

Use Hook Description........... yes
Keep frame match type.......... yes
Skipped monitors............... (undefined)
Store Frame in ZM...............yes


Picture URL ................... https://zoneminder.localdomain/zm/index.php?view=image&eid=EVENTID&fid=snapshot&width=1024
Include picture................ yes
Picture username .............. zmuser
Picture password .............. (defined)

CONSOLE INFO:2020-01-19,19:37:49 PARENT: Push enabled via FCM
CONSOLE INFO:2020-01-19,19:37:49 PARENT: MQTT Disabled
CONSOLE INFO:2020-01-19,19:37:49 PARENT: You are running version: 5.4
CONSOLE DEBUG:2020-01-19,19:37:49 PARENT: Started with: perl:/usr/bin/perl and command:/usr/bin/zmeventnotification.pl
CONSOLE DEBUG:2020-01-19,19:37:49 PARENT: ES invoked manually. Will handle restarts ourselves
CONSOLE WARNING:2020-01-19,19:37:49 PARENT: WARNING: SSL is disabled, which means all traffic will be unencrypted
CONSOLE DEBUG:2020-01-19,19:37:49 PARENT: Parent<--Child pipe ready
CONSOLE INFO:2020-01-19,19:37:49 PARENT: Event Notification daemon v 5.4 starting

CONSOLE INFO:2020-01-19,19:37:49 PARENT: Initializing FCM tokens...
CONSOLE INFO:2020-01-19,19:37:49 PARENT: Total event client connections: 0

CONSOLE INFO:2020-01-19,19:37:49 PARENT: Reloading Monitors...

CONSOLE INFO:2020-01-19,19:37:49 PARENT: Re-loading monitors, emptying needsReload() list

CONSOLE DEBUG:2020-01-19,19:37:49 PARENT: checkEvents() new events found=0
CONSOLE INFO:2020-01-19,19:37:49 PARENT: Secure WS is disabled...
CONSOLE INFO:2020-01-19,19:37:49 PARENT: Web Socket Event Server listening on port 9001

CONSOLE DEBUG:2020-01-19,19:37:54 PARENT: ---------->Tick START<--------------
CONSOLE DEBUG:2020-01-19,19:37:54 PARENT: After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
CONSOLE DEBUG:2020-01-19,19:37:54 PARENT: Finished processJobs()
CONSOLE INFO:2020-01-19,19:37:54 PARENT: There are 0 active child forks...
CONSOLE DEBUG:2020-01-19,19:37:54 PARENT: checkEvents() new events found=0
CONSOLE INFO:2020-01-19,19:37:54 PARENT: There are 0 new Events to process
CONSOLE DEBUG:2020-01-19,19:37:54 PARENT: ---------->Tick END<--------------
CONSOLE DEBUG:2020-01-19,19:37:59 PARENT: ---------->Tick START<--------------
CONSOLE DEBUG:2020-01-19,19:37:59 PARENT: After tick: TOTAL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
CONSOLE DEBUG:2020-01-19,19:37:59 PARENT: Finished processJobs()
CONSOLE INFO:2020-01-19,19:37:59 PARENT: There are 0 active child forks...
CONSOLE DEBUG:2020-01-19,19:37:59 PARENT: checkEvents() new events found=0
CONSOLE INFO:2020-01-19,19:37:59 PARENT: There are 0 new Events to process
CONSOLE DEBUG:2020-01-19,19:37:59 PARENT: ---------->Tick END<--------------
CONSOLE DEBUG:2020-01-19,19:38:00 PARENT: ---------->onConnect START<--------------
CONSOLE INFO:2020-01-19,19:38:00 PARENT: got a websocket connection from 192.168.40.138 (0) active connections
CONSOLE DEBUG:2020-01-19,19:38:00 PARENT: ---------->onConnect STOP<--------------
CONSOLE DEBUG:2020-01-19,19:38:00 PARENT: ---------->onConnect:disconnect START<--------------
CONSOLE INFO:2020-01-19,19:38:00 PARENT: Websocket remotely disconnected from 192.168.40.138
CONSOLE DEBUG:2020-01-19,19:38:00 PARENT: ---------->onConnect:disconnect END<--------------
CONSOLE DEBUG:2020-01-19,19:38:04 PARENT: ---------->Tick START<--------------
[SNIP]
Log from desktop client:

Code: Select all

Jan 19, 2020 07:44:40 PM DEBUG EventSever: Using browser websockets...
Jan 19, 2020 07:44:40 PM INFO EventSever: Initializing Websocket with URL wss://192.168.40.138:9001
Jan 19, 2020 07:44:30 PM INFO EventSever: Will try to reconnect in 10 sec..
Jan 19, 2020 07:44:27 PM DEBUG EventSever: Using browser websockets...
Jan 19, 2020 07:44:27 PM INFO EventSever: Initializing Websocket with URL wss://192.168.40.138:9001
Jan 19, 2020 07:44:17 PM INFO EventSever: Will try to reconnect in 10 sec..
Jan 19, 2020 07:44:13 PM DEBUG EventSever: Using browser websockets...
Jan 19, 2020 07:44:13 PM INFO EventSever: Initializing Websocket with URL wss://192.168.40.138:9001
I can post full logs if need be but the same connect/disconnect just seems to repeat over and over.

Suggestions?

Thanks,

Torkil
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: No notifications, websocket disconnects

Post by torkilt »

Ah. ws: and not wss: when SSL is disabled. Doh.

Still not getting any notifications though. Not quite sure where to configure "notify filters", if that's the problem?

Code: Select all

CONSOLE INFO:2020-01-19,20:21:04 |----> FORK:Back (2), eid:4182 Not sending over Web as notify filters are on_success:all and on_fail:none
CONSOLE DEBUG:2020-01-19,20:21:04 |----> FORK:Back (2), eid:4182 child finished writing to parent
CONSOLE INFO:2020-01-19,20:21:04 |----> FORK:Back (2), eid:4182 Checking alarm rules for 192.168.40.6:35855, token ending in:...zr3DmoY3Ld
CONSOLE INFO:2020-01-19,20:21:04 |----> FORK:Back (2), eid:4182 Monitor 2 event: last time not found, so should send
CONSOLE DEBUG:2020-01-19,20:21:04 |----> FORK:Back (2), eid:4182 shouldSendEventToConn returned true, so calling sendEvent
CONSOLE DEBUG:2020-01-19,20:21:04 |----> FORK:Back (2), eid:4182 isAllowedChannel: got type:event_start resCode:1
CONSOLE INFO:2020-01-19,20:21:04 |----> FORK:Back (2), eid:4182 Not sending over FCM as notify filters are on_success:all and on_fail:none
Thanks,

Torkil
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: No notifications, websocket disconnects

Post by asker »

Your logs show that you have hooks enabled and the return code was 1 (resCode) that means object detection failed. Given your notify on fail is none, it did not send out notifications.
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
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: No notifications, websocket disconnects

Post by torkilt »

asker wrote: Mon Jan 20, 2020 3:24 am Your logs show that you have hooks enabled and the return code was 1 (resCode) that means object detection failed. Given your notify on fail is none, it did not send out notifications.
Thanks, I think I got it now. I'm running MOCORD so I'll only get event END notifications. I changed
EVENT_CLOSE_MODE to alarm.

Mvh.

Torkil
Post Reply