X10 Community Forum

🖥️ActiveHome Pro => SDK => Topic started by: marineau on December 24, 2006, 01:28:21 PM

Title: W800RF32A (Source code and sample request)
Post by: marineau on December 24, 2006, 01:28:21 PM
I just bought a product W800RF32A, and I will receive it on January 10th  2007

I would like to write my program today !
Does anyone can give me a source code(VB6, Visual Studio, or other VB) to read a COM on serial port and can to sort a data from serial port for X10 House code and Unit code?

Also does anyone can give me a data sample that comes from serial port ?

Thanks

Title: Re: W800RF32A (Source code and sample request)
Post by: Brian H on December 24, 2006, 04:14:07 PM
You may have found this in the WGL web already, but if not:
http://www.wgldesigns.com/w800.html
http://www.wgldesigns.com/protocols/w800rf32_protocol.txt
Title: Re: W800RF32A (Source code and sample request)
Post by: marineau on December 24, 2006, 04:40:36 PM
Thanks Brian, this will help me !     

On this document, I read this exemple:   
    A- 00004 OFF   00032: 11111001 00000110 11100011 00011100  . 

- But, a string 00032: is it include in incoming data ? 
- how define a StartBlock and FinishBlock ? 
- In others words, When a Block begin, and when a block is finished ? 
- Does each command have a same length ? 
- Is it possible that this module can receive a half (incomplete) command ?

Thanks
Title: Re: W800RF32A (Source code and sample request)
Post by: David Mark on December 24, 2006, 08:02:03 PM
1. Four bytes per packet (one packet = one command.)
2. You don't know when a block will begin or end, it is just a stream of bytes and it is up to your software to determine what is valid and what is not (by checking the data integrity as described in the protocol.)
3. Stream can be interrupted or corrupted with noise at any given time.
4. Camera remotes do not follow WGL's checksum scheme.

Have fun!
Title: Re: W800RF32A (Source code and sample request)
Post by: marineau on December 24, 2006, 10:11:17 PM
1. Four bytes per packet (one packet = one command.)

if anyone hold a button while 1 second on ss13a, how can i know separation of each package :

11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
chr(255);chr(255);chr(255);chr(255);chr(255);chr(255);chr(255);chr(255);chr(255);chr(255);chr(255);chr(255);

Does exist a chr(0) between each block of 4 like this ?
chr(255);chr(255);chr(255);chr(255);chr(0);chr(255);chr(255);chr(255);chr(255);chr(0);chr(255);chr(255);chr(255);chr(255);chr(0)

Scuse me but I'm don't sure to this ?
Title: Re: W800RF32A (Source code and sample request)
Post by: David Mark on December 24, 2006, 11:25:38 PM
No there is no delimiter character between each four byte sequence.  Held buttons of any kind result in repeated commands.  As I recall, pushing a button on any X10 RF remote results in repeated commands and the transceiver does not suppress them (it is up to your software.)
Title: Re: W800RF32A (Source code and sample request)
Post by: Charles Sullivan on December 25, 2006, 12:43:03 AM
I just bought a product W800RF32A, and I will receive it on January 10th  2007

I would like to write my program today !
Does anyone can give me a source code(VB6, Visual Studio, or other VB) to read a COM on serial port and can to sort a data from serial port for X10 House code and Unit code?

Also does anyone can give me a data sample that comes from serial port ?


Marineau,
Get the protocol for the CM17A Firecracker device, which is less confusing than the info from WGL.
  http://software.x10.com/pub/manuals/cm17a_protocol.txt
This document describes 2 bytes of data for each standard X10 RF command.

The W800RF32A sends groups of 4 bytes of data to the serial port.  For standard X10 RF, the 1st and 3rd of these are the same 2 bytes as for the CM17A.  The 2nd byte is the complement of the 1st and the 4th is the complement of the 3rd.  As David Mark points out, the 4 bytes for RF from Ninja controllers or from X10 Security RF devices are different, but you can start with the standard X10 and extend your code later.

Examples:
B1 On:  0x70  0x8F  0x00  0xFF
B1 Off:  0x70  0x8F  0x20  0xDF
B9 On:  0x74  0x8B  0x00 0xFF
B9 Off:  0x74  0x8B  0x20 0xDF

Since there's no separator between each group of 4 bytes, you have to take measures to stay in sync.  E.g., if you haven't read a byte in some appropriate period of time, you know that you're waiting for the 1st byte of a transmission.  The W800RF32A seems to be fairly reliable in always sending complete groups of 4 bytes, however as David Mark also points out, the bytes may be noise or be corrupted.

Title: Re: W800RF32A (Source code and sample request)
Post by: Brian H on December 25, 2006, 07:15:51 AM
You may want to look here also. Near the top of the page is three things on RF protocol.
Dave Houston's gives some code samples and there is also one on the Extended Codes that may help you.
http://www.idobartana.com/hakb/index.htm (http://www.idobartana.com/hakb/index.htm)