[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
Re: Problems with solving 0xA5 (time request after power off)
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.
"Jose Juan" <josejuan40@xxxxxxxxxxx> wrote:
>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:
>
>> 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" <josejuan40@xxxxxxxxxxx> wrote:
>>
>> >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
comp.home.automation Main Index |
comp.home.automation Thread Index |
comp.home.automation Home |
Archives Home