Please login or register.

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

Author Topic: Developing my own X10 Controller Software  (Read 33878 times)

sarahlj16

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Developing my own X10 Controller Software
« on: February 10, 2010, 10:19:31 AM »

Hi guys,

I am a newB to X10. I'm an embedded design engineer. Apologies if I'm in the wrong forum.

I am looking to provide the interface to an X10 controller in place of the PC. I essentially have a bit of kit with a microprocessor,a serial port and some inputs. I have read the communication protocol document and begun communicating with the X10 controller (CM11/CM12).  Well kind of!

After power up, I receive the byte 0xa5 every second (Power Fail Download Poll Code). I understand the controller is wanting a response followed by a 42 byte macro.

The problem is that I don't want to use macros. I just want to be able to send commands to the controller whenever I like.

Should I send a blank macro? Then just send commands when I want.

Thanks for any help
Sarah
Logged

Brian H

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 305
  • Posts: 13259
Re: Developing my own X10 Controller Software
« Reply #1 on: February 10, 2010, 12:57:51 PM »

0xa5 is the Set Interface Clock request.
I believe it will not stop until you set the clock.
Then it will be ready to process other things.
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: Developing my own X10 Controller Software
« Reply #2 on: February 10, 2010, 02:50:36 PM »

Hi guys,

I am a newB to X10. I'm an embedded design engineer. Apologies if I'm in the wrong forum.

I am looking to provide the interface to an X10 controller in place of the PC. I essentially have a bit of kit with a microprocessor,a serial port and some inputs. I have read the communication protocol document and begun communicating with the X10 controller (CM11/CM12).  Well kind of!

After power up, I receive the byte 0xa5 every second (Power Fail Download Poll Code). I understand the controller is wanting a response followed by a 42 byte macro.

The problem is that I don't want to use macros. I just want to be able to send commands to the controller whenever I like.

Should I send a blank macro? Then just send commands when I want.

Thanks for any help
Sarah

Sending one byte of 0x9b to the CM11A should stop the 0xa5 polling.  You may need to wait a few hundred milliseconds before sending it another command.

If you haven't already done so, download http://www.heyu.org/docs/protocol.txt which contains a number of corrections to X-10's original protocol document (including the above tip).

That 42 byte macro mentioned in the protocol is only for the CM10A (the older device without clock or battery backup sold primarily as the IBM HD16 Home Director).  The CM11A macros are different and described further down in the document.

Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: Developing my own X10 Controller Software
« Reply #3 on: February 10, 2010, 04:41:55 PM »

I have the RCA CM11a/HC60RX and its sending out 0xFC (decimal 252). i've searched the updated protocol that was posted, and i cant find a reasoning for this number. Do you have any idea what it means?
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: Developing my own X10 Controller Software
« Reply #4 on: February 10, 2010, 09:18:25 PM »

I have the RCA CM11a/HC60RX and its sending out 0xFC (decimal 252). i've searched the updated protocol that was posted, and i cant find a reasoning for this number. Do you have any idea what it means?

I have no idea.  The CM11A has probably gotten into an unstable state (or has gone bad).

Try unplugging from AC, removing the batteries, and letting it sit for one hour.  It would probably then be a good idea to temporarily operate the CM11A with ActiveHome (or other similar program) long enough to reset the clock and erase the EEPROM memory.
Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

sarahlj16

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: Developing my own X10 Controller Software
« Reply #5 on: February 11, 2010, 04:36:52 AM »

Thanks everyone, I have downloaded the corrected document. I shall hopefully make more progress today....
Logged

sarahlj16

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: Developing my own X10 Controller Software
« Reply #6 on: February 11, 2010, 05:42:27 AM »

Hi,

Just to clarify. After I have responded to the 0xa5 command with 0x9b. Do I have to set anything else up or can I just start sending house/device and functions codes like example 3.14  protocol document?

I don't want to use macros as my development kit will determine what action needs to be taken and when.

Thanks

Sarah
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: Developing my own X10 Controller Software
« Reply #7 on: February 11, 2010, 10:47:03 AM »

Hi,

