[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

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



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" <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