Please login or register.

Login with username, password and session length
Pages: 1 2 [3] 4 5

Author Topic: mochad, X10 CM15A/CM19A Linux device driver  (Read 117581 times)

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #30 on: December 22, 2010, 04:55:26 PM »

Whew! I am glad to hear dim/bright is working.

Non-security/regular wireless motion sensors send "rf a1 on" and "rf a1 off" so they are pretty simple. I use the RF security MS10A which send out different messages. In either case, writing a program to connect to port 1099 then scan for specific events is the basis for creating an app. The apps/ directory in the 0.1.3 tarball has examples in shell and Perl.
Logged

coolguy1233457

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 10
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #31 on: December 23, 2010, 09:07:00 AM »

yes I know it's pretty simple ... what would be best is having a real log file
that use syslog (I use syslog-ng) and logrotate.  I already managed redirecting
the nc output manually in rc.local but that would be better if you
officially integrate a logfile in a future release. 

What are the scripts you developped ? Anything with the door sensors ?
If you want to share, I'd be interested... but anyways, I'll make my own.

Thank you again !
Logged

fastplymouth

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #32 on: December 31, 2010, 11:42:17 AM »


I forgot to add mochad supports RF camera events/commands as well.

RFCAM <camera command>

where <camera command> is one of the following:

CAMUP CAMDOWN CAMLEFT CAMRIGHT CAMCENTER CAMSWEEP CAMPRESET1 CAMPRESET2
CAMPRESET3 CAMPRESET4 CAMPRESET5 CAMPRESET6 CAMPRESET7 CAMPRESET8 CAMPRESET9
CAMEDITPRESET1 CAMEDITPRESET2 CAMEDITPRESET3 CAMEDITPRESET4 CAMEDITPRESET5
CAMEDITPRESET6 CAMEDITPRESET7 CAMEDITPRESET8 CAMEDITPRESET9

I do not own any X10 cameras so this is based on examining USB packets generated by AHP when clicking buttons in the virtual remote control pad for the VK7X module. I am interested in hearing if this actually works.


Hi!

I'm using your driver and it works great, however I have a need to send camera commands to ninja x10 bases as well. I'd like to test the syntax above but how do you address specific ninja bases if you have more than 1 (they have addressable power supplies)? I'll let you know how the testing goes!

Thanks #:)
Logged

pconroy

  • Hero Member
  • *****
  • Helpful Post Rating: 9
  • Posts: 294
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #33 on: January 18, 2011, 07:16:19 PM »

Whew! I am glad to hear dim/bright is working.

Non-security/regular wireless motion sensors send "rf a1 on" and "rf a1 off" so they are pretty simple. I use the RF security MS10A which send out different messages. In either case, writing a program to connect to port 1099 then scan for specific events is the basis for creating an app. The apps/ directory in the 0.1.3 tarball has examples in shell and Perl.


I'm late but I too finally downloaded and installed the code.
Works fine.

I had to blacklist a couple of standard ubuntu modules and I'm not sure you mention that in the docs.
Anyway - thanks for writing this! 

:)
Logged

Cairan

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #34 on: February 21, 2011, 10:44:59 PM »

Anyone working on compiling a package for brcm-2.4 Kamikaze 8.09.2... I've been trying to coax it to work and alas it doesn't quite work out...
Logged

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #35 on: February 22, 2011, 06:02:49 AM »

I had to blacklist a couple of standard ubuntu modules and I'm not sure you mention that in the docs.

Thanks, I was not aware the need for blacklisting. Perhaps it has to do with
the other USB devices in the system and/or the Linux version. Or maybe it has
to do with Ubuntu 10.04 using udev.

If /etc/udev exists, "make install" should copy
udev/91-usb-x10-controllers.rules to /etc/udev/rules.d. This udev rule runs
mochad whenever a cm15a or cm19a is plugged in to the system and on boot.

If the Linux distro does not use udev, "make install" will not touch anything
in /etc so manual editing will be required.

Anyone working on compiling a package for brcm-2.4 Kamikaze 8.09.2... I've been trying to coax it to work and alas it doesn't quite work out...

The following page describes how to get the mochad package Makefile into the
OpenWrt package building system. But I do not know if this works for kamikaze 8.09.2
but it might contain useful information on how to make it work.

