X10 Community Forum

🖥️ActiveHome Pro => SDK => Topic started by: cewongq on March 09, 2006, 12:21:20 AM

Title: This SDk works with a CM19A?
Post by: cewongq on March 09, 2006, 12:21:20 AM
I have a CM19A and I'm trying to send a simple command as a test, in an ASPX wrote in C# but it doesn't work...

I tried this:

I put a buttom, and in the buttom's click a put this code:

private void Button1_Click(object sender, System.EventArgs e)
{
   Type t = Type.GetTypeFromProgID("X10.ActiveHome");
   ActiveHomeClass control = (ActiveHomeClass)Activator.CreateInstance(t);
   object o = control.SendAction("sendrf", "a3 off", null, null);
   Console.WriteLine("Result="+o.ToString());
}

The result is zero, but no command is sent. (The red led doesn't get on at any time)


Any help.
Title: Re: This SDk works with a CM19A?
Post by: cewongq on March 09, 2006, 04:48:17 PM
Is any body supporting this forum?
Title: Re: This SDk works with a CM19A?
Post by: Tuicemen on March 09, 2006, 08:56:00 PM
I don't think this SDK will work with the CM19A others have tried and switched to the  CM17a firecracker  because there are many example codes posted all over the Web. see  SDK control of CM15a vs CM19a using VB     (http://www.x10community.com/forums/index.php?topic=7886.0) I realize your not using VB but this is just an example! ;) ;D
Title: Re: This SDk works with a CM19A?
Post by: X10 Pro on March 09, 2006, 08:57:59 PM
I was pretty sure that the SDK should work with the CM19A. I'll check and see.
Title: Re: This SDk works with a CM19A?
Post by: cewongq on March 09, 2006, 11:08:38 PM
Thanks, I'll be waiting for you   ;)
Title: Re: This SDk works with a CM19A?
Post by: cewongq on March 11, 2006, 10:25:29 PM
I found something weird, it receives events from the CM19A, but it cannot send commands.

Is there any setup to indicate to the SDK to use the CM19A?

I don't understand why it can receive but no to send. ???

Any comment????

------------------------------------------------------------------------------------------------
By the way, in the first post I didn't explain very well what I did:  :-\

I built an ASPX (ASP .Net) with a button on the C# language, and in the button's click event I dispatch a command to the X10 units.  8)

Title: Re: This SDk works with a CM19A?
Post by: X10 Pro on March 13, 2006, 03:13:30 PM
I tested and was able to send RF with the CM19A. I used ahcmd.exe (included with the SDK) and just did "sendrf a1 on" and a few other commands and they were transmitted correctly. Can you try that and see if it works for you?
Title: Re: This SDk works with a CM19A?
Post by: cewongq on March 14, 2006, 08:54:19 PM
I tried these commands:

C:\Program Files\AHSDK\bin>ahcmd sendrf a1 on

C:\Program Files\AHSDK\bin>ahcmd sendrf a3 on

C:\Program Files\AHSDK\bin>ahcmd sendrf a2 on

No one works, I'm trying to activate some wireless cameras, and I have windows XP Profesional with Service Pack 2 installed.

Is there any configuration tool for these SDK?
Title: Re: This SDk works with a CM19A?
Post by: cewongq on March 14, 2006, 09:13:34 PM
i found something new....

If the "X10 Device Network Service" is stopped, I can send a command (ex: C:\Program Files\AHSDK\bin>ahcmd.exe sendrf A3 On) and it works, but it starts the service, and I cannot send more commands.

I stop the service again and I can sent another command. But again it starts the service and fun is over.

Any comment???

Title: Re: This SDk works with a CM19A?
Post by: Tuicemen on March 14, 2006, 09:32:51 PM
Its been along time since a SDK update perhaps it's due! ;)
Title: Re: This SDk works with a CM19A?
Post by: VBMarc on March 14, 2006, 10:25:08 PM
Hi everyone,

I have spent a lot of time monkeying with this, here's what I've been able to figure out:

The ahcmd.exe (included with the SDK) will support the CM19a, but only as a receiver, and not as a transmitter. I have never been able to use the SDK to make the sendrf command work. In contrast, it receives RF beautifully.

Then I tried the ActiveX component "hspi_CM19A_USB.ocx" from Patterson, which I obtained from x10.patterson.cx/x10/. With this component, I was able to send RF from the CM19A. The little red LED even lit up! The syntax for this component is very different from the X10 sdk, but once you get the hang of it, it makes sense.

Oddly, the receive function of the Patterson ActiveX component does poorly – it misses a lot of signals (e.g. it picks up the PalmPad, but not signals from the CM17a Firecracker).

So to have a fully functioning CM19a, I had to write an app that uses BOTH ActiveX components. One to handle sending, one to handle receiving.  Ugh!

In reply to the comment from X10 PRO that "I tested and was able to send RF with the CM19A": please, please read the posts on this forum. It is a constant complaint that "sendRF" does NOT work using the SDK for either the CM15a or CM19a.

As for me, I followed Dave’s advice, tossed all that junk, and used the CM17a Firecracker as described in the thread Tuicemen points to (see SDK control of CM15a vs CM19a using VB). As Tuicemen indicates, I used VB, but it should work for any PC language.  If X10 makes an activex component that supports "sendrf", then maybe I’ll go back to the CM19a. As Tuicemen says "Its been along time since a SDK update perhaps it's due".
Title: Re: This SDk works with a CM19A?
Post by: X10 Pro on March 15, 2006, 07:41:00 PM
VBMarc: I read the posts, tested on my systemm, and was able to send RF with both the CM15A and CM19A. The original poster, cewongq, was also able to send RF via the CM19A, albeit only once before having to restart the process.

We do need to do an update to the SDK, as we have some code changes in (based on customer feedback) that we haven't released yet. I will make sure we do that soon, and then maybe you can try it again.
Title: Re: This SDk works with a CM19A?
Post by: cewongq on March 16, 2006, 10:48:48 PM
Hey VBMarc, can you send me an example?.

I downloaded it, but I don't understand how it works.   ;D
Title: Re: This SDk works with a CM19A?
Post by: VBMarc on March 17, 2006, 12:19:47 AM
Hi cewongq,
Here is some stuff to get you started, I'll send you a zip as well.

1) Download and install the ActiveX component hspi_CM19A_USB.ocx from http://x10.patterson.cx/x10/
2) To work on a PC, you must also install the Firecracker drivers
   from http://www.x10.com/support/support_soft1.htm
   I used Version 2.0.0.82 xfire.exe

