On Zonemineder:
On ZM is necessary to enable the external trigger; it is possible to start recording on external event using serial comunication, network comunication or file in a folder "comunication" (ZM check for a file in a specific folder); I have chosen the networdk comunication.
1 Enable external trigger:
Edit the file zmtrigger.pl:
Check for the some comunication system row definition and comment the not used (put # at the start of the lines):
[cut]
my @connections;
push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan1", channel=>ZoneMinder::Trigger::Channel::Inet->new( port=>6802 ), mode=>"rw" ) );
#push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan2", channel=>ZoneMinder::Trigger::Channel::Unix->new( path=>ZM_PATH_SOCKS.'/zmtrigger.sock' ), mode=>"rw" ) );
#push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan3", channel=>ZoneMinder::Trigger::Channel::File->new( path=>'/tmp/zmtrigger.out' ), mode=>"w" ) );
#push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan4", channel=>ZoneMinder::Trigger::Channel::Serial->new( path=>'/dev/ttyS0' ), mode=>"rw" ) );
[cut]
This procedure enable ZM to listen on udp port 6082 for external command.... (in case you can change this port...)
From the web interface of ZM:
2 Take a camera, put "Nodect" for function type (instead of motion detection, recording,...)
3 In the ZM options (System Page/TAB) put the check on "OPT_TRIGGERS" (enable zm to check for external triggers)
Ok, zm configuration is finish!; now on arduino...
Is necessary to create a program that connect ZM on port 6802 (UPD using ethernet) and send the command...
Command format:
6|on+60|255|Arduino alarm
Synstax:
6 is the ID (in the database of ZM), you can find it on the web interface of ZM moving the mouse on the camera (in the link you can see the ID; eg: ...../index.php?view=watch&mid=6)
on+60 Start recording and stop it after 60 seconds
255 the amount of the point for the motion detection (fixed to 255; is the top)
Arduino allarm comment of the alarm
All parameters must be separate with pipe char (|)
another eg
6|on
Start to recording without end (is necessary to send the command 6|off for stop the recording)
Send this type of command for each camera needed (changing the ID of the camera)
At the moment I cant send a sample of the code of arduino... but using the sample in the ide is very simple to implement; in my case a pin of the arduino is conneceted to a switch, when I close it, ZM start to recording...
Pasted from <http://forum.arduino.cc/index.php?topic=88331.0;wap2>
#!/bin/bash
echo Content-type: text/plain
echo "$1|on+10|255|AMotion" >/dev/tcp/localhost/6802
Pasted from <http://www.zoneminder.com/forums/viewtopic.php?f=21&t=19540>
I have some cameras that are on 3G modems and I have limited data traffic so I would like to only record on external events (zmtrigger or forceAlarm url)
Code:
index.php?view=request&request=alarm&id=1&command=forceAlarm
which works fine with "Nodect" but I see that ZM always stream from the camera, and I would like ZM to only start stream from the camera when i trigger event or when i open the monitor.
If I switch the mode to "None" for the camera i see that ZM stop stream from the camera but then i would need to switch this mode all the time and i would rather see that i can just open the montor to get live feed.
Is this possible?
Pasted from <http://www.zoneminder.com/forums/viewtopic.php?f=29&t=21623&p=82132&hilit=zmtrigger#p82132>
Hey Nathan,i have done something similar for a remote web camera I built. I have the remote camera ftp to my server and upload a new image every half hour, and the trigger an alarm on zoneminder so that it reads in the new image. This basically just uses zoneminder as an archiving tool for timelapse photography.Below are my notes when i first started looking at, but from memory, you first get zoneminder to enable external triggers (and create a listening tcp socket). From there you can send a string to that socket that enables and disables the alarm.Anyway, the notes below and links to the forums should get you started.