ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#18703 - 09/06/07 07:03 PM Question about CPU-XA serial protocol with X10
Richard_Cooke Offline
newbie


Registered: 09/06/07
Posts: 9
Loc: Toronto, ON, Canada, eh?
I'm setting up my own X10 monitoring system to complement my C-MAX program. But what I'm getting form the ReadX10 command does not match what the interface document says.

Specifically, the interface spec claims the house and key codes will be with the ranges given for the SendX10 command.

But as you can see below, I got 3 messages that are way outside of that range (for the keycode) values anyway.

Code:

invalid X10 data
ASCII is 6 for char: ♠
ASCII is 0 for char:
ASCII is 6 for char: ♠
ASCII is 4 for char: ♦
ASCII is 134 for char: å
ASCII is 3 for char: ♥
data left in buffer: '\x03'
>>> getX10()
invalid X10 data
ASCII is 6 for char: ♠
ASCII is 0 for char:
ASCII is 6 for char: ♠
ASCII is 4 for char: ♦
ASCII is 70 for char: F
ASCII is 2 for char: ☻
data left in buffer: '\x02'
>>> getX10()
invalid X10 data
ASCII is 6 for char: ♠
ASCII is 0 for char:
ASCII is 6 for char: ♠
ASCII is 4 for char: ♦
ASCII is 70 for char: F
ASCII is 1 for char: ☺
data left in buffer: '\x01'
>>> getX10()
invalid X10 data
ASCII is 6 for char: ♠
ASCII is 0 for char:
ASCII is 6 for char: ♠
ASCII is 4 for char: ♦
ASCII is 70 for char: F
ASCII is 0 for char:
data left in buffer: '\x00'



Any help appreciated!

ps: Each line is one byte of the message. I printed its ASCII value and the actual character for each byte.

My network is on house code "E" so the "4" is correct.
_________________________
Regards, Richard Cooke, Turnkey Automation Inc.

Top
#18704 - 09/06/07 08:46 PM Re: Question about CPU-XA serial protocol with X10 [Re: Richard_Cooke]
Richard_Cooke Offline
newbie


Registered: 09/06/07
Posts: 9
Loc: Toronto, ON, Canada, eh?
Another thing: I ran a program that uses the OCX and captured the serial traffic while it was poling X10 and the commands its sending (below) are not listed in the interface spec (well, one is).

First line is the message in hex, second same message converted to base-10.

Code:

2A 00 00 8F B7 00 2D EB
42 00 00 143 183 0 45 235

2A 00 00 91 AA 00 00 A6
42 00 00 145 170 00 00 166

C8 5F 00 00 00 00 00 27
200 95 00 00 00 00 00 39

C8 60 00 00 00 00 00 28
200 96 00 00 00 00 00 40

C8 32 00 00 00 00 00 FA
200 50 00 00 00 00 00 250 Get Latched I/O

2A 00 00 11 AA 00 3B FC
42 00 00 17 170 00 59 252

2A 00 00 91 AA 00 00 A6
42 00 00 145 170 00 00 166



Edited by Richard_Cooke (09/06/07 08:47 PM)
_________________________
Regards, Richard Cooke, Turnkey Automation Inc.

Top
#18705 - 09/07/07 10:40 AM Re: Question about CPU-XA serial protocol with X10 [Re: Richard_Cooke]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6401
Loc: Montreal, QC, Canada
Quote:


Code:

invalid X10 data
ASCII is 6 for char: ♠
ASCII is 0 for char:
ASCII is 6 for char: ♠
ASCII is 4 for char: ♦
ASCII is 134 for char: å
ASCII is 3 for char: ♥
data left in buffer: '\x03'
>>> getX10()
invalid X10 data
ASCII is 6 for char: ♠
ASCII is 0 for char:
ASCII is 6 for char: ♠
ASCII is 4 for char: ♦
ASCII is 70 for char: F
ASCII is 2 for char: ☻
data left in buffer: '\x02'
>>> getX10()
invalid X10 data







What you're seeing here is the interpreted received X10 command. When the controller receives X10 address and action commands, it interprets them just like a X10 device would (like an On command pair or Off command pair) and puts their new on or off status in the input buffer along with the raw received X10. This is explained in detail here:

http://www.appdigusers.com/forum/showflat.php/Cat/0/Number/187402/an/0/page/0#Post187402

In your two examples above, 134 corresponds to 86 hex, which means that device id 5 was turned on. Along with the previous house code byte = 4, it means that device E/5 was turned on. Similarly, 70 = 46 hex, so it looks like device E/5 was turned off.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#18706 - 09/07/07 10:46 AM Re: Question about CPU-XA serial protocol with X10 [Re: Richard_Cooke]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6401
Loc: Montreal, QC, Canada
Quote:

