Runnining a script from filter to trigger serial port error
Posted: Sat Feb 09, 2008 12:11 pm
Hi,
Can someone help me solve this problem I having to run the script listed below, from the command line on the filter window. When I try to run from the terminal, it runs perfectly, but when I try to run it from the filter command line,I get the folowing message from zmfilter.log:
02/09/08 09:50:23.503750 zmfilter[8098].DBG [Checking event 1213]
02/09/08 09:50:23.503902 zmfilter[8098].INF [Executing '/usr/bin/zmserial.pl 1/1213']
02/09/08 09:50:24.433664 zmfilter[8098].DBG [Output: ]
02/09/08 09:50:24.434049 zmfilter[8098].ERR [Command '/usr/bin/zmserial.pl 1/1213' exited with status: 9]
SCRIPT:
#!/usr/bin/perl -w
use strict;
use bytes;
use constant DBG_ID => "zmserial"; # Tag that appears in debug to identify source
use constant DBG_LEVEL => 1; # 0 is errors, warnings and info only, > 0 for debug
use ZoneMinder::Trigger::Connection;
use ZoneMinder::Trigger::Channel::Serial;
my @connections;
push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan4", channel=>ZoneMinder::Trigger::Channel::Serial->new( path=>'/dev/ttyS0' ), mode=>"rw" ) );
use ZoneMinder;
use DBI;
use Data::Dumper;
use POSIX qw( EINTR );
use Time::HiRes qw( usleep );
$| = 1;
$ENV{PATH} = '/bin:/usr/bin';
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
zmDbgInit( DBG_ID, level=>DBG_LEVEL );
zmDbgSetSignal();
foreach my $connection ( @connections )
{
$connection->open();
sleep (5);
}
Thank you,
Daniel Areas
Can someone help me solve this problem I having to run the script listed below, from the command line on the filter window. When I try to run from the terminal, it runs perfectly, but when I try to run it from the filter command line,I get the folowing message from zmfilter.log:
02/09/08 09:50:23.503750 zmfilter[8098].DBG [Checking event 1213]
02/09/08 09:50:23.503902 zmfilter[8098].INF [Executing '/usr/bin/zmserial.pl 1/1213']
02/09/08 09:50:24.433664 zmfilter[8098].DBG [Output: ]
02/09/08 09:50:24.434049 zmfilter[8098].ERR [Command '/usr/bin/zmserial.pl 1/1213' exited with status: 9]
SCRIPT:
#!/usr/bin/perl -w
use strict;
use bytes;
use constant DBG_ID => "zmserial"; # Tag that appears in debug to identify source
use constant DBG_LEVEL => 1; # 0 is errors, warnings and info only, > 0 for debug
use ZoneMinder::Trigger::Connection;
use ZoneMinder::Trigger::Channel::Serial;
my @connections;
push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan4", channel=>ZoneMinder::Trigger::Channel::Serial->new( path=>'/dev/ttyS0' ), mode=>"rw" ) );
use ZoneMinder;
use DBI;
use Data::Dumper;
use POSIX qw( EINTR );
use Time::HiRes qw( usleep );
$| = 1;
$ENV{PATH} = '/bin:/usr/bin';
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
zmDbgInit( DBG_ID, level=>DBG_LEVEL );
zmDbgSetSignal();
foreach my $connection ( @connections )
{
$connection->open();
sleep (5);
}
Thank you,
Daniel Areas