Create a form in VB (sorry, don't know C)
Add a reference to the ActiveX component hspi_CM19A_USB.ocx
At the top of the module add

      Dim WithEvents oFC As hspi_CM19A_USB.cFirecrackerUSB
'though you can leave out withEvents since they haven't been overly useful

' In the Form_Load sub, add:

    Set oFC = CreateObject("hspi_CM19A_USB.cFireCrackerUSB")
    debug.print "Is the CM19a Connected? " & oFC.Connected


' add some buttons that call the subs below
' housecode is "A", or "B",... etc
' devicecode is  1, 2, etc

Sub lightOn(housecode As String, devicecode As Byte)

    oFC.command = cON
    oFC.housecode = housecode
    oFC.devicecode = devicecode
    oFC.SendCmd
   
End Sub

Sub lightOff(housecode As String, devicecode As Integer)

    oFC.command = cOFF
    oFC.housecode = housecode
    oFC.devicecode = devicecode
    oFC.SendCmd

End Sub
~~~~~
cON and cOFF are enums included in hspi_CM19A_USB.ocx
So instead of the syntax of "sendrf A1 on", the syntax here is to
create an object. Then for that object,
set the command property, the housecode property, the devicecode property,
and THEN use the method SendCmd
A little awkward, but it works.

Let me know if that helps / if it works for you.
Title: Re: This SDk works with a CM19A?
Post by: billy on March 20, 2006, 10:23:17 AM
cewongq,

X10Pro is correct the CM19A does work!  I have been using the CM19A to SEND commands to my Ninjas, UX21A VCR Commander, and to the CM15A (not connected to my PC).  I RECEIVE the RF activity from my remotes, motion sensors and from another PC running Mister House(CM17A/MR26A).  The Mister House software uses the CM17A & MR26A to communicate to the CM15A for the PLC commands, and handles my web interface for my IA Audreys and remote access to my house.
 
Make sure you have installed the driver for the CM19A listed as: "X10 USB Firecracker Interface V2.36" listed in Device Manager.

X10nets.exe process needs to be running to use ahcmd.  "X10 Device Network Service" listed in services = "X10nets.exe" in Processes window of the Task Manager. If I kill the process and try the "ahcmd.exe sendrf l8 on" windows will restart the X10nets.exe process automatically and then turn on L8.   It's normal for the service to be running. I can execute many ahcmd functions right after another.

You can try the Javascript example in the SDK for the PalmPad, just change "sendplc" to "sendrf" in the html file.

ActiveHomeObj.SendAction("sendplc",commandString);
ActiveHomeObj.SendAction("sendrf",commandString);

Works Great for me.

Little known fact the CM19A/CM15A CAN also send & receive security system commands, but not with the X10 drivers.

Good Luck!
Title: Re: This SDk works with a CM19A?
Post by: Noam on March 20, 2006, 10:55:24 AM
Billy -
If the CM19A can send and receive security system codes (as you said), then that might be the solution for all those people who want AHP to interact with the security system. Once could (theoretically) write an app to listen for the security codes coming down the line, and then re-transmit "normal" X10 commands, that AHP can then interpret to turn on lights, run macros, send alerts, etc.
Title: Re: This SDk works with a CM19A?
Post by: billy on March 20, 2006, 09:27:50 PM
Noam,

Unfortunately the X10 drivers filter out the security codes. Making AHP unusable for the security devices,
but yes it would be possible have a utility to receive the RF from the security system and then transmit regular X-10 RF
to trigger functions in the CM15A.

I'm using libusb-win32 and a routine I wrote in VC++ to handle my RF in/out of the CM19A.

I have the older Rat Shack plug'n power security base 61-2611-A-R and  Rat Shack, HEATH Zenith SSA61000-2 Door/Window Sensors.
These systems are X-10 compatible and have worked very well for me over the last 10 years!
Should also work PS/DS systems sold today.

Here's a sample of the commands received by the CM19A from the Security System.
The leader of "03/20 19:47:11 : Size = 5  -" is my logging info to the right is the actual codes.
 
Remote:
Arm =       03/20 19:46:58 : Size = 5  -  20 23 2C 06 FFFFFFF9
Disarm =    03/20 19:47:04 : Size = 5  -  20 23 2C FFFFFF86 79
Light On = 03/20 19:47:09 : Size = 5  -  20 23 2C 46 FFFFFFB9
Light Off = 03/20 19:47:11 : Size = 5  -  20 23 2C FFFFFFC6 39

Door/Window Sensor:
Door Switch Open =    03/20 19:49:06 : Size = 5  -  20 10 1F 04 FFFFFFFB
Door Switch Closed =   03/20 19:49:07 : Size = 5  -  20 10 1F FFFFFF84 7B

Still have to incorporate the install of each Security device in my software, because each device
will generate a different random code when making the initial install of the system.
Title: Re: This SDk works with a CM19A?
Post by: ABT1956 on March 24, 2006, 12:24:21 PM
billy, I think motion sensors (MS16A) are considered as security devices and its signals cannot be read using CM19A. Do you know if this is correct?

thxs
Title: Re: This SDk works with a CM19A?
Post by: billy on March 25, 2006, 09:46:06 AM
ABT1956,

I believe the MS16A is a standard X10 device.

HawkEye :
http://www.x10.com/products/x10_ms13a.htm

EagleEye:
http://www.x10.com/products/x10_ms14a.htm

ActiveEye:
http://www.x10.com/products/x10_ms16a.htm

The ActiveEye (MS16A) is also listed in AHP Sensors.

Title: Re: This SDk works with a CM19A?
Post by: ABT1956 on March 27, 2006, 06:34:15 AM
Billy,

Thank you for your answer. I´m trying to read RF commands coming palm pad and MS16A with an app written in VB but it doesn´t works. The only thing it detects is the activatio/deactivation of the CM19A itself when it plug/unplug it into the USB port. Can you give some ideas how to fire events coming from MS16A or palm pad?

Regards,

Title: Re: This SDk works with a CM19A?
Post by: cewongq on April 06, 2006, 01:38:28 PM
Thanks billy, I'll try it with the versions that you said on your post:

X10 USB Firecracker Interface V2.36 (Right now I have a driver updated by Microsoft, something ACPI compliant).

Do I need to install something else? it is enough with the firecraker and the SDK?


Thanks for all.
Title: Re: This SDk works with a CM19A?
Post by: ABT1956 on April 07, 2006, 12:01:46 PM
Hi cewongq,

I´ve seen in your posts that you can read from CM19A. I´m trying to read signals sent by MS16A using SDK but no events are fired. Can you send me an example of your app?

thanks,

ABT1956
Title: Re: This SDk works with a CM19A?
Post by: billy on May 02, 2006, 09:13:14 AM
Try this:

CM15A installed and the transceived HC setup, disconnected from PC,
or use a TM751, RR501 transceiver.  CM19A is RF only!

Goto http://www.activehomepro.com/sdk/sdk-info.html

Download ahvbview.zip and unzip

Edit ahvbview.html
      Change the sendplc's to sendrf commands.
      Change the e8's to an address of one of your installed X10 modules.

With the CM19A plugged in double click the ahvbview.html icon.

You should see the RF commands from a remote in the Receive Status line.

Your module should respond to the "Send XX on", "send XX off".
Title: Re: This SDk works with a CM19A?
Post by: andresma on March 26, 2007, 05:09:02 PM
Hi Billy,

Can you give any aditional information about what init sequence use in your libusb driver?

I want to configure my CM19A to get security commands, but this is not possible with X10 drivers

Really thanks,
Andrés
Title: Re: This SDk works with a CM19A?
Post by: merva on May 30, 2008, 11:28:26 AM
hi

can you help me with some line of vb to make the cm19a receive ?

i mannaged  to make it transmitt with the ocx of x10

thanks

daniel levy

london
Title: Re: This SDk works with a CM19A?
Post by: Tuicemen on May 30, 2008, 03:33:54 PM
if your using the AHP SDK and the "Interop.ActiveHomeScriptLib.dll"
then code is simple,to send is:
Code: [Select]
ActiveHomeObj.SendAction("sendrf", "a3 off")to recieve is:
Code: [Select]
Sub ActiveHome_RecvAction(ByVal bszRecv As Object _
                            , ByVal vParm1 As Object _
                            , ByVal vParm2 As Object _
                            , ByVal vParm3 As Object _
                            , ByVal vParm4 As Object _
                            , ByVal vParm5 As Object _
                            , ByVal vReserved As Object) Handles ActiveHomeObj.RecvAction

        Console.WriteLine("RecvAction: " & bszRecv & " " & vParm1 & " " & vParm2 & " " & vParm3 & " " & vParm4 & " " & vParm5)
    End Sub
the "Interop.ActiveHomeScriptLib.dll" file is in the C:\Program Files\AHSDK\samples\vbapp\VBActiveHome folder once you install the SDK
>!
Hope that helps!