Another thing: I ran a program that uses the OCX and captured the serial traffic while it was polling X10 and the commands its sending (below) are not listed in the interface spec (well, one is).

First line is the message in hex, second same message converted to base-10.

Code:

2A 00 00 8F B7 00 2D EB
42 00 00 143 183 0 45 235

2A 00 00 91 AA 00 00 A6
42 00 00 145 170 00 00 166







42 00 00 ... commands are memory block dump commands. This is explained here:

http://www.appdigusers.com/forum/showflat.php/Cat/0/Number/187542/an/0/page/0#Post187542
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#18707 - 09/07/07 05:13 PM Re: Question about CPU-XA serial protocol with X10 [Re: Guy Lavoie]
Richard_Cooke Offline
newbie


Registered: 09/06/07
Posts: 9
Loc: Toronto, ON, Canada, eh?
Is there a way to get the raw X10 commands?

The OCX seems to dump the pairs out to me? (E 7,E on)

Although I wrote this Quick&Dirty program a few years ago, so I don't remember exactly what it does... And its in BC++ builder, which I did not bother to install on this machine since I'm ALL Python now.....
_________________________
Regards, Richard Cooke, Turnkey Automation Inc.

Top
#18708 - 09/07/07 05:15 PM Re: Question about CPU-XA serial protocol with X10 [Re: Richard_Cooke]
Richard_Cooke Offline
newbie


Registered: 09/06/07
Posts: 9
Loc: Toronto, ON, Canada, eh?
Something I'm doing trying to send the following sequence is crashing something - all serial comms stops, and I have to power down everything for a few seconds to get it back.

And, I think, it seems to be necessary to have some program loaded in the CPU-XA before it will handle X10 commands???

Would whatever is handling the commands be tied to the interpreter?
_________________________
Regards, Richard Cooke, Turnkey Automation Inc.

Top
#18709 - 09/07/07 09:11 PM Re: Question about CPU-XA serial protocol with X10 [Re: Richard_Cooke]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6401
Loc: Montreal, QC, Canada
Quote:

Is there a way to get the raw X10 commands?

The OCX seems to dump the pairs out to me? (E 7,E on)

Although I wrote this Quick&Dirty program a few years ago, so I don't remember exactly what it does... And its in BC++ builder, which I did not bother to install on this machine since I'm ALL Python now.....




You should be getting both the raw X10 and the interpreted commands. As the FAQ article I linked to explains, raw X10 is put in the queue and when a sequence of two or more raw commands allow an interpretation for a house/unit code, the interpreted command is also put in the queue. This allows the "IF Single X10" and "IF Status/Command Pair" instructions to get their input from the same queue.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#18710 - 09/07/07 09:12 PM Re: Question about CPU-XA serial protocol with X10 [Re: Richard_Cooke]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6401
Loc: Montreal, QC, Canada
Quote:

Something I'm doing trying to send the following sequence is crashing something - all serial comms stops, and I have to power down everything for a few seconds to get it back.

And, I think, it seems to be necessary to have some program loaded in the CPU-XA before it will handle X10 commands???

Would whatever is handling the commands be tied to the interpreter?




I'm not sure about the need for a program to be loaded in the controller, but it could be true.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#18711 - 09/08/07 12:55 PM Re: Question about CPU-XA serial protocol with X10 [Re: Guy Lavoie]
Richard_Cooke Offline
newbie


Registered: 09/06/07
Posts: 9
Loc: Toronto, ON, Canada, eh?
No, I don't think a program needs to be loaded. Will check that later sometime. Although the "Active" light might need to be blinking?

I apologize for my second-last post. I should have read what you recommended FIRST.

I do get both raw an interpreted commands.


My "hang" problem appears to have been caused by having XonXoff enabled. I already had RTSCTS and DTRDSR disabled. I disabled XonXoff and it stopped hanging.

So now I have a short, simple, X10 communication interface written in Python, so its platform portable!

sweet!
_________________________
Regards, Richard Cooke, Turnkey Automation Inc.

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
3 registered (pbir, Bent, Martin in Texas) and 31 anonymous users online.
Recent Posts
SECU16IR Output Connecting To A Xantech Connecting Block
by Jean-Marie
Today at 08:36 AM
SECU16IR Output Connecting To A Xantech Connecting Block
by Jean-Marie
Today at 08:34 AM
how to post an icon
by manu
02/03/12 03:40 AM
Command Pair
by kuro
02/01/12 12:49 AM
Does anyone have a copy of the latest TSE?
by sevenzenith1
01/30/12 05:17 AM
Shout Box

Newest Members
feshh, manu, kuro, chuck214, Funkhauser
2747 Registered Users
Forum Stats
2747 Members
19 Forums
3837 Topics
22713 Posts

Max Online: 67 @ 08/16/11 03:08 PM
February
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29