http://sourceforge.net/apps/mediawiki/mochad/index.php?title=OpenWrt

Would upgrading to backfire be possible?

mochad/backfire 10.03 on a Buffalo WiFi router and mochad/trunk on a Seagate Dockstar
are known to build and work correctly.

mmauka
Logged

fastplymouth

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #36 on: February 26, 2011, 02:49:11 PM »

Hi mmauka,


I thought I'd report back on my findings after playing with the ninja pan/tilt mounts and mochad.

Based on observations of the decoded signals from the CR14A camera remote, and Dave Houston's breakdown of the x10 camera protocol (http://davehouston.net/cr14a-rf.htm) it would seem that mochad only supports encoding/decoding of commands for housecode N. Switching the CR14A remote to any other housecode and triggering commands results in "Unknown RF camera command" errors.

I'm a .net programmer so C is not my strong suit, but I thought I'd take a whack at adding support for a housecode parameter in the RFCAM command set. Shall I email you a patch or post it here?

Thanks again for a great driver!


Ken
Logged

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #37 on: February 26, 2011, 04:11:36 PM »

Based on observations of the decoded signals from the CR14A camera remote, and Dave Houston's breakdown of the x10 camera protocol (http://davehouston.net/cr14a-rf.htm) it would seem that mochad only supports encoding/decoding of commands for housecode N. Switching the CR14A remote to any other housecode and triggering commands results in "Unknown RF camera command" errors.

I'm a .net programmer so C is not my strong suit, but I thought I'd take a whack at adding support for a housecode parameter in the RFCAM command set. Shall I email you a patch or post it here?


Ken,

Thanks for the rf camera info. I did not know the rf camera protocol supports 16 house codes.

Dave Houston has documented everything required to make this work for all house codes. I'll look at the source today.

Any help would be appreciated. Posting here is fine.

Thanks,
mmauka
Logged

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #38 on: February 26, 2011, 09:57:41 PM »

Ken,

I released mochad 0.1.4 on sourceforge.net. The RFCAM command should work with house codes now. "rfcam D camup" should send a camera pan up command to house D.

Let me know how it works.

http://sourceforge.net/projects/mochad/

mmauka
Logged

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #39 on: March 03, 2011, 04:57:17 AM »

Anyone working on compiling a package for brcm-2.4 Kamikaze 8.09.2... I've been trying to coax it to work and alas it doesn't quite work out...

Other people have inquired so I tried this out. See the page below for details on building mochad for the 8.09 branch.

http://sourceforge.net/apps/mediawiki/mochad/index.php?title=OpenWrt

Warning I do not have hardware to test this so I make no guarantees.

mmauka


Logged

fastplymouth

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #40 on: March 05, 2011, 10:45:07 AM »


I released mochad 0.1.4 on sourceforge.net. The RFCAM command should work with house codes now. "rfcam D camup" should send a camera pan up command to house D.

Let me know how it works.

http://sourceforge.net/projects/mochad/



Ah, looks like you beat me to it :)

I just tried it out and it works perfectly with all of my ninja mounts. Thanks again!!


-Ken
Logged

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #41 on: March 09, 2011, 09:57:57 PM »

mochad 0.1.6 is now available on SourceForge.

http://sourceforge.net/projects/mochad/files

This version adds an RF event filter to eliminate the flurry of duplicate
RF events when a key is pressed or a sensor is triggered. This makes it
easier to write applications that process mochad events.

In addition, mochad compiled for Chumby is now available.

CHAXI -- Chumby Home Automation X10 Interface
================================

The programs included in the CHAXI toolkit allow you to build Chumby command
line applications that integrate X10 sensors and modules with Chumby.

chaxi.zip   -- CHAXI toolkit zip file with compiled mochad and sample programs.
                Unzip to a Flash drive and plug into Chumby along with a
                CM19A or CM15A.

Contents of chaxi.zip

chaxi.txt   -- Instructions for using CHAXI.

debugchumby -- Auto run file for Chumby.

mochad      -- X10 to TCP gateway for CM19A and CM15A.

alarm.sh    -- Make Chumby react to motion and light using an X10 wireless
                motion and light sensor.

radio.sh    -- Use an X10 wireless remote to control Chumby's radio.

