Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with solving 0xA5 (time request after power off)

37 views
Skip to first unread message

Jose Juan

unread,
Dec 22, 2005, 6:11:22 PM12/22/05
to
Greetings.

I have recently bought a CM11G (RS232) and i've got this problem: when
trying (with my own software) to send commands following the protocol,
i only get a 0xA5 (CM11 asking for the time to be resent, as far as i'm
concerned). Well, following the protocol, i send the time, but once it
gets the 0x9b value, it seems to get locked and it doesn't listen nor
send anything else, i have to unplug and plug again. What i am supposed
to send the CM11 in such situation? I have read in many places that
people have the same problem, but don't tell how to fix it properly!

THank you all in advance.

Jose Juan Martinez

Dave Houston

unread,
Dec 22, 2005, 7:46:20 PM12/22/05
to
You might have errors in the time data following the 0x9B. I know you can
send partial data and the only thing that happens is the CM11A doesn't
return a checksum but does stop sending the 0xA5 poll.

Try sending just 0x9B. That will satisfy the CM11A. Of course, the CM11G
might have different firmware.

If it will help I can post some VB code that works.

Jose Juan

unread,
Dec 23, 2005, 3:47:51 AM12/23/05
to
THank you very much Dave, unfortunately i also proved to write only
0x9B but it gets locked, as always. If you could show me a piece of
code i would be most grateful. Incidentally, where can i get some
specifications about CM11G? It seems having the same features as the
other ones.

This is the code i have, in java:

//data available in serial port
if( entrada.available() > 0 )
{
int nBytes = entrada.read( bufferLectura );
for(int i=0;nBytes>i;i++)
System.out.println("Got byte " + i + "="+
(bufferLectura[i]&0xff));
puertoSerie.close();
if(nBytes==1)
{
Resultado=bufferLectura[0];

if((Resultado&0xff)==0xA5)
{
byte tiempo[]=new byte[7];
tiempo[0]=(byte)(0x9b);
tiempo[1]=(byte)(0x13);
tiempo[2]=(byte)(0x40);
tiempo[3]=(byte)(0x0A);
tiempo[4]=(byte)(0x48);
tiempo[5]=(byte)(0x82);
tiempo[6]=(byte)(0x60);
for(int i=0;i<6 ;i++)
WriteByteSerialPort(tiempo[i]);
}
}
}


Dave Houston ha escrito:

Dave Houston

unread,
Dec 23, 2005, 7:37:18 AM12/23/05
to
I don't know where you might find specifications other than the protocol
documentation on the X-10 website. In the past all of the European versions
had the same firmware as the CM11A with the only differences being the plug
style and case. Software that worked for the CM11A also worked for all of
the European versions as well. But, I'm not sure all of the models now
available in Europe (especially the USB model) are made by X-10 so the
firmware may now differ. The fact that yours is not satisfied by just 0x9B
makes me think the firmware has changed.

I'm sorry but I'm not very literate in Java and my college Spanish has
mostly been forgotten but it looks like you're just sending dummy bytes
which should be OK unless the CM11G finds one of the values upsetting.

Here's a REALbasic code snippet that works with my CM11As.

Dim s As String
Dim chkSum As Integer 'RB integers are 32 bits
Dim i As Integer

s=chr(&H9B)
s=s+chr(d.second)
s=s+chr(d.minute+((d.hour MOD 2)*60))
s=s+chr(d.hour\2)
s=s+chr(d.dayofyear MOD 256)
s=s+chr(((d.dayofyear\256)*&H80)+Pow(2,d.dayofweek-1))
s=s+chr(monitored*&H10)
For i=2 to len(s)
chkSum=chkSum+asc(mid(s,i,1))
Next
chkSum=chkSum MOD 256
serial1.write(s)
'CM11A will return the checksum if all is well
'for less than 7 bytes it will not return a checksum
'but will stop sending the A5 poll

The protocol documentation is at...

http://software.x10.com/pub/manuals/cm11a_protocol.txt

but it seems like you already have it.

Have you tried setting the interface time with ActiveHome? If ActiveHome
locks it up then it's probably a defective unit. If not, try watching what
it sends with serial port sniffer software.

I no longer have a web page so you cannot download it but I have a REALbasic
example application for the CM11A which demonstrates most of its features
(no macros). Unforunately, RB makes monstrous executables (this one is ~3MB)
so it's not practical to email it unless you have an email account that you
know will accept it.

Dave Houston

unread,
Dec 23, 2005, 8:03:59 AM12/23/05
to
I think I just noticed something in your code but it may be that I'm just
misreading the Java.

When the CM11A needs the time reset all it sends is 0xA5. I think your code
is failing before you ever get to the point where you send the 7 bytes.

Jose Juan

unread,
Dec 23, 2005, 9:50:43 AM12/23/05
to
Once i've proved all unsuccessfully, i got the (stupid) solution.

I was testing it in my lab, and the problem was that the CM11 was
connected to the outlet with a router and a switch, and these made
noise on it... even ActiveHome couldn't set the time! So i switched off
all them and left CM11, and ActiveHome worked, and time set is no
longer needed.

Thank you for your help!

0 new messages