x10 triggering

Forum for questions and support relating to the 1.24.x releases only.
Locked
carramrod
Posts: 6
Joined: Sat Feb 19, 2011 1:06 am

x10 triggering

Post by carramrod »

Hello,

occaisonal reader, first time poster.

Just installed 1.24.2 on FC12 and am successfully using a dlink DSC-920.

I have a basic x10 setup for one light to come on when motion is detected (15 in X10 Output Alarm String). I can fire this light on and off with bottlerocket, but am having a few issues with ZM. Even with the output alarm string being set, and the correct home code and options being set in Options section, everytime I check the X10 trigger under the camera and hit save, when i come back it's unchecked.

What am i missing?

Also if you force an alarm on the camera, I'm assuming it would fire the X10 Trigger, correct?

Thanks in advance!
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

carramrod
Posts: 6
Joined: Sat Feb 19, 2011 1:06 am

Post by carramrod »

did all that, the user is still www-root in FC right?

i'm getting this error when running zmx10.pl:
./zmx10.pl -u 15 -c on
Argument "ON" isn't numeric in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.10.0/X10/ActiveHome.pm line 193, <CLIENT> line 1.

checking the logs provides:

Code: Select all

02/18/2011 23:21:01.409144 zmx10[14903].INF [X10 server starting]
02/18/2011 23:21:33.466889 zmx10[14903].INF [Got event - C15 ON]
02/18/2011 23:22:25.633671 zmx10[14903].ERR [Can't read from shared memory '7a6d0001/1671168': Invalid argument]
02/18/2011 23:22:25.634183 zmx10[14903].ERR [Unable to read 'shared_data:state' from memory for monitor 1]
02/18/2011 23:22:25.636116 zmx10[14903].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
02/18/2011 23:23:31.116053 zmx10[14903].INF [Got event - C15 ON]
02/18/2011 23:24:31.438113 zmx10[14903].INF [Got event - C15 ON]
02/18/2011 23:35:00.062898 zmx10[14903].INF [Got event - C15 ON]
02/18/2011 23:41:00.632969 zmx10[14903].ERR [Can't read from shared memory '7a6d0001/1933312': Invalid argument]
02/18/2011 23:41:00.633525 zmx10[14903].ERR [Unable to read 'shared_data:state' from memory for monitor 1]
02/18/2011 23:41:00.635395 zmx10[14903].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
02/18/2011 23:42:27.483655 zmx10[14903].INF [Got event - C15 ON]
02/18/2011 23:42:27.484487 zmx10[14903].ERR [Invalid command '1']
02/18/2011 23:44:13.386933 zmx10[14903].INF [Got event - C15 ON]
02/19/2011 06:52:19.698249 zmx10[14903].INF [Got event - C15 ON]
02/19/2011 10:16:02.902604 zmx10[14903].ERR [Can't read from shared memory '7a6d0001/1966080': Invalid argument]
02/19/2011 10:16:02.923614 zmx10[14903].ERR [Unable to read 'shared_data:state' from memory for monitor 1]
02/19/2011 10:16:02.925495 zmx10[14903].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
02/19/2011 10:17:22.627790 zmx10[14903].INF [Got event - C15 ON]
02/19/2011 10:20:48.831299 zmx10[14903].INF [Got event - C15 ON]
02/19/2011 10:24:38.599881 zmx10[14903].ERR [Can't read from shared memory '7a6d0001/2326528': Invalid argument]
02/19/2011 10:24:38.600453 zmx10[14903].ERR [Unable to read 'shared_data:state' from memory for monitor 1]
02/19/2011 10:24:38.602496 zmx10[14903].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
02/19/2011 10:31:47.879397 zmx10[3830].INF [X10 server starting]
02/19/2011 10:32:19.933435 zmx10[3830].INF [Got event - C15 ON]
02/19/2011 10:33:24.877370 zmx10[3830].INF [Got event - C15 ON]
02/19/2011 10:43:09.793647 zmx10[3830].ERR [Invalid command 'ON']
02/19/2011 10:44:22.322649 zmx10[3830].INF [Got event - C15 ON]
02/19/2011 10:45:27.498860 zmx10[3830].INF [Got event - C15 ON]
02/19/2011 10:58:12.055645 zmx10[3830].INF [Got event - C15 ON]
What am i doing wrong? I rebooted at 10:30, and you can see, i'm not getting the shared memory error anymore... I can still fire the module with bottlerocket just fine
carramrod
Posts: 6
Joined: Sat Feb 19, 2011 1:06 am

Post by carramrod »

I also realized that zm is firing the x10 command when a forced alarm goes off, as i'm getting the Argument "ON" error in the console.
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

Shared memory is another problem you should try solving that first. conf file for shared memory is under /etc/sysctl i belive search forum "shared memory" will come up.
wkulecz
Posts: 36
Joined: Thu Mar 15, 2007 12:34 pm

Post by wkulecz »

I thought ZM 1.24.2 only supports the CM11A interface, not the RF/transceiver based "firecracker" interface.

I've both the firecracker and CM11A and each works with bottlerocket and heyu software respectively. But it appears the X10 support is horribly broken in the 1.24.2 build in the repos for Ubuntu 10.04 so I gave up on it for now.

You might have to run a filter that launches a scrip to use br or heyu to get X10 to work. I'm trying to learn how to accomplish this as time permits. But X10 is not really reliable enough for anything important -- I've used it for years and know from experience. The proliferation of compact fluorescent lights and large screen TVs hasn't helped :(
Your commitment to Freedom is measured by your tolerance of others doing things you disapprove.
carramrod
Posts: 6
Joined: Sat Feb 19, 2011 1:06 am

Post by carramrod »

kingofkya wrote:Shared memory is another problem you should try solving that first. conf file for shared memory is under /etc/sysctl i belive search forum "shared memory" will come up.
been a long time since i replied, fyi like i said in my previosu posts, shared memory errors were resolved during that reboot, i now get no errors, here's zmx10.log:

Code: Select all

03/05/2011 11:38:19.994360 zmx10[32452].INF [X10 server starting]
03/05/2011 11:38:52.055414 zmx10[32452].INF [Got event - C01 ON]
03/05/2011 11:39:53.655078 zmx10[32452].INF [Got event - C15 ON]
to the poster above me, i did accomplish using and slightly modifying a perl script i found to handle turning it on and off with bottlerocket (see below, use at your own risk). Although this works, this box is supposed to be headless, and the fact that i have to start and let this script run in a terminal, means it's not.

I would like to be able to Disable alarms in zoneminder, and have the option to turn off X10 when it's not needed, but still allow zm to fire alarms and record.

Code: Select all

#!/usr/bin/perl -w

use strict;

use ZoneMinder;

$| = 1;

zmDbgInit( "myscript", level=>0, to_log=>0, to_syslog=>0, to_term=>1 );

my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );

my $sql = "select M.*, max(E.Id) as LastEventId from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Function != 'None' group by (M.Id)";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );

my $res = $sth->execute() or die( "Can't execute '$sql': ".$sth->errstr() );
my @monitors;
while ( my $monitor = $sth->fetchrow_hashref() )
{
    push( @monitors, $monitor );
}

while( 1 )
{
    foreach my $monitor ( @monitors )
    {
        next if ( !zmMemVerify( $monitor ) );
 
        if ( my $last_event_id = zmHasAlarmed( $monitor, $monitor->{LastEventId} ) )
        {
            $monitor->{LastEventId} = $last_event_id;
            print( "Monitor ".$monitor->{Name}." has alarmed\n" );
            #
            # Do your stuff here
            #
		system("br c15 on"); 
	    	sleep(3);
		system("br c15 off"); 
        }
    }
    sleep(1); 

}
carramrod
Posts: 6
Joined: Sat Feb 19, 2011 1:06 am

Post by carramrod »

anyone, anyone, bueller?
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

As far as i know there connected together and cat be seperated like some one said before X10 really is busted. Hopefully it will be fixed i know of few patched for x10 went in but i havent tested it yet.
wkulecz
Posts: 36
Joined: Thu Mar 15, 2007 12:34 pm

Re: x10 triggering

Post by wkulecz »

Thanks for the script, it'll be a big help to me as I don't know much Perl.

You can start the script from a cron job, the @reboot specifier would seem perfect.

What are your permissions on the script?

I'm still a bit fuzzy on how this is supposed to work.
Your commitment to Freedom is measured by your tolerance of others doing things you disapprove.
carramrod
Posts: 6
Joined: Sat Feb 19, 2011 1:06 am

Re: x10 triggering

Post by carramrod »

-rwxrwxr-x 1 blah blah 1143 2011-03-17 23:09 fireX10.pl

make sure you have bottlerocket or other X10 command line utility to fire your on/off in the script. I've also been running it as root in a plain terminal window.

I use this to fire an appliance so terminal works best and is quick to start/stop so i don't scare the crap out of myself in the middle of the night raiding the fridge. :)
Locked