Just to clarify. After I have responded to the 0xa5 command with 0x9b. Do I have to set anything else up or can I just start sending house/device and functions codes like example 3.14  protocol document?

I don't want to use macros as my development kit will determine what action needs to be taken and when.

Thanks

Sarah

You should be able to start sending the house/device and function codes.
Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

sarahlj16

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: Developing my own X10 Controller Software
« Reply #8 on: February 11, 2010, 11:02:20 AM »

Oh, I've sent 0x04, 0x66 after the 0x9b (wait 100ms) and I get no reply.

I will keep investigating. I must be doing something wrong!!

Thanks for your reply....
Logged

sarahlj16

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: Developing my own X10 Controller Software
« Reply #9 on: February 11, 2010, 11:37:41 AM »

I've got this sorted now. Thanks for the help.....
Logged

pconroy

  • Hero Member
  • *****
  • Helpful Post Rating: 9
  • Posts: 294
Re: Developing my own X10 Controller Software
« Reply #10 on: February 12, 2010, 10:10:43 PM »

Its kinda' fun when it works, isn't it?

Charles - your docs are excellent, I've been devouring them.
Thanks for taking the time to put them together.

Logged

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: Developing my own X10 Controller Software
« Reply #11 on: February 21, 2010, 10:09:57 AM »

Sarah- After you sent the 0x04 and 0x66 what did you do? I'm at that same point.

Charles- Thanks for all your help, i took your advice and ordered a new Controller, now im getting the 0xa5. So i feel im finally going in the direction
Logged

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: Developing my own X10 Controller Software
« Reply #12 on: February 21, 2010, 11:04:47 AM »

Well i got past sending 04 66 and I've got the check some. However, when i send 00 i get nothing. After reading the document i believe im supposed to be getting the 0x55 then i can send the function code to turn on the light 0x06 0x62.  any insight on sending the 0x00?
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: Developing my own X10 Controller Software
« Reply #13 on: February 21, 2010, 02:07:15 PM »

Well i got past sending 04 66 and I've got the check some. However, when i send 00 i get nothing. After reading the document i believe im supposed to be getting the 0x55 then i can send the function code to turn on the light 0x06 0x62.  any insight on sending the 0x00?

I assume that you have verified that your CM11A is working properly (by testing it under ActiveHome 1.42 or other software) and are doing the following:
   write 0x04,0x66
   read back checksum  (0x6a)
   write 0x00
   try to read back 0x55

The CM11A should start sending out the X10 signal on the AC powerline once you write the 0x00, and a module set for housecode|unit A1 should respond even though you don't read the 0x55.  Does it?

Have you tried sending the command more than one time in a row?  If you use the abbreviated method for halting the 0xa5 poll for a clock update and don't wait long enough (1-2 seconds) after that, the next command will often fail.

 
Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: Developing my own X10 Controller Software
« Reply #14 on: February 21, 2010, 05:44:14 PM »

I just ran it with Active Home, i have Version 1.4 (B2.0.70) and it works correctly.

Im running it with my homemade program and I'm getting the 0xA5 and i stop it with the 0x9b. I then waited a few seconds and then sent 0x04, 0x66. After recieving a check sum of 6A, i sent the 0x00. i didnt get anything back. I moved past it like you mentioned and went on to send the 0x06, 0x62 and im using the XPS3 Fluorescent wall switch (WS13A)  im not getting a response out of it. I made a program to show the input/output...

Byre Received at 5:34:43 PM : 498 msec: A5
Byre Received at 5:34:45 PM : 339 msec: A5
Byre Received at 5:34:47 PM : 181 msec: A5
Sent at 5:34:48 PM : 668 msec: 9b
Sent at 5:35:44 PM : 934 msec: 0466
Byre Received at 5:35:45 PM : 43 msec: 6A
Sent at 5:36:04 PM : 199 msec: 00
Sent at 5:36:32 PM : 206 msec: 0662
Byre Received at 5:36:32 PM : 314 msec: 68
Sent at 5:36:36 PM : 285 msec: 00
« Last Edit: February 21, 2010, 05:47:25 PM by halju »
Logged
Pages: [1] 2
 

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