I just startet with zoneminder and installed the "zmeventserver" to trigger an event externally by my doorbell.
To test if I can trigger an event, i used curl. I want to get an "authentication successful" and then try further.
But still no success.
I installed zmeventserver like shown here:
https://github.com/pliablepixels/zmeventserver
zmeventserver is on and running:
root@zmserver# zmdc.pl status zmeventnotification.pl
'zmeventnotification.pl' running since 17/09/06 11:47:12, pid = 4897
zmeventserver is logging out to zoneminder-log, looks fine:
2017-09-06 16:52:13.972210 zmeventnotification 4897 INF Loading monitors zmeventnotification.pl
2017-09-06 16:52:13.965940 zmeventnotification 4897 INF Reloading Monitors... zmeventnotification.pl
2017-09-06 16:52:13.958040 zmeventnotification 4897 INF Total event client connections: 0 zmeventnotification.pl
Syslog is not showing any errors:
root@zmserver:/usr/share/zoneminder/www/api# cat /var/log/syslog | grep zmevent
Sep 6 16:52:13 zmserver zmeventnotification[4897]: INF [Total event client connections: 0]
Sep 6 16:52:13 zmserver zmeventnotification[4897]: INF [Reloading Monitors...]
Sep 6 16:52:13 zmserver zmeventnotification[4897]: INF [Loading monitors]
Sep 6 16:57:18 zmserver zmeventnotification[4897]: INF [Total event client connections: 0]
Sep 6 16:57:18 zmserver zmeventnotification[4897]: INF [Reloading Monitors...]
Sep 6 16:57:18 zmserver zmeventnotification[4897]: INF [Loading monitors]
Here an Example where I tried to authenticate with curl:
peter@zmserver:~/$ curl -X POST -d '{"event":"auth","data":{"user":"peter","password":"petersPW"}}' --header "Content-Type: application/json" http://192.168.178.120:9000/
curl: (52) Empty reply from server
My Problem is that I dont get any reply from the server. I always get "curl: (52) Empty reply from server". I expected something like this:
{"event":"auth", "type":"", "version":"0.9","status":"Success","reason":""}
I tried another way with nodejs, but Im so far not very familiar with it, so I stopped trying this for now.
Can someone give me some working example with curl or some hint what Im doing wrong here?
Im open for different solutions but please give me some working examples / commands / code I can try.
What I really want to do in the End is the following:
1. DoorBell (2n entrycom Verso) is pressed
2. Doorbell sends http-Request
3. ZM-Event is triggered
4. ZM pushes Event to zmNinja on mobileDevice
5. zmNinja popups FrontDoor Camera-Steam
zmeventserver - working Example needed
Re: zmeventserver - working Example needed
zmeventserver uses websockets, so you can't use traditional HTTP/S access to interact with it. There are examples on how to use curl with websockets by upgrading the connection, but I found using wscat much simpler.
For example, here is how I interact with my zmeventserver (WSS - secure connection)
The "-n" is to ignore cert checks.
For example, here is how I interact with my zmeventserver (WSS - secure connection)
Code: Select all
wscat -c wss://myzmeventserver.domain:9000 -n
connected (press CTRL+C to quit)
> {"event":"auth","data":{"user":"admin","password":"xxxx"}}
< {"reason":"","status":"Success","type":"","event":"auth","version":"0.93"}
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
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
Re: zmeventserver - working Example needed
Hello asker,
thank your for your answer, it helped me very much!
Greets Peter
thank your for your answer, it helped me very much!
Greets Peter