simplest alarm visualization possible -4 LEDs on serial port

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

simplest alarm visualization possible -4 LEDs on serial port

Post 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"...
--
Best Regards and sorry for my poor english...
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post 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..
--
Best Regards and sorry for my poor english...
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post 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
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post 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%.
--
Best Regards and sorry for my poor english...
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

This sounds very interesting. Keep us posted!

Phil
breizhbug
Posts: 61
Joined: Wed May 10, 2006 10:59 am
Location: France

Post 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
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Post 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.
v1.25.0 + Ubuntu Linux 12.04 Server
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Post by robi »

Any news about this project?
v1.25.0 + Ubuntu Linux 12.04 Server
ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post 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. .
Last edited by ktheking on Mon Jan 14, 2008 2:04 pm, edited 1 time in total.
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Post by robi »

I'd be interested in reverse direction communication also: a couple of push-buttons to change ZM's state.
v1.25.0 + Ubuntu Linux 12.04 Server
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Post 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
v1.25.0 + Ubuntu Linux 12.04 Server
ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post 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/
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Post 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.
v1.25.0 + Ubuntu Linux 12.04 Server
ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post 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.
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Post 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.
v1.25.0 + Ubuntu Linux 12.04 Server
Post Reply