ZMS Event stream controls

Discussion topics related to mobile applications for ZoneMinder
Post Reply
BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

ZMS Event stream controls

Post by BananaPukeh » Tue Feb 09, 2016 8:42 pm

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: 1396
Joined: Sun Mar 01, 2015 12:12 pm

Re: ZMS Event stream controls

Post by asker » Tue Feb 09, 2016 8:53 pm

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
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

Re: ZMS Event stream controls

Post by BananaPukeh » Tue Feb 09, 2016 8:56 pm

Ah thanks! Great explanation

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

Re: ZMS Event stream controls

Post by asker » Tue Feb 09, 2016 8:58 pm

BTW what are you building? I'm interested to see what people are doing with the APIs
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

Re: ZMS Event stream controls

Post by BananaPukeh » Tue Feb 09, 2016 9:04 pm

I'm developing a native iOS app for zoneminder, I'il let you guys know when it's ready :)

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

Re: ZMS Event stream controls

Post by asker » Tue Feb 09, 2016 9:07 pm

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
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

BananaPukeh
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

Re: ZMS Event stream controls

Post by BananaPukeh » Tue Feb 09, 2016 10:34 pm

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 » Tue Feb 09, 2016 10:35 pm

Than I will make my future posts in Mobile apps ;)

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

Re: ZMS Event stream controls

Post by asker » Wed Feb 10, 2016 12:42 am

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
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest