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 124593 times)

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #45 on: April 21, 2011, 10:02:58 PM »

An interesting HA app I have looked at but not used is OpenRemote (OR) at openremote.org. The GUI designer for iPhone/iPad/Android looks good. The CM15A is not supported but TCP devices are supported. It is possible to create an Android or iPhone control panel with buttons that send strings to a TCP socket. In theory, this should work with mochad.

I currently do not have an iPhone or Android device so have not tried OR. I am not sure how timed events work (for example, turn off lights at dawn) or how sensors are handled. The GUI does allow definition of sensors but I am not sure sensors can be linked to specific messages from a mochad TCP socket.

The project supports Win, Mac, Linux, iPhone/iPad, and Android. The documentation needs work.
Logged

bakelite

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #46 on: April 24, 2011, 03:42:47 PM »

Hi, fantastic I have been looking for a Linux version for a while. However only the RF commands appear to work the PL commands echo back OK in netcat but don't operate my X10 devices :-( Could this be because I am using a UK CM15Pro ?? I have complied this on Dedian. Many thanks
Logged

mmauka

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

I suggest plugging the controller and a lamp or appliance module into the same
wall outlet or powerstrip then see if mochad can control the module. If not,
make sure the modules are compatible with the controller. If you purchased the
CM15Pro and the modules at the same time from the same vendor, they should work
together. mochad does not contain any options for the CM15Pro so it should
"just work". At least one person reported the CM15Pro works with mochad.
Be sure use the latest mochad version (0.1.7) because perhaps you have run
into an old bug.

Another thing to try is to connect the CM15 controller to a PC running the
provided Windows software and wipe out the controller memory. This removes all
internal macros and timers which can cause problems. I also remove the
batteries since mochad does not use the controller internal date/time clock.
And lastly, disable the internal RF to PL transceiver. These are options
controlled by the Windows AHP software.
Logged

bakelite

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #48 on: April 25, 2011, 08:44:13 AM »

Firstly many thanks for your help, and advice.

I have now tried my X10 devices on the same power point (no surge protector). I have cleared the interface, stopped transceiver and removed the battery etc. I am using the latest 0.1.7

So far my X10 devices work OK controlled by AH under windows, however not from Debian. If I use the rf a1 start, or rf a1 stop the command is repeated via my wireless device and the appliances turn on and off OK (see bellow)

rf a1 on
04/25 13:26:31 Tx RF HouseUnit: A1 Func: On
04/25 13:26:31 Tx PL HouseUnit: A1
04/25 13:26:31 Tx PL House: A Func: On
04/25 13:26:36 Rx PL HouseUnit: A1


rf a1 off
04/25 13:28:16 Tx RF HouseUnit: A1 Func: Off
04/25 13:28:16 Tx PL HouseUnit: A1
04/25 13:28:16 Tx PL House: A Func: Off
04/25 13:28:21 Rx PL HouseUnit: A1


{Turns A1 ON/OFF OK}

However when I issue the pl commands the devices do not respond (see below)

pl a1 on
04/25 13:30:28 Tx PL HouseUnit: A1
04/25 13:30:28 Tx PL House: A Func: On

pl a1 off
04/25 13:30:44 Tx PL HouseUnit: A1
04/25 13:30:44 Tx PL House: A Func: Off


{Look OK to me however A1 not turning ON OR OFF}

FYI, everything looks OK in the messages logfile (see below)
Apr 25 12:52:58 test-linux01 kernel: [65251.848059] usb 3-2: new low speed USB device using uhci_hcd and address 8
Apr 25 12:52:58 test-linux01 kernel: [65252.034065] usb 3-2: New USB device found, idVendor=0bc7, idProduct=0001
Apr 25 12:52:58 test-linux01 kernel: [65252.034098] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Apr 25 12:52:58 test-linux01 kernel: [65252.034106] usb 3-2: Product: USB ActiveHome Interface
Apr 25 12:52:58 test-linux01 kernel: [65252.034112] usb 3-2: Manufacturer: X10 Wireless Technology Inc
Apr 25 12:52:58 test-linux01 kernel: [65252.034343] usb 3-2: configuration #1 chosen from 1 choice
Apr 25 12:52:58 test-linux01 mochad[2285]: starting
Apr 25 12:52:58 test-linux01 mochad[2286]: Found CM15A


Anything else I can try ??

P.S Under nc in debian I needed to add the q option to return control in my shell scripts. So rather than use
$ echo "pl a all_lights_off" | nc localhost 1099
I had to use
$ echo "pl a all_lights_off" | nc -q 1 localhost 1099

Thanks again
Logged

mmauka

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 41
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #49 on: April 25, 2011, 08:00:11 PM »

rf a1 on
04/25 13:26:31 Tx RF HouseUnit: A1 Func: On
04/25 13:26:31 Tx PL HouseUnit: A1
04/25 13:26:31 Tx PL House: A Func: On
04/25 13:26:36 Rx PL HouseUnit: A1


The last line is very odd because it indicates there is another X10 controller
transmitting on the power line. The CM15A does not see its own transmissions so
there must be another controller such as a CM15A, TM751, or RR501 transmitting
at the same. Please unplug all other X10 controllers and see if this helps.
It might make things worse since the other controller may be causing the
module to turn on/off.

Try changing to a different house code. The other X10 controller could belong
to a neighbor.

However when I issue the pl commands the devices do not respond (see below)

pl a1 on
04/25 13:30:28 Tx PL HouseUnit: A1
04/25 13:30:28 Tx PL House: A Func: On

pl a1 off
04/25 13:30:44 Tx PL HouseUnit: A1
04/25 13:30:44 Tx PL House: A Func: Off


This looks fine to me and SHOULD work.

What is the model number of the X10 module?
Logged

bakelite

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #50 on: April 26, 2011, 10:41:39 AM »

My unit is a UK CM15, however I may have identified the problem today :-)

I reconnected my old serial UK CM12 and made a few tests using Heyu. It worked however I noticed the device response was over 10 seconds. Reading the Heyu forums this type of slow response is thought to be due to a poor quality power line.

So I moved my whole setup round to a friends house (different power cct) where everything works perfectly :-)

So even though my original testing was on a single power outlet noise must be filtering back up to swamp the X10 signals. When it worked via the rf command it must have been my RF transceiver (the other device you noted) putting out a stronger signal than the CM15. I will now try and isolate the noise. Thanks again for all your help and a brilliant driver.
Logged

dattas

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #51 on: August 02, 2011, 10:25:33 PM »

mmauka,

I love this, I just got it working on Ubuntu server 11.04 64bit. The only change to version 0.1.12 I had to make was remove the 3 lines in mochad.c starting at line 514.
So I just had to change
Code: [Select]
512     if (r < 0) {
513         libusb_cancel_transfer(IntrOut_transfer);
514         while (IntrOut_transfer)
515             if (libusb_handle_events(NULL) < 0)
516                 break;
517         return r;
518     }
to read:
Code: [Select]
512     if (r < 0) {
513         libusb_cancel_transfer(IntrOut_transfer);
514         return r;
515     }
without this change the code would get stuck in that while loop until kill -9'ed. I figured this was an okay change to make since in your main loop you call the handle_events anyway but with the timeout so things won't get stuck.

Also, debug mode doesn't work as it gives you the error
Quote
unknown option -d
unless you make line 807 in mochad.c, which looks like:
Code: [Select]
807         if (strcmp(argv[i], "--raw-data") == 0) to read:
Code: [Select]
807         else if (strcmp(argv[i], "--raw-data") == 0)Thanks for the hard work!
« Last Edit: August 02, 2011, 10:28:25 PM by dattas »
Logged

NavinR

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #52 on: August 24, 2011, 03:14:14 PM »

MMauka,

Thanks for this most excellent app!