sendsms.template -- Fill in the blanks to send SMS messages to your phone.
                Once this works, you can send SMS messages on motion sensor
                and door/windows sensor alerts.
Logged

hawk1

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 625
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #42 on: April 17, 2011, 11:24:02 AM »

Got this working on my Ultimate Edition!  Very cool!  I was wondering if anybody has made a Kommander script for this or actually created a program that uses this? 

If not I was wondering if someone could write a kommander script that  uses combo boxes to select the house and unit code and how I would fire it off once the value in the combo box was selected.  I think I got the combo boxes down. 

Just trying to figure out a exec button to fire it with the values from the combo boxes.   Thanks.  Newbie at Linux but loving it.   ??? 

Disregard question.  Figured it out.  thanks
« Last Edit: April 18, 2011, 12:21:01 PM by hawk1 »
Logged
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

hawk1

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 625
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #43 on: April 20, 2011, 01:24:10 PM »

Has anyone made a gui for this yet?
Logged
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #44 on: April 21, 2011, 03:22:25 AM »


No GUI like AHP but here is small Python demo app with buttons for
On,Off,Bright,Dim. Should work on all Python platforms including Windows
and MacOS but only tested on Ubuntu Linux 10.04.

Code: [Select]
# Python demo interface to mochad. Pressing GUI buttons sends commands to
# mochad to turn lights on,off,bright,and dim. There must be a better way
# to avoid such repetive code. Should work on other support Python platforms
# such as Windows and MacOS but only tested on Ubuntu Linux 10.04.
#
from Tkinter import *
import socket

# Change this to localhost if this program runs on the same host as mochad. Or
# change to the correct IP.
MOCHADHOST="192.168.1.254"
MOCHADPORT=1099

def netcat(hostname, port, content):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((hostname, port))
    s.sendall(content)
    s.close()

def mochad(command):
    netcat(MOCHADHOST, MOCHADPORT, command)

class App:

    def __init__(self, master):

        frame = Frame(master)
        frame.grid()

        Label(frame, text="Bedroom 1").grid(row=0)
        self.bed1_on = Button(frame, text="On", command=self.bed1_on_cb)
        self.bed1_on.grid(row=0,column=1)

        self.bed1_off = Button(frame, text="Off", command=self.bed1_off_cb)
        self.bed1_off.grid(row=0,column=2)

        self.bed1_bright = Button(frame, text="Bright", command=self.bed1_bright_cb)
        self.bed1_bright.grid(row=0,column=3)

        self.bed1_dim = Button(frame, text="Dim", command=self.bed1_dim_cb)
        self.bed1_dim.grid(row=0,column=4)

        Label(frame, text="Bedroom 2").grid(row=1)
        self.bed2_on = Button(frame, text="On", command=self.bed2_on_cb)
        self.bed2_on.grid(row=1,column=1)

        self.bed2_off = Button(frame, text="Off", command=self.bed2_off_cb)
        self.bed2_off.grid(row=1,column=2)

        self.bed2_bright = Button(frame, text="Bright", command=self.bed2_bright_cb)
        self.bed2_bright.grid(row=1,column=3)

        self.bed2_dim = Button(frame, text="Dim", command=self.bed2_dim_cb)
        self.bed2_dim.grid(row=1,column=4)

# Callback functions invoked when buttons pressed.
# Change "pl" to "rf" if using a CM19A.
    def bed1_on_cb(self):
        print "bed 1 on"
        mochad("pl b3 on\n")

    def bed1_off_cb(self):
        print "bed 1 off"
        mochad("pl b3 off\n")

    def bed1_bright_cb(self):
        print "bed 1 bright"
        mochad("pl b3 bright\n")

    def bed1_dim_cb(self):
        print "bed 1 dim"
        mochad("pl b3 dim\n")

    def bed2_on_cb(self):
        print "bed 2 on"
        mochad("pl b4 on\n")

    def bed2_off_cb(self):
        print "bed 2 off"
        mochad("pl b4 off\n")

    def bed2_bright_cb(self):
        print "bed 2 bright"
        mochad("pl b4 bright\n")

    def bed2_dim_cb(self):
        print "bed 2 dim"
        mochad("pl b4 dim\n")

root = Tk()
app = App(root)
root.mainloop()
Logged
Pages: 1 2 [3] 4 5
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.