Page 1 of 2

simplest alarm visualization possible -4 LEDs on serial port

Posted: Sat Jul 16, 2005 8:14 am
by krzys31337
Just to show some posiblle external alarming usage:

1) Make a DB9 (serial port) adaptor with cabling like bellow:

Image

2) Configure ZM to execute external script:

Image

3) have /root/alarm.sh set with program like sled from http://www.linuxfocus.org/English/Janua ... e186.shtml.

4) and you will get 2 sets of Green/Red led. The idea is "Green -- OK" , "RED -- motion detected"...

Posted: Sun Jul 17, 2005 7:25 am
by krzys31337
If anyone will be interested: i'm working on simple keyboard interface (proably 3-5 microswitches) connecting to the same serial port.

Any proposal for button functions?

1-"force alarm"
2-"restart zm local interface" (some montage) ???
3-switch to antother montage/cycle option ???
4..
5..

Posted: Sun Jul 17, 2005 9:20 am
by jameswilson
i think a full screen button ie keep pressing full screen and get cam 1 cam 2 etc. a cycle button , a montage button a show status button (current load hard disk use etc etc)

what would be killer is play pause fast forward and rewind
ie press play sytem would play back a montage of the earliest event, press fast forward it would play at 2* press ff again it would play at 5* etc.

James

Posted: Mon Jul 18, 2005 1:27 pm
by krzys31337
Yeap that WOULD BE a killer app.

Right now i'm thinking about something really simple. Maybe even instead of using paraller port (aka lpt) i will do some research on the simplest serila (/dev/ttyS0) port. having 2/4 LEDS and one button for price of nothing (2 leds + one microstich + 1 DB9 + 5 cables) sounds good.

Maybe i will find some 12/16 button general purpouse keyboard (10 digits #* or ABCDEF) and 2/4 digits with dots (like on clocks 88:88).

That will be superb when having may monitors (let's say 9-10) and predefined (ABCDEF) views on localhost.
Also numbers on display could say "C8 90" meaning Camera 8 score 90%.

Posted: Mon Jul 18, 2005 9:55 pm
by zoneminder
This sounds very interesting. Keep us posted!

Phil

Posted: Tue Apr 17, 2007 8:09 pm
by breizhbug
Very interesting post.
We are some needing to connect inputs or output interfaced with ZM.
For example, a button to start / stop recording, a button to shutdown zm server, an entry to launch some script (record all or some cameras in case of external alarm for example)
Also, following modect detection, light a lamp for example or launch a siren... etc.

I read it's simple, just a simple script could do it.

But I never really understand how to do that.
If someone could take few minutes to explain, It would be very mush appreciate.
Thanks
Pascal

Posted: Thu Apr 19, 2007 6:18 am
by robi
krzys31337 wrote:Any proposal for button functions?
1 - State 1
2 - State 2
3 - State 3

And 3 LEDs to feed back the states.

Posted: Sun Sep 16, 2007 3:29 pm
by robi
Any news about this project?

Posted: Fri Dec 21, 2007 7:31 pm
by ktheking
This is very nice ,but usage is minimal.

This can only direct 2 led for 1 com port.
I found something more promising over here :
http://ontrak.net/linux.htm
You can control up to eight leds per com port.
More over here : http://llg.cubic.org/
Please share your findings ...



This one is even better : http://www.arduino.cc/en/Tutorial/ShiftOut

Price is very cheap : 26,18 EUR
http://www.eztronics.nl/webshop/catalog ... 0b1c2e939b

Programming seems very simple (C/C++) : http://www.arduino.cc/en/Main/Software

The set of instructions available (so no need to create machinelanguage yourself):
http://www.arduino.cc/en/Reference/HomePage

And it seems easely extendable (16 leds example here : http://www.arduino.cc/en/Tutorial/ShiftOut

How get Perl to talk to this device (easy):
http://www.windmeadow.com/node/38


This way you can output for example the condition of each and every camera ,the load of the machine ,wether or not the disk is almost full ,if temperature exceed a certain level ,etc. .

Posted: Thu Dec 27, 2007 8:45 pm
by robi
I'd be interested in reverse direction communication also: a couple of push-buttons to change ZM's state.

Posted: Thu Dec 27, 2007 8:55 pm
by robi
ktheking wrote:...something more promising...
Any idea if any of these solutions, in this topic, would work through a Tibbo Serial Device Server?

I wrote some details in the Hardware Queries:
http://www.zoneminder.com/forums/viewto ... 8211#38211

Posted: Sun Dec 30, 2007 7:01 pm
by ktheking
For starting of scripts from a button I first considered using X10 protocol to achieve this. But after having read that X10 close a PC's power supply might generate bad x10 traffic ,I won't go further with this.

My next idea is to use the lirc project.
To my opinion , the easiest way to generate rs-232 code that the pc easely can understand is to use the lirc deamon which watched the com port.
Downside is that you actually need a IR led to transfer the communication ,but if you build this inside a little box , this will be the cheapest easiest way to achive this.

My plan of attack :

1. create lirc serial or usb connector (receiver)
build serial : http://stuff.nekhbet.ro/2006/07/10/make ... or-pc.html
or buy usb or serial : http://www.ir2pc.com/

2. buy tv remote control that can work with lirc
list of supported remote controls : http://lirc.sourceforge.net/remotes/

3. install lirc and irexec on pc
lirc and ubuntu : https://wiki.ubuntu.com/LircHowto
irexec and ubuntu :

4. configure lirc and irexec in order that the whole bunch works,and trigger script when a key is pressed on the remote control.

This is only a raw sketch ,how I would create it.
Once it all works ,all can be integrated inside the pc where the zoneminder resides.
Then you can just make the cabling towards from the buttons mounted in the case towards the tvremote mounted inside the case.

But the whole setup then comes very very cheap ,and rather easy compared to the usage of external microcontrollers.

Simplicity is the key.

However it is yet to be tested but I'm optimistic about it.


example :
http://www.mythpvr.com/mythtv/frontend/ ... power.html


Source :
http://www.lirc.org/

Posted: Sun Dec 30, 2007 7:10 pm
by robi
Don't we need thus 2 serial ports? One for commands and one for signals? Would be elegant to solve everything on one port.

Lirc is a really flexible solution though.

Posted: Sun Dec 30, 2007 9:13 pm
by ktheking
yep ...
Although usb ports can be used as well. Both for the arduino and the lirc.
But if you want to use the solution of 'krzys31337' -the one with the direct single serial port- ,then your limited to 2-3 leds ,with 2 buttons max.

The arduino and lirc solution can offer more then enough buttons and outputs.

Flexibility is needed. And remember that the com port won't be available forever.

Mobo's with com port are getting harder to find.

Posted: Mon Dec 31, 2007 12:49 pm
by robi
One can hook up as many Tibbo serial ports on a network as he wants. All devices are installed inside the OS as virtual ports, while the physical ports are on the network with IP's. Everything is transparent for the programs.