I use mochad on a pogoplug and it works perfectly.  I also use a micasaverde Vera 2 z-wave controller.  A Vera user has written a plugin that allows communication between the Vera and mochad.  This allows me to control X10 via the Vera, and to trigger scenes from X10 RF devices.  It works really well.

Logged

doogie

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #53 on: November 27, 2011, 04:55:39 PM »

Hello,

I'm using Marmitek SW12 with mochad and Openremote to control my Window-Sunshades.
It's working quite well with ON and OFF commands, also DIM and BRIGHT can be used to lower or raise the blinds a certain amount.
But I'm not able to get the XDIM command to work. I want to set the blinds to 50%, with a "PL B10 XDIM 50", but it doesn't move.

I'm trying this through Openremote AND directly from the command shell with
echo pl B10 XDMIN 50 | nc localhost 1099

nothing happens :(

The SW12 is clearly capable of moving to given positions, as with the Active Home Professional software you can do  this without a problem...
any idea how this could work?

best regards
Doogie
P.S.: using mochad 0.1.12
« Last Edit: November 27, 2011, 05:47:55 PM by doogie »
Logged

doogie

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #54 on: November 27, 2011, 06:18:30 PM »

I investigated a little further and came to the following conclusion:
the Blind-shutter-Modules don't listen to XDIM, but to different extended codes, each extended code number is a specific position of the blind.

I had a closer look at how ActiveHome Professional handles it, and if you take a look in the Activity history, you see a major difference between ActiveHome and mochad/ncat:

if you try to "XDIM 96" the module with NCAT, you get the following result

TX PL HouseUnit: B10 Func: Ext Code 1, Data, Control Data, 60

when controlling the SW12 modul at address B10, you get the following entries:

TRANSMIT B10 Extended code 18 1


*) B10 is the address,

*) 18 is the hex value for the position. There are 25 Positions, in 4% steps between 0 and 100. 18hex = 24 = 24*4 = 96% open. If you "dim" it to 8%, you get a "Extended code 2",  60% is "Extended code F", and so on... so, the range is between 0hex and 18hex.

*) 1 seems to be a fixed value


now, the major question: is this possible in mochad, maybe in an updated version?
Will gladly volunteer for testing...

regards
Doogie
« Last Edit: November 28, 2011, 02:33:50 AM by doogie »
Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #55 on: November 27, 2011, 07:48:16 PM »

The extended codes are defined in this document...
although I do not know whether that is the final version.
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

doogie

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #56 on: November 28, 2011, 01:25:10 AM »

thank you, I saw that too, but that could only be a guide how to modify the mochad source code, right?
Logged

doogie

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #57 on: November 28, 2011, 05:49:58 AM »

after reading into the document again and comparing it with the sourcecode and WIKI, maybe the passthrough ("PT") command could be a workaround...
Will test that at home tonight...

a " simple"
Code: [Select]
PT 5a 05 07 e7 09 12 01
should set the blinds at B10 to roughly 50%, hopefully...
will report back with the result...

Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #58 on: November 28, 2011, 06:59:09 AM »

thank you, I saw that too, but that could only be a guide how to modify the mochad source code, right?
It can tell you whether or not mochad is sending the codes as defined in the document as well as serve as a guide for modifying the source if that's where the problem lies.

AFAIK, X-10 never sold any devices in N. America beyond control for lights/appliances so experienced users of most of these codes are only likely to be found in Europe.
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

doogie

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: mochad, X10 CM15A/CM19A Linux device driver
« Reply #59 on: November 28, 2011, 07:07:26 AM »

It can tell you whether or not mochad is sending the codes as defined in the document as well as serve as a guide for modifying the source if that's where the problem lies.

... and if I spend a few more hours in decyphering this pdf, maybe I can get a passthrough command to work... not sure about my PT example from before, but maybe someone has experience with this raw commands, and can help me a bit?

I think with PT-commands, it should be possible to achieve anything that the new devices support, no matter if it's already implemented in mochad or not...
Just have to figure out the correct syntax AND the correct mapping of the adresses (just learned that house "B" is encoded as hex "E"...)

anyway, don't giving up yet...
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.