Go Down

Topic: Zoneminder and arduino (Read 6 times) previous topic - next topic


Dear, all

In my home I use a Zoneminder surveillance (linux based security and surveillance opensource system).
I have the necessity to start to recording on some camera in case of external events.... with arduino (+ arduino ethernet) is very simple!
Now I want to share my solution with you.

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):
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" ) );

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

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
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...

Zoneminder info on www.zoneminder.org

I love Opensource!



Hi pier71,

First of all, thank you for sharing this idea.

Can you share the arduino code?


Bookmarked the site - was not familiar with it.

Are there plans to port this ZoneMinder to the Rapspberry Pi Platform? 
Arduino + Pi + few cams  ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Bookmarked the site - was not familiar with it.

Are there plans to port this ZoneMinder to the Rapspberry Pi Platform? 
Arduino + Pi + few cams  ...

I don't know.


Hi to all,

sorry for the delay of the answer.

I will post the arduino code asap (I hope tomorrow...)!!!


Go Up