ZMS Event stream controls

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

ZMS Event stream controls

Post by BananaPukeh »

When opening the /zms stream for a monitor, you can play events. But in the ZM console there are all kind of controls where the event stream can be manipulated with. Is there some kind of way to manipulate the stream from the /zms url like in the ZM console?
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: ZMS Event stream controls

Post by asker »

BananaPukeh wrote:When opening the /zms stream for a monitor, you can play events. But in the ZM console there are all kind of controls where the event stream can be manipulated with. Is there some kind of way to manipulate the stream from the /zms url like in the ZM console?
There are certain things you can control via the URL and certain things you can control by sending POST requests to zms.

To get you started:

1) As of today, a new zms is spawned for each incoming connection (to the best of my knowledge)
2) always make sure you use a unique connkey in the URLs that involve zms - you need the connkey to send it commands. If you don't generate a connkey, one is generated but you don't know about it and you can't talk to it (the zms-NNNNNN socket ids that people keep reporting about missing streams etc - each NNNN is a connkey)

read this file to understand how to send POST requests https://github.com/ZoneMinder/ZoneMinde ... s/event.js and this file to get a list of commands https://github.com/ZoneMinder/ZoneMinde ... ream.h#L60
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
BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

Re: ZMS Event stream controls

Post by BananaPukeh »

Ah thanks! Great explanation
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: ZMS Event stream controls

Post by asker »

BTW what are you building? I'm interested to see what people are doing with the APIs
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
BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

Re: ZMS Event stream controls

Post by BananaPukeh »

I'm developing a native iOS app for zoneminder, I'il let you guys know when it's ready :)
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: ZMS Event stream controls

Post by asker »

awesome - look forward to it. I'd also recommend you post to the Mobile Apps forum if you are developing a mobile app - its meant for this purpose as your questions are not really 1.29 related
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
BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

Re: ZMS Event stream controls

Post by BananaPukeh »

Hmm, can't seem to get it working.

I'm calling this url to start the event playing
note: i've added the connkey

Code: Select all

/zm/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=100&user=admin&pass=xxxx&connkey=1123
than I want to pause that stream, so I send command 1 in a POST request

Code: Select all

/zm/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=100&user=admin&pass=xxxx&connkey=1123&command=1
But nothing happens?
BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

Re: ZMS Event stream controls

Post by BananaPukeh »

Than I will make my future posts in Mobile apps ;)
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: ZMS Event stream controls

Post by asker »

The invocation is wrong - please see the code I pointed to and trace through the invocations in streamReq.send
the view/request/connkey and auth need to be inside the data part of the POST not the url.

Some other notes: the pause is unreliable, once you do get it working :-D ZMS has many issues
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
Post Reply