X10 Community Forum

🔌General Home Automation => Original ActiveHome => Topic started by: Ithacan on November 20, 2012, 10:47:20 PM

Title: CM11 Communication, Interface ready problem 0x55
Post by: Ithacan on November 20, 2012, 10:47:20 PM
I am trying to write a python serial driver for my CM11a.
I can read that the device wants the timer set.
I can program the interface clock.
It returns the proper checksum and no longer poles.
When I try to issue a simple command sequence
0x04, 0x66
I get the appropriate checksum returned.
When I acknowledge with 0x00, I get nothing.
I'm expecting 0x55 (ready)

I've tried with and without batteries in the CM11a.
I've tried every format that I can think of to send 0x00.
But in the end I get nothing back indicating that the device is ready.

I'm using python and pyserial for the communication. The commands below show what I'm sending to the controller.

ser.write(chr(0x04)+chr(0x66))
ser.read(1)
ser.write(chr(0x00))
ser.read(1)

Any help on this is appreciated. -Kind Regards
Title: Re: CM11 Communication, Interface ready problem 0x55
Post by: dhouston on November 21, 2012, 05:26:47 AM
I've never used Python so am unfamiliar with its syntax but you need to be sending hex values not Ascii characters.
Title: Re: CM11 Communication, Interface ready problem 0x55
Post by: Ithacan on November 21, 2012, 07:26:04 AM
thanks for the quick reply and the redirection to the more appropriate forum.

It is my understanding that sending the character representation of a hex value is equivalent, i.e. it sends one byte defined by the hex value. I have some confimation from this in that I program the interface clock and the checksum returned is correct. Also, the length command states that length(chr(0x00)) = 1, not 4). Printing chr(0x66), for example, puts out the character 'f'.

I'd be curious if there is a good way to verify what I sent. Are there other programs that can sniff the output or do I need to hook it up to another computer and do reads?

Thanks for people's patience with this newbie question on old x10 devices. I've put in many hours beating my head against this one. I'm sure that I'm doing something dumb.

Are there any line feeds or carriage returns needed in the output after each transmission? I am not intentionally putting any in.
Title: Re: CM11 Communication, Interface ready problem 0x55
Post by: dhouston on November 21, 2012, 09:33:52 AM
Like I wrote, I'm not familiar with Python syntax but using chr() seems a bit confusing.

You can use a loopback plug to see what